XiYan MCP Server
An MCP server that enables natural language queries to MySQL and PostgreSQL databases using XiYan-SQL — an advanced text-to-SQL model for converting natural language into SQL queries.
Get this MCP server
An MCP server that enables natural language queries to MySQL and PostgreSQL databases using XiYan-SQL — an advanced text-to-SQL model for converting natural language into SQL queries.
Installation
pip
pip install xiyan-mcp-server
From source code
pip install git+https://github.com/XGenerationLab/xiyan_mcp_server.git
Smithery.ai
@XGenerationLab/xiyan_mcp_server
Configuration
Claude Desktop
{
"mcpServers": {
"xiyan-mcp-server": {
"command": "/xxx/python",
"args": [
"-m",
"xiyan_mcp_server"
],
"env": {
"YML": "PATH/TO/YML"
}
}
}
}
Cursor (stdio)
{
"mcpServers": {
"xiyan-mcp-server": {
"command": "/xxx/python",
"args": [
"-m",
"xiyan_mcp_server"
],
"env": {
"YML": "path/to/yml"
}
}
}
}
Cursor (SSE)
{
"mcpServers": {
"xiyan_mcp_server_1": {
"url": "http://localhost:8000/sse"
}
}
}
Available Tools
| Tool | Description |
|---|---|
get_data |
Provides a natural language interface for retrieving data from the database by converting natural language... |
Features
- Natural language data retrieval via XiYanSQL
- Support for standard LLMs (GPT, qwenmax) and advanced text-to-SQL models
- Support for fully local mode (high security!)
- Support for MySQL and PostgreSQL databases
- Available tables list as resources
- Table content reading
- Support for stdio and SSE transport protocols
Environment Variables
Required
YML- Path to the YAML configuration file containing model and database settings
Notes
Requires Python 3.11+. Requires a YAML configuration file with model and database settings. Supports remote mode (requires API key) and local mode (more secure). The XiYanSQL model achieves state-of-the-art results on the Bird benchmark for text-to-SQL tasks.