# XGenerationLab/xiyan_mcp_server [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/XGenerationLab/xiyan_mcp_server  
**GitHub Stars:** 239  
**Views:** 10  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/xgenerationlab-xiyan-mcp-server

## Description
An MCP server that supports fetching data from a database using natural language queries, powered by XiyanSQL as the text-to-SQL LLM.

## Tools
Capabilities this server exposes over MCP:

- **get_data**

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "xiyan-mcp-server": {
    "command": "uvx",
    "args": ["xiyan-mcp-server"]
  }
}
```

## Documentation

## What XGenerationLab/xiyan_mcp_server does

XGenerationLab/xiyan_mcp_server provides a natural-language interface for querying MySQL and PostgreSQL databases through MCP. Its main tool, `get_data`, accepts a user request, generates SQL with the configured language model, executes that query against the configured database, and returns the results.

The server also exposes database information as MCP resources. A dialect resource lists the names of available databases, while a resource addressing a specific table can provide sample rows for model reference. These resources help the model understand the available schema and data before producing a query.

This places XGenerationLab/xiyan_mcp_server in the 🗄️ Databases category: it is intended for retrieving and inspecting relational data rather than modifying database records.

## How it works

The server supports two transport choices: `stdio` for local MCP client processes and `sse` for a network-accessible server. The default configuration uses `stdio`. SSE mode includes configurable port and logging settings, with port 8000 documented as the default.

For each natural-language request, the configured model generates text-to-SQL output. The server then uses the database connection settings to run the query and return the result. The model can be a general API-compatible LLM, the XiYanSQL-QwenCoder model through ModelScope or DashScope, or a local XiYanSQL model. Remote model configurations require an API key; the documented local mode does not.

## Setup and configuration

Python 3.11 or newer is required. Install the published package with:

```bash
pip install xiyan-mcp-server
```

A source installation is also documented through the GitHub repository. After installation, create a YAML configuration file with `mcp`, `model`, and `database` sections. The database section accepts host, port, user, password, and database values. The model section specifies its name, API key, and endpoint URL.

Database examples cover MySQL and PostgreSQL configuration. Client launch examples are provided for Claude Desktop, Cline, and Cursor; the README also includes a Goose example, which is not represented in this directory's client list.

## Tools and capabilities

- `get_data`: translate a natural-language request into SQL and retrieve database results.
- `{dialect}://`: list database names for the configured database system.
- `{dialect}://{table_name}`: expose sample data from a selected table.
- Use hosted general-purpose LLMs, XiYanSQL text-to-SQL models, or a local model.
- Run over stdio or SSE transport.

## Limitations and notes

XGenerationLab/xiyan_mcp_server documents support for MySQL and PostgreSQL only. It requires a YAML configuration file, and remote model use depends on the selected provider's endpoint and API key. Local mode avoids the API key requirement but uses a local model service. The Smithery installation path is marked as not fully tested in the project documentation. Query behavior depends on the generated SQL and the database schema supplied through configuration and resources.

_Full upstream README: https://allmcps.com/mcp/xgenerationlab-xiyan-mcp-server/readme_

