
How to add XiYan MCP Server to Windsurf
Natural-language queries to MySQL/PostgreSQL via XiYanSQL text-to-SQL Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.
Last updated June 14, 2026 · 236★ · stdio · apikey · official
Windsurf config for XiYan MCP Server
pip install xiyan-mcp-server{
"mcpServers": {
"xiyan-mcp-server": {
"command": "/xxx/python",
"args": [
"-m",
"xiyan_mcp_server"
],
"env": {
"YML": "PATH/TO/YML"
}
}
}
}Setup steps
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the XiYan MCP Server config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 5XiYan MCP Server's tools become available to Cascade.
Before you start
- Python 3.11+
- A YAML config file (referenced via the YML env var) with model and database settings
- A MySQL or PostgreSQL database
- For PostgreSQL: pip install psycopg2
- For remote model mode: an API key from the model service provider (e.g. Modelscope, OpenAI, Alibaba Cloud DashScope)
What XiYan MCP Server can do in Windsurf
get_dataProvides a natural language interface for retrieving data from a database. Converts the input natural language into SQL using a built-in/configured model and calls the database to return the query results.
Security
Configuration (including database credentials and the model API key) lives in a YAML file referenced by the YML env var. The default remote mode sends database schema/sample data to the configured model service provider and requires an API key. A pure local model mode is available for higher security and needs no API key. The Claude Desktop / Cursor config requires the full absolute path to the Python executable (e.g. from `which python`).
XiYan MCP Server + Windsurf FAQ
Where is the Windsurf config file?
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the XiYan MCP Server config there under the "mcpServers" key and restart the client.
Is XiYan MCP Server safe to use with Windsurf?
Configuration (including database credentials and the model API key) lives in a YAML file referenced by the YML env var. The default remote mode sends database schema/sample data to the configured model service provider and requires an API key. A pure local model mode is available for higher security and needs no API key. The Claude Desktop / Cursor config requires the full absolute path to the Python executable (e.g. from `which python`).
Which databases are supported?
MySQL and PostgreSQL. For PostgreSQL you must install psycopg2 and set dialect: "postgresql" in the YAML config. More dialects are planned.
Do I need an API key?
In the default remote mode you need an API key for the model service provider (e.g. Modelscope, OpenAI, or Alibaba Cloud DashScope). In pure local mode you deploy the model on your own server and no API key is required.
Which transports are supported?
stdio (default) and sse. The sse server runs on port 8000 by default (e.g. http://localhost:8000/sse). Note that Claude Desktop does not support the SSE transport.