XiYan MCP Server
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Enables natural language queries to MySQL databases, allowing users to fetch data, list available tables, and read table contents using natural language commands, powered by XiYanSQL text-to-SQL technology.
Supports use of OpenAI models like GPT-3.5-turbo for processing natural language queries to SQL databases, configurable through the server settings.
XiYan MCP Server
A Model Context Protocol (MCP) server that enables natural language queries to MySQL databases, power by XiYanSQL(https://github.com/XGenerationLab/XiYan-SQL) as text-to-sql technique.
Features
- Fetch data by natural language throught XiYanSQL (https://github.com/XGenerationLab/XiYan-SQL)
- List available MySQL tables as resources
- Read table contents
Installation
Python 3.11+ is required. you can install the server by a pre-release verion
After that you can directly run the server by:
But it does not provide any functions until you complete following config. You will get a yml file. After that you can run the server by:
Configuration
You need a yml config file to configure the server. a default config file is provided in config_demo.yml which looks like this:
About LLM
Name is the name of the model to use, key is the API key of the model, url is the API url of the model.
Using general LLMs
if you want to use the general LLMs, e.g. gpt3.5, you can directly config like this:
if you want to use Qwen from alibaba, e.g. Qwen-max,
Using Text-to-SQL SOTA model
Last, we recommend the XiYanSQL-qwencoder-32B (https://github.com/XGenerationLab/XiYanSQL-QwenCoder), which is the SOTA model in text-to-sql. We deployed the model on DashScope, so you need to set the following environment variables: Contact us to get the key.
Local LLMs
To support in the future.
About the database
host, port, user, password, database are the connection information of the MySQL database.
You can use local or any remote databases. Currently we support MySQL (more dialects soon)
Citation
If you find our work helpful, feel free to give us a cite.
This server cannot be installed
A Model Context Protocol server that enables natural language queries to MySQL databases, powered by XiYanSQL text-to-SQL technology.