Skip to content
MCP server

xiyan_mcp_server

MCP server that turns natural-language questions into SQL queries on MySQL and PostgreSQL

xiyan_mcp_server is an open-source MCP server for databases. It is available on CLI, API, Self-hosted, macOS, Windows and Linux.

Pricing
Open source
Platforms
CLI, API, Self-hosted
What it can do
Read-only
GitHub stars
238
Last commit
Language
Python

Similar MCP servers

About xiyan_mcp_server

XiYan MCP Server lets AI clients query a relational database by asking in plain language. It exposes a get_data tool that converts a request into SQL, runs it against the configured MySQL or PostgreSQL database, and returns the rows. Table listings and sample rows are available as resources so the model can see the schema before writing a query.

The conversion step can use a dedicated text-to-SQL model hosted on ModelScope or DashScope, a local model deployed on your own server so no API key is needed, or a general LLM such as GPT or Qwen through its API. Configuration lives in a single YAML file, and the server can run over stdio or SSE.

It suits developers and data teams who want an assistant to answer ad hoc questions over an existing database from Claude Desktop, Cursor, Cline or Goose, without writing SQL by hand.

Tools this server provides (1)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, all 1 tool only read data.

From the server's own tool labels and tool names; not verified by us.

get_dataName suggests: reads
Converts a natural language request into SQL, runs it on the database and returns the results.

What it does

Natural language querying
The get_data tool translates a plain-language question into SQL and returns the query results.
Table and schema resources
Database names and sample rows from each table are exposed as resources to guide the model.
Multiple LLM backends
Works with a text-to-SQL model on ModelScope or DashScope, a local model, or general LLMs via API.
Fully local mode
A locally deployed model keeps queries and data on your own server without an external API key.
MySQL and PostgreSQL support
Connects to MySQL or PostgreSQL databases configured through a YAML file.
stdio and SSE transports
Can run as a local process for desktop clients or as an SSE server over the network.

Good for

  • Asking a company database questions in plain English from an AI desktop client
  • Building a quick reporting assistant over an existing MySQL or PostgreSQL database
  • Letting analysts explore table contents without writing SQL
  • Keeping database queries on-premises by running the model locally

Pricing

Open source

Open-source under Apache-2.0; hosted model access may require a separate key.

xiyan_mcp_server FAQ

Which databases are supported?

The server currently supports MySQL and PostgreSQL, with other dialects mentioned as planned.

Does xiyan_mcp_server need an API key?

Not in local mode, where a model is deployed on your own server. The hosted ModelScope and DashScope options and general LLM APIs require a key.

How do I install xiyan_mcp_server?

Install with pip install xiyan-mcp-server, which requires Python 3.11 or newer.

Which AI clients can use xiyan_mcp_server?

The README gives setup examples for Claude Desktop, Cline, Goose, Cursor and Witsy, using stdio or SSE.

Is xiyan_mcp_server free?

Yes. xiyan_mcp_server is open source, so you can use and self-host it for free.

What are the best alternatives to xiyan_mcp_server?

The closest alternatives to xiyan_mcp_server are pgmcp, mysql_mcp_server, sql-query-mcp, text2sql and nlqueries.

Where this comes from

  • Description: written from the project's README.

How AIPoweredBot checks servers