Loading...

XiYan MCP server enables natural language queries to MySQL and PostgreSQL databases using the XiYanSQL text-to-SQL model, supporting both remote and local deployment.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
XiYan MCP server enables natural language queries to MySQL and PostgreSQL databases using the XiYanSQL text-to-SQL model, supporting both remote and local deployment.
The XiYan MCP server presents moderate risk due to its ability to execute SQL queries. Local deployment significantly reduces risk by eliminating external API dependencies. Securely managing database credentials and validating LLM configurations are crucial for safe operation.
Performance depends on the complexity of the SQL queries and the speed of the LLM. Local models may be slower than cloud-based models.
Using cloud-based LLMs incurs costs based on API usage (tokens, requests). Local models eliminate these costs but require more computational resources.
pip install xiyan-mcp-server{
"mcpServers": {
"xiyan-mcp-server": {
"command": "/xxx/python",
"args": [
"-m",
"xiyan_mcp_server"
],
"env": {
"YML": "PATH/TO/YML"
}
}
}
}YMLSQLget_dataRetrieves data from a database using natural language queries converted to SQL.
Executes SQL queries, which can potentially modify data.
{dialect}://{table_name}Obtains sample data from a specified database table for model reference.
Provides read-only access to a portion of the table data.
{dialect}://Lists the names of the databases available in the current connection.
Provides read-only access to database names.
API Key
hybrid
The XiYan MCP server presents moderate risk due to its ability to execute SQL queries. Local deployment significantly reduces risk by eliminating external API dependencies. Securely managing database credentials and validating LLM configurations are crucial for safe operation.
The level of autonomy depends on the configuration of the LLM and the permissions granted to the database user. Exercise caution when granting write access.
Production Tip
Implement robust input validation and sanitization to prevent SQL injection attacks.
Currently, XiYan MCP Server supports MySQL and PostgreSQL.
You can configure the server to use a local LLM by specifying the model name, an empty API key, and the local URL in the YAML configuration file. See the documentation for details.
Yes, you can limit access by carefully crafting the SQL queries generated by the LLM and by granting limited permissions to the database user.
Remote mode uses a cloud-based LLM, while local mode uses an LLM deployed on your own server. Local mode offers enhanced security and privacy.
Provide clear and specific natural language queries, and ensure that the database schema is well-documented and understood by the LLM.
You need an API-inference key from Modelscope, which you can apply for on their website.
Check the database configuration in the YAML file, ensure that the database server is running, and verify that the database user has the necessary permissions.