focus_mcp_sql

by FocusSearch

Integrations

  • Provides a Discord server link for contact and support

  • Supports converting natural language to SQL for MySQL databases

  • Provides a WeChat QR code for contact and support

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:

FeatureTraditional LLM Frameworksfocus_mcp_sql
Generation ProcessBlack box, direct SQL generationTransparent, two-step (keywords + SQL)
Hallucination RiskHigh, depends on model qualityLow, controllable (keyword verification)
SpeedSlow, relies on large model inferenceFast, deterministic keyword-to-SQL
CostHigh, requires advanced modelsLow, reduces reliance on large models
Non-Technical User FriendlinessLow, hard to verify resultsHigh, 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:
    1. Register an account in Datafocus
    2. Create an application
    3. Enter the application
    4. Admin -> Interface authentication -> Bearer Token -> New Bearer Token

Installation

  1. Clone this repository:
git clone https://github.com/FocusSearch/focus_mcp_sql.git cd focus_mcp_sql
  1. 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 model
  • bearer (required): bearer token
  • language (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 参数说明:

名称位置类型必选说明
modelbodyobjectnone
» typebodystring数据库类型
» versionbodystring数据库版本
» tablesbody[object]表结构列表
»» tableDisplayNamebodystring表显示名
»» tableNamebodystring表原始名
»» columnsbody[object]表列列表
»»» columnDisplayNamebodystring列显示名
»»» columnNamebodystring列原始名
»»» dataTypebodystring列数据类型
»»» aggregationbodystring列聚合方式
» relationsbody[object]表关联关系列表
»» conditionsbody[object]关联条件
»»» dstColNamebodystringdimension 表关联列原始名
»»» srcColNamebodystringfact 表关联列原始名
»» dimensionTablebodystringdimension 表原始名
»» factTablebodystringfact 表原始名
»» joinTypebodystring关联类型

2. gptText2sqlChat

Convert natural language to SQL.

Parameters:

  • chatId (required): chat id
  • input (required): Natural language
  • bearer (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

  1. vsCode install cline plugin
  2. mcp server config
  3. use
    1. initial model
    2. transfer: what is the max age

Contact:

https://discord.gg/mFa3yeq9

-
security - not tested
A
license - permissive license
-
quality - not tested

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.

A NL2SQL plugin based on FocusSearch keyword parsing, offering greater accuracy, higher speed, and more reliability!

  1. There are already so many Text-to-SQL frameworks. Why do we still need another one?
    1. Comparison Analysis Table
    2. Features
    3. Prerequisites
    4. Installation
    5. MCP Configuration
    6. Available Tools
    7. Response Format
    8. Visual Studio Code Cline Sample
    9. Contact:

Related MCP Servers

  • -
    security
    F
    license
    -
    quality
    Enables LLMs to perform semantic search and document management using ChromaDB, supporting natural language queries with intuitive similarity metrics for retrieval augmented generation applications.
    Last updated -
    Python
    • Apple
  • -
    security
    A
    license
    -
    quality
    The intelligent data query plugin under DataFocus that supports multi-round conversations provides plug-and-play ChatBI capabilities.
    Last updated -
    3
    Apache 2.0
  • -
    security
    F
    license
    -
    quality
    A natural language interface that allows Claude to execute SQL queries on your local MySQL databases, enabling database interaction using natural language.
    Last updated -
    2
    Python
    • Linux
    • Apple
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol server that enables natural language queries to MySQL databases, powered by XiYanSQL text-to-SQL technology.
    Last updated -
    114
    Python
    Apache 2.0
    • Linux
    • Apple

View all related MCP servers

ID: xnaaueijnh