├── .github
└── workflows
│ └── python-publish.yml
├── Dockerfile
├── LICENSE.txt
├── README.md
├── README_ja.md
├── README_zh.md
├── imgs
├── Paper-Arxiv-orange.svg
├── architecture.png
├── claude_desktop.jpg
├── dinggroup_out.png
├── exp_mcpbench.png
├── goose.jpg
├── logo.png
└── witsy.jpg
├── pyproject.toml
├── requirements.txt
├── setup.py
├── smithery.yaml
└── src
└── xiyan_mcp_server
├── __init__.py
├── __main__.py
├── config_demo.yml
├── database_env.py
├── local_model
├── README.md
└── local_xiyan_server.py
├── server.py
└── utils
├── common_util.py
├── db_config.py
├── db_mschema.py
├── db_source.py
├── db_util.py
├── file_util.py
├── llm_util.py
└── logger_util.py
/.github/workflows/python-publish.yml:
--------------------------------------------------------------------------------
1 | # This workflow will upload a Python Package to PyPI when a release is created
2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3 |
4 | # This workflow uses actions that are not certified by GitHub.
5 | # They are provided by a third-party and are governed by
6 | # separate terms of service, privacy policy, and support
7 | # documentation.
8 |
9 | name: Upload Python Package
10 |
11 | on:
12 | release:
13 | types: [published]
14 |
15 | permissions:
16 | contents: read
17 |
18 | jobs:
19 | release-build:
20 | runs-on: ubuntu-latest
21 |
22 | steps:
23 | - uses: actions/checkout@v4
24 |
25 | - uses: actions/setup-python@v5
26 | with:
27 | python-version: "3.x"
28 |
29 | - name: Build release distributions
30 | run: |
31 | # NOTE: put your own distribution build steps here.
32 | python -m pip install build
33 | python -m build
34 |
35 | - name: Upload distributions
36 | uses: actions/upload-artifact@v4
37 | with:
38 | name: release-dists
39 | path: dist/
40 |
41 | pypi-publish:
42 | runs-on: ubuntu-latest
43 | needs:
44 | - release-build
45 | permissions:
46 | # IMPORTANT: this permission is mandatory for trusted publishing
47 | id-token: write
48 |
49 | # Dedicated environments with protections for publishing are strongly recommended.
50 | # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51 | environment:
52 | name: pypi
53 | # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54 | # url: https://pypi.org/p/YOURPROJECT
55 | #
56 | # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57 | # ALTERNATIVE: exactly, uncomment the following line instead:
58 | # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59 |
60 | steps:
61 | - name: Retrieve release distributions
62 | uses: actions/download-artifact@v4
63 | with:
64 | name: release-dists
65 | path: dist/
66 |
67 | - name: Publish release distributions to PyPI
68 | uses: pypa/gh-action-pypi-publish@release/v1
69 | with:
70 | packages-dir: dist/
71 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # 使用Python 3.11作为基础镜像
2 | FROM python:3.11-slim
3 |
4 | # 设置工作目录
5 | WORKDIR /app
6 |
7 | #COPY requirements.txt .
8 | RUN pip install xiyan-mcp-server
9 |
10 |
11 | # 运行应用
12 | CMD ["python", "-m", "xiyan_mcp_server"]
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
XiYan MCP Server
3 |
4 |
5 |
6 |
7 | A Model Context Protocol (MCP) server that enables natural language queries to databases
8 | powered by XiYan-SQL, SOTA of text-to-sql on open benchmarks
9 |
34 |
35 |
36 | ## Table of Contents
37 |
38 | - [Features](#features)
39 | - [Preview](#preview)
40 | - [Architecture](#architecture)
41 | - [Best Practice](#best-practice)
42 | - [Tools Preview](#tools-preview)
43 | - [Installation](#installation)
44 | - [Installing from pip](#installing-from-pip)
45 | - [Installing from Smithery.ai](#installing-from-smitheryai)
46 | - [Configuration](#configuration)
47 | - [LLM Configuration](#llm-configuration)
48 | - [General LLMs](#general-llms)
49 | - [Text-to-SQL SOTA model](#text-to-sql-sota-model)
50 | - [Local Model](#local-model)
51 | - [Database Configuration](#database-configuration)
52 | - [MySQL](#mysql)
53 | - [PostgreSQL](#postgresql)
54 | - [Launch](#launch)
55 | - [Claude Desktop](#claude-desktop)
56 | - [Cline](#cline)
57 | - [Goose](#goose)
58 | - [Cursor](#cursor)
59 | - [It Does Not Work](#it-does-not-work)
60 | - [Citation](#citation)
61 |
62 |
63 | ## Features
64 | - 🌐 Fetch data by natural language through [XiYanSQL](https://github.com/XGenerationLab/XiYan-SQL)
65 | - 🤖 Support general LLMs (GPT,qwenmax), Text-to-SQL SOTA model
66 | - 💻 Support pure local mode (high security!)
67 | - 📝 Support MySQL and PostgreSQL.
68 | - 🖱️ List available tables as resources
69 | - 🔧 Read table contents
70 |
71 | ## Preview
72 | ### Architecture
73 | There are two ways to integrate this server in your project, as shown below:
74 | The left is remote mode, which is the default mode. It requires an API key to access the xiyanSQL-qwencoder-32B model from service provider (see [Configuration](#Configuration)).
75 | Another mode is local mode, which is more secure. It does not require the API key.
76 |
77 | 
78 | ### Best practice and reports
79 |
80 | ["Build a local data assistant using MCP + Modelscope API-Inference without writing a single line of code"](https://mp.weixin.qq.com/s/tzDelu0W4w6t9C0_yYRbHA)
81 |
82 | ["Xiyan MCP on Modelscope"](https://modelscope.cn/headlines/article/1142)
83 |
84 | ### Evaluation on MCPBench
85 | The following figure illustrates the performance of the XiYan MCP server as measured by the MCPBench benchmark. The XiYan MCP server demonstrates superior performance compared to both the MySQL MCP server and the PostgreSQL MCP server, achieving a lead of 2-22 percentage points. The detailed experiment results can be found at [MCPBench](https://github.com/modelscope/MCPBench) and the report ["Evaluation Report on MCP Servers"](https://arxiv.org/abs/2504.11094).
86 |
87 | 
88 |
89 | ### Tools Preview
90 | - The tool ``get_data`` provides a natural language interface for retrieving data from a database. This server will convert the input natural language into SQL using a built-in model and call the database to return the query results.
91 |
92 | - The ``{dialect}://{table_name}`` resource allows obtaining a portion of sample data from the database for model reference when a specific table_name is specified.
93 | - The ``{dialect}://`` resource will list the names of the current databases
94 |
95 | ## Installation
96 | ### Installing from pip
97 |
98 | Python 3.11+ is required.
99 | You can install the server through pip, and it will install the latest version:
100 |
101 | ```shell
102 | pip install xiyan-mcp-server
103 | ```
104 |
105 | If you want to install the development version from source, you can install from source code on github:
106 | ```shell
107 | pip install git+https://github.com/XGenerationLab/xiyan_mcp_server.git
108 | ```
109 |
110 | ### Installing from Smithery.ai
111 | See [@XGenerationLab/xiyan_mcp_server](https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server)
112 |
113 | Not fully tested.
114 |
115 | ## Configuration
116 |
117 | You need a YAML config file to configure the server.
118 | A default config file is provided in config_demo.yml which looks like this:
119 |
120 | ```yaml
121 | mcp:
122 | transport: "stdio"
123 | model:
124 | name: "XGenerationLab/XiYanSQL-QwenCoder-32B-2412"
125 | key: ""
126 | url: "https://api-inference.modelscope.cn/v1/"
127 | database:
128 | host: "localhost"
129 | port: 3306
130 | user: "root"
131 | password: ""
132 | database: ""
133 | ```
134 |
135 | ### MCP Configuration
136 | You can set the transport protocol to ``stdio`` or ``sse``.
137 | #### STDIO
138 | For stdio protocol, you can set just like this:
139 | ```yaml
140 | mcp:
141 | transport: "stdio"
142 | ```
143 | #### SSE
144 | For sse protocol, you can set mcp config as below:
145 | ```yaml
146 | mcp:
147 | transport: "sse"
148 | port: 8000
149 | log_level: "INFO"
150 | ```
151 | The default port is `8000`. You can change the port if needed.
152 | The default log level is `ERROR`. We recommend to set log level to `INFO` for more detailed information.
153 |
154 | Other configurations like `debug`, `host`, `sse_path`, `message_path` can be customized as well, but normally you don't need to modify them.
155 |
156 | ### LLM Configuration
157 | ``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. We support following models.
158 |
159 | | versions | general LLMs(GPT,qwenmax) | SOTA model by Modelscope | SOTA model by Dashscope | Local LLMs |
160 | |----------|-------------------------------|--------------------------------------------|-----------------------------------------------------------|-----------------------|
161 | | description| basic, easy to use | best performance, stable, recommand | best performance, for trial | slow, high-security |
162 | | name | the official model name (e.g. gpt-3.5-turbo,qwen-max) | XGenerationLab/XiYanSQL-QwenCoder-32B-2412 | xiyansql-qwencoder-32b | xiyansql-qwencoder-3b |
163 | | key | the API key of the service provider (e.g. OpenAI, Alibaba Cloud) | the API key of modelscope | the API key via email | "" |
164 | | url | the endpoint of the service provider (e.g."https://api.openai.com/v1") | https://api-inference.modelscope.cn/v1/ | https://xiyan-stream.biz.aliyun.com/service/api/xiyan-sql | http://localhost:5090 |
165 |
166 | #### General LLMs
167 | If you want to use the general LLMs, e.g. gpt3.5, you can directly config like this:
168 | ```yaml
169 | model:
170 | name: "gpt-3.5-turbo"
171 | key: "YOUR KEY "
172 | url: "https://api.openai.com/v1"
173 | database:
174 | ```
175 |
176 | If you want to use Qwen from Alibaba, e.g. Qwen-max, you can use following config:
177 | ```yaml
178 | model:
179 | name: "qwen-max"
180 | key: "YOUR KEY "
181 | url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
182 | database:
183 | ```
184 | #### Text-to-SQL SOTA model
185 | We recommend the XiYanSQL-qwencoder-32B (https://github.com/XGenerationLab/XiYanSQL-QwenCoder), which is the SOTA model in text-to-sql, see [Bird benchmark](https://bird-bench.github.io/).
186 | There are two ways to use the model. You can use either of them.
187 | (1) [Modelscope](https://www.modelscope.cn/models/XGenerationLab/XiYanSQL-QwenCoder-32B-2412), (2) Alibaba Cloud DashScope.
188 |
189 |
190 | ##### (1) Modelscope version
191 | You need to apply a ``key`` of API-inference from Modelscope, https://www.modelscope.cn/docs/model-service/API-Inference/intro
192 | Then you can use the following config:
193 | ```yaml
194 | model:
195 | name: "XGenerationLab/XiYanSQL-QwenCoder-32B-2412"
196 | key: ""
197 | url: "https://api-inference.modelscope.cn/v1/"
198 | ```
199 |
200 | Read our [model description](https://www.modelscope.cn/models/XGenerationLab/XiYanSQL-QwenCoder-32B-2412) for more details.
201 |
202 | ##### (2) Dashscope version
203 |
204 | We deployed the model on Alibaba Cloud DashScope, so you need to set the following environment variables:
205 | Send me your email to get the ``key``. ( godot.lzl@alibaba-inc.com )
206 | In the email, please attach the following information:
207 | ```yaml
208 | name: "YOUR NAME",
209 | email: "YOUR EMAIL",
210 | organization: "your college or Company or Organization"
211 | ```
212 | We will send you a ``key`` according to your email. And you can fill the ``key`` in the yml file.
213 | The ``key`` will be expired by 1 month or 200 queries or other legal restrictions.
214 |
215 |
216 | ```yaml
217 | model:
218 | name: "xiyansql-qwencoder-32b"
219 | key: "KEY"
220 | url: "https://xiyan-stream.biz.aliyun.com/service/api/xiyan-sql"
221 | ```
222 |
223 | Note: this model service is just for trial, if you need to use it in production, please contact us.
224 |
225 | ##### (3) Local version
226 | Alternatively, you can also deploy the model [XiYanSQL-qwencoder-32B](https://github.com/XGenerationLab/XiYanSQL-QwenCoder) on your own server.
227 | See [Local Model](src/xiyan_mcp_server/local_model/README.md) for more details.
228 |
229 |
230 | ### Database Configuration
231 | ``host``, ``port``, ``user``, ``password``, ``database`` are the connection information of the database.
232 |
233 | You can use local or any remote databases. Now we support MySQL and PostgreSQL(more dialects soon).
234 |
235 | #### MySQL
236 |
237 | ```yaml
238 | database:
239 | host: "localhost"
240 | port: 3306
241 | user: "root"
242 | password: ""
243 | database: ""
244 | ```
245 | #### PostgreSQL
246 | Step 1: Install Python packages
247 | ```bash
248 | pip install psycopg2
249 | ```
250 | Step 2: prepare the config.yml like this:
251 | ```yaml
252 | database:
253 | dialect: "postgresql"
254 | host: "localhost"
255 | port: 5432
256 | user: ""
257 | password: ""
258 | database: ""
259 | ```
260 |
261 | Note that ``dialect`` should be ``postgresql`` for postgresql.
262 | ## Launch
263 |
264 | ### Server Launch
265 |
266 | If you want to launch server with `sse`, you have to run the following command in a terminal:
267 | ```shell
268 | YML=path/to/yml python -m xiyan_mcp_server
269 | ```
270 | Then you should see the information on http://localhost:8000/sse in your browser. (Defaultly, change if your mcp server runs on other host/port)
271 |
272 | Otherwise, if you use `stdio` transport protocol, you usually declare the mcp server command in specific mcp application instead of launching it in a terminal.
273 | However, you can still debug with this command if needed.
274 |
275 | ### Client Setting
276 |
277 | #### Claude Desktop
278 | Add this in your Claude Desktop config file, ref Claude Desktop config example
279 | ```json
280 | {
281 | "mcpServers": {
282 | "xiyan-mcp-server": {
283 | "command": "/xxx/python",
284 | "args": [
285 | "-m",
286 | "xiyan_mcp_server"
287 | ],
288 | "env": {
289 | "YML": "PATH/TO/YML"
290 | }
291 | }
292 | }
293 | }
294 | ```
295 | **Please note that the Python command here requires the complete path to the Python executable (`/xxx/python`); otherwise, the Python interpreter cannot be found. You can determine this path by using the command `which python`. The same applies to other applications as well.**
296 |
297 | Claude Desktop currently does not support the SSE transport protocol.
298 |
299 | #### Cline
300 | Prepare the config like [Claude Desktop](#claude-desktop)
301 |
302 | #### Goose
303 | If you use `stdio`, add following command in the config, ref Goose config example
304 | ```shell
305 | env YML=path/to/yml /xxx/python -m xiyan_mcp_server
306 | ```
307 | Otherwise, if you use `sse`, change Type to `SSE` and set the endpoint to `http://127.0.0.1:8000/sse`
308 | #### Cursor
309 | Use the similar command as follows.
310 |
311 | For `stdio`:
312 | ```json
313 | {
314 | "mcpServers": {
315 | "xiyan-mcp-server": {
316 | "command": "/xxx/python",
317 | "args": [
318 | "-m",
319 | "xiyan_mcp_server"
320 | ],
321 | "env": {
322 | "YML": "path/to/yml"
323 | }
324 | }
325 | }
326 | }
327 | ```
328 | For `sse`:
329 | ```json
330 | {
331 | "mcpServers": {
332 | "xiyan_mcp_server_1": {
333 | "url": "http://localhost:8000/sse"
334 | }
335 | }
336 | }
337 | ```
338 |
339 |
340 | #### Witsy
341 | Add following in command:
342 | ```shell
343 | /xxx/python -m xiyan_mcp_server
344 | ```
345 | Add an env: key is YML and value is the path to your yml file.
346 | Ref Witsy config example
347 |
348 |
349 | ## It Does Not Work!
350 | Contact us:
351 | Ding Group钉钉群|
352 | Follow me on Weibo
353 |
354 |
355 | ## Other Related Links
356 |
357 | [](https://mseep.ai/app/xgenerationlab-xiyan-mcp-server)
358 |
359 |
360 |
361 |
362 | ## Citation
363 | If you find our work helpful, feel free to give us a cite.
364 | ```bib
365 | @article{xiyansql,
366 | title={A Preview of XiYan-SQL: A Multi-Generator Ensemble Framework for Text-to-SQL},
367 | author={Yingqi Gao and Yifu Liu and Xiaoxia Li and Xiaorong Shi and Yin Zhu and Yiming Wang and Shiqi Li and Wei Li and Yuntao Hong and Zhiling Luo and Jinyang Gao and Liyu Mou and Yu Li},
368 | year={2024},
369 | journal={arXiv preprint arXiv:2411.08599},
370 | url={https://arxiv.org/abs/2411.08599},
371 | primaryClass={cs.AI}
372 | }
373 | ```
374 |
--------------------------------------------------------------------------------
/README_ja.md:
--------------------------------------------------------------------------------
1 | # XiYan MCP サーバー
2 |
3 |