MCP server for querying MySQL or PostgreSQL databases with natural-language requests converted to SQL.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Xiyan MCP Server.
get_dataCallable MCP tool function
A Model Context Protocol (MCP) server that enables natural language queries to databases
powered by XiYan-SQL, SOTA of text-to-sql on open benchmarks
π» XiYan-mcp-server |
π XiYan-SQL |
π Arxiv |
π XiYanSQL Model |
π PapersWithCode
π€ HuggingFace |
π€ ModelScope |
π ζθ¨GBI
English | δΈζ | ζ₯ζ¬θͺ
Ding GroupιιηΎ€ο½
Follow me on Weibo
There are two ways to integrate this server in your project, as shown below: The left is remote mode, which is the default mode. It requires an API key to access the xiyanSQL-qwencoder-32B model from service provider (see Configuration). Another mode is local mode, which is more secure. It does not require the API key.

The following figure illustrates the performance of the XiYan MCP server as measured by the MCPBench benchmark. The XiYan MCP server demonstrates superior performance compared to both the MySQL MCP server and the PostgreSQL MCP server, achieving a lead of 2-22 percentage points. The detailed experiment results can be found at MCPBench and the report "Evaluation Report on MCP Servers".

The tool get_data provides a natural language interface for retrieving data from a database. This server will convert the input natural language into SQL using a built-in model and call the database to return the query results.
The {dialect}://{table_name} resource allows obtaining a portion of sample data from the database for model reference when a specific table_name is specified.
The {dialect}:// resource will list the names of the current databases
Python 3.11+ is required. You can install the server through pip, and it will install the latest version:
If you want to install the development version from source, you can install from source code on github:
See @XGenerationLab/xiyan_mcp_server
Not fully tested.
You need a YAML config file to configure the server. A default config file is provided in config_demo.yml which looks like this:
You can set the transport protocol to stdio or sse.
For stdio protocol, you can set just like this:
For sse protocol, you can set mcp config as below:
The default port is 8000. You can change the port if needed.
The default log level is ERROR. We recommend to set log level to INFO for more detailed information.
Other configurations like debug, host, sse_path, message_path can be customized as well, but normally you don't need to modify them.
Name is the name of the model to use, key is the API key of the model, url is the API url of the model. We support following models.
| versions | general LLMs(GPT,qwenmax) | SOTA model by Modelscope | SOTA model by Dashscope | Local LLMs |
|---|---|---|---|---|
| description | basic, easy to use | best performance, stable, recommand | best performance, for trial | slow, high-security |
| name | the official model name (e.g. gpt-3.5-turbo,qwen-max) | XGenerationLab/XiYanSQL-QwenCoder-32B-2412 | xiyansql-qwencoder-32b | xiyansql-qwencoder-3b |
| key | the API key of the service provider (e.g. OpenAI, Alibaba Cloud) | the API key of modelscope | the API key via email | "" |
| url | the endpoint of the service provider (e.g."https://api.openai.com/v1") | https://api-inference.modelscope.cn/v1/ | https://xiyan-stream.biz.aliyun.com/service/api/xiyan-sql | http://localhost:5090 |
If you want to use the general LLMs, e.g. gpt3.5, you can directly config like this:
If you want to use Qwen from Alibaba, e.g. Qwen-max, you can use following config:
We recommend the XiYanSQL-qwencoder-32B (https://github.com/XGenerationLab/XiYanSQL-QwenCoder), which is the SOTA model in text-to-sql, see Bird benchmark. There are two ways to use the model. You can use either of them. (1) Modelscope, (2) Alibaba Cloud DashScope.
You need to apply a key of API-inference from Modelscope, https://www.modelscope.cn/docs/model-service/API-Inference/intro
Then you can use the following config:
Read our model description for more details.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/xgenerationlab-xiyan-mcp-server)<a href="https://allmcps.com/mcp/xgenerationlab-xiyan-mcp-server"><img src="https://allmcps.com/api/badge/xgenerationlab-xiyan-mcp-server?style=directory" alt="Xiyan MCP Server on AllMCPs" /></a>