Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mseep_xiyan_mcp_server-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mseep_xiyan_mcp_server-0.1.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

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

Hashes for mseep_xiyan_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9ec509d1b96d6a78f908ba5e277e49e48737485e0b379399244c9c5329c92fe5
MD5 767bd229ce34d7da55cc00320963c015
BLAKE2b-256 3eb3b698d98b7d2974eea624920a5abc3946464b2d6d6fe20460792aaf897ed4

See more details on using hashes here.

File details

Details for the file mseep_xiyan_mcp_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mseep_xiyan_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8912542391903f9bd2c87b37e02e6f5c5d72403840a190bef889132c8416dc86
MD5 ff4f98fef33b6bfd37a5c5195bf754fd
BLAKE2b-256 5374ef65a7fed9b2e10b15bc0f3a79057c547447f24897a977717c5e236fc722

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page