A NL2SQL plugin based on FocusSearch keyword parsing, offering greater accuracy, higher speed, and more reliability!
What is FocusSearch focus mcp sql
FOCUS DATA MCP Server [中文]
A Model Context Protocol (MCP) server enables artificial intelligence assistants to convert natural language into SQL statements.
There are already so many Text-to-SQL frameworks. Why do we still need another one?
In simple terms, focus_mcp_sql adopts a two-step SQL generation solution, which enables control over the hallucinations of LLM and truly builds the trust of non-technical users in the generated SQL results.
Below is the comparison table between focus_mcp_sql and others:
Comparison Analysis Table
Here’s a side-by-side comparison of focus_mcp_sql with other LLM-based frameworks:
Feature | Traditional LLM Frameworks | focus_mcp_sql |
---|---|---|
Generation Process | Black box, direct SQL generation | Transparent, two-step (keywords + SQL) |
Hallucination Risk | High, depends on model quality | Low, controllable (keyword verification) |
Speed | Slow, relies on large model inference | Fast, deterministic keyword-to-SQL |
Cost | High, requires advanced models | Low, reduces reliance on large models |
Non-Technical User Friendliness | Low, hard to verify results | High, easy keyword checking |
Features
-Initialize the model -Convert natural language to SQL statements
Prerequisites
- jdk 23 or higher. Download jdk
- gradle 8.12 or higher. Download gradle
- register Datafocus to obtain bearer token:
- Register an account in Datafocus
- Create an application
- Enter the application
- Admin -> Interface authentication -> Bearer Token -> New Bearer Token !bearer token
Installation
- Clone this repository:
git clone https://github.com/FocusSearch/focus_mcp_sql.git
cd focus_mcp_sql
- Build the server:
gradle clean
gradle bootJar
The jar path: build/libs/focus_mcp_sql.jar
MCP Configuration
Add the server to your MCP settings file:
{
"mcpServers": {
"focus_mcp_data": {
"command": "java",
"args": [
"-jar",
"path/to/focus_mcp_sql/focus_mcp_sql.jar"
],
"autoApprove": [
"gptText2sqlStart",
"gptText2sqlChat"
]
}
}
}
Available Tools
1. gptText2sqlStart
initial model.
Parameters:
model
(required): table modelbearer
(required): bearer tokenlanguage
(optional): language ['english','chinese']
Example:
{
"model": {
"tables": [
{
"columns": [
{
"columnDisplayName": "name",
"dataType": "string",
"aggregation": "",
"columnName": "name"
},
{
"columnDisplayName": "address",
"dataType": "string",
"aggregation": "",
"columnName": "address"
},
{
"columnDisplayName": "age",
"dataType": "int",
"aggregation": "SUM",
"columnName": "age"
},
{
"columnDisplayName": "date",
"dataType": "timestamp",
"aggregation": "",
"columnName": "date"
}
],
"tableDisplayName": "test",
"tableName": "test"
}
],
"relations": [
],
"type": "mysql",
"version": "8.0"
},
"bearer": "ZTllYzAzZjM2YzA3NDA0ZGE3ZjguNDJhNDjNGU4NzkyYjY1OTY0YzUxYWU5NmU="
}
model 参数说明:
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
model | body | object | 是 | none |
» type | body | string | 是 | 数据库类型 |
» version | body | string | 是 | 数据库版本 |
» tables | body | [object] | 是 | 表结构列表 |
»» tableDisplayName | body | string | 否 | 表显示名 |
»» tableName | body | string | 否 | 表原始名 |
»» columns | body | [object] | 否 | 表列列表 |
»»» columnDisplayName | body | string | 是 | 列显示名 |
»»» columnName | body | string | 是 | 列原始名 |
»»» dataType | body | string | 是 | 列数据类型 |
»»» aggregation | body | string | 是 | 列聚合方式 |
» relations | body | [object] | 是 | 表关联关系列表 |
»» conditions | body | [object] | 否 | 关联条件 |
»»» dstColName | body | string | 否 | dimension 表关联列原始名 |
»»» srcColName | body | string | 否 | fact 表关联列原始名 |
»» dimensionTable | body | string | 否 | dimension 表原始名 |
»» factTable | body | string | 否 | fact 表原始名 |
»» joinType | body | string | 否 | 关联类型 |
2. gptText2sqlChat
Convert natural language to SQL.
Parameters:
chatId
(required): chat idinput
(required): Natural languagebearer
(required): bearer token
Example:
{
"chatId": "03975af5de4b4562938a985403f206d4",
"input": "what is the max age",
"bearer": "ZTllYzAzZjM2YzA3NDA0ZGE3ZjguNDJhNDjNGU4NzkyYjY1OTY0YzUxYWU5NmU="
}
Response Format
All tools return responses in the following format:
{
"errCode": 0,
"exception": "",
"msgParams": null,
"promptMsg": null,
"success": true,
"data": {
}
}
Visual Studio Code Cline Sample
- vsCode install cline plugin
- mcp server config !config mcp server
- use
- initial model !initial model1 !initial model2
- transfer: what is the max age !chat
Contact:
https://discord.gg/mFa3yeq9 !Datafocus
Leave a Comment
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
Brave Search MCP
Integrate Brave Search capabilities into Claude through MCP. Enables real-time web searches with privacy-focused results and comprehensive web coverage.
chrisdoc hevy mcp
sylphlab pdf reader mcp
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
aashari mcp server atlassian bitbucket
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.
aashari mcp server atlassian confluence
Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.
prisma prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Zzzccs123 mcp sentry
mcp sentry for typescript sdk
zhuzhoulin dify mcp server
zhongmingyuan mcp my mac
zhixiaoqiang desktop image manager mcp
MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)
Submit Your MCP Server
Share your MCP server with the community
Submit Now