focus_mcp_sql
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Integrations
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
Installation
- Clone this repository:
- Build the server:
MCP Configuration
Add the server to your MCP settings file:
Available Tools
1. gptText2sqlStart
initial model.
Parameters:
model
(required): table modelbearer
(required): bearer tokenlanguage
(optional): language ['english','chinese']
Example:
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:
Response Format
All tools return responses in the following format:
Visual Studio Code Cline Sample
- vsCode install cline plugin
- mcp server config
- use
- initial model
- transfer: what is the max age
Contact:
This server cannot be installed
A NL2SQL plugin based on FocusSearch keyword parsing, offering greater accuracy, higher speed, and more reliability!