A Model Context Protocol (MCP) server that using XiyanSQL with MySQL databases. This server allows AI assistants to list tables, read data, and execute natual language queries.
Project description
XiYan MCP Server
A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases. This server allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
Features
- Fetch data by natural language throught XiYanSQL (https://github.com/XGenerationLab/XiYan-SQL)
- List available MySQL tables as resources
- Read table contents
Installation
pip install xiyan-mcp-server
Configuration
Set the following environment variables:
MYSQL_HOST= # Database host
MYSQL_PORT= # Optional: Database port (defaults to 3306 if not specified)
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_DATABASE=
MODEL_NAME=
MODEL_KEY=
MODEL_URL=
Usage
With Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"xiyan": {
"command": "uv",
"args": [
"--directory",
"path/to/xiyan_mcp_server",
"run",
"xiyan_mcp_server"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "your_username",
"MYSQL_PASSWORD": "your_password",
"MYSQL_DATABASE": "your_database",
"MODEL_NAME": "your_model_name",
"MODEL_URL": "your_model enpoint",
"MODEL_KEY": "your_model_key"
}
}
}
}
As a standalone server
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m xiyan_mcp_server
Development
# Clone the repository
git clone https://github.com/XGenerationLab/xiyan_mcp_server.git
cd xiyan_mcp_server
# Create virtual environment
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
# Install development dependencies
pip install -r requirements.txt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mseep_xiyan_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: mseep_xiyan_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec509d1b96d6a78f908ba5e277e49e48737485e0b379399244c9c5329c92fe5
|
|
| MD5 |
767bd229ce34d7da55cc00320963c015
|
|
| BLAKE2b-256 |
3eb3b698d98b7d2974eea624920a5abc3946464b2d6d6fe20460792aaf897ed4
|
File details
Details for the file mseep_xiyan_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mseep_xiyan_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8912542391903f9bd2c87b37e02e6f5c5d72403840a190bef889132c8416dc86
|
|
| MD5 |
ff4f98fef33b6bfd37a5c5195bf754fd
|
|
| BLAKE2b-256 |
5374ef65a7fed9b2e10b15bc0f3a79057c547447f24897a977717c5e236fc722
|