{"type":"mcp_server","name":"xiyan_mcp_server","description":"XiYan MCP Server is a Model Context Protocol server enabling natural language queries to databases, powered by XiYan-SQL, a state-of-the-art text-to-SQL system on open benchmarks. It offers various resources, including","category":"AI","language":"Python","stars":236,"forks":4,"owner":"XGenerationLab","github_url":"https://github.com/XGenerationLab/xiyan_mcp_server","homepage":null,"setup":"## Setup\n\n**Installing from pip:**\n\n1.  Python 3.11+ is required.\n2.  Install the server through pip: `pip install xiyan-mcp-server`\n3.  Run the server: `python -m xiyan_mcp_server`\n4.  Complete the config to get a yml file.\n5.  Run the server with the yml config: `env YML=path/to/yml python -m xiyan_mcp_server`\n\n**Installing from Smithery.ai:**\n\n1.  See [@XGenerationLab/xiyan_mcp_server](https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server) (Not fully tested).\n\n**Configuration:**\n\n1.  Create a YAML config file (config_demo.yml).\n2.  Configure LLM settings (name, key, url) based on the chosen model (General LLMs, Text-to-SQL SOTA model, or Local Model).\n3.  Configure Database settings (host, port, user, password, database) for MySQL or PostgreSQL.\n\n**Local Model Setup:**\n\n1.  PC/Mac with at least 16GB RAM and 6GB disk space.\n2.  Install additional Python packages: `pip install flask modelscope torch==2.2.2 accelerate>=0.26.0 numpy=2.2.3`\n3.  (Optional) Manually download the model: `modelscope download --model XGenerationLab/XiYanSQL-QwenCoder-3B-2502`\n4.  Download and run the local server script: `python local_xiyan_server.py`\n5.  Configure config.yml to point to the local server.\n\n**PostgreSQL Setup:**\n\n1.  Install Python packages: `pip install psycopg2`\n2.  Prepare the config.yml with dialect set to `postgresql`.\n\n**Launch:**\n\n1.  Configure Claude Desktop, Cline, Goose, Cursor, or Witsy with the appropriate command and environment variables (YML path).","tools":"## Available Tools\n\n1.  Fetch data by natural language through [XiYanSQL](https://github.com/XGenerationLab/XiYan-SQL).\n2.  Support general LLMs (GPT,qwenmax), Text-to-SQL SOTA model.\n3.  Support pure local mode (high security!).\n4.  Support MySQL and PostgreSQL.\n5.  List available tables as resources.\n6.  Read table contents.\n7.  ``get_data`` tool provides a natural language interface for retrieving data from a database.\n8.  The ``{dialect}://{table_name}`` resource allows obtaining sample data from the database.\n9.  The ``{dialect}://`` resource will list the names of the current databases.","faq":null,"created_at":"2025-03-13T07:39:00+00:00","updated_at":"2025-03-28T15:03:04+00:00","source_url":"https://model-context-protocol.com/servers/natural-language-database-query-server","related_articles":[]}