Skip to content

Commit faa09a6

Browse files
update readme
1 parent fe7e9ad commit faa09a6

File tree

2 files changed

+120
-46
lines changed

2 files changed

+120
-46
lines changed

README.md

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@
4646
- [Database Configuration](#database-configuration)
4747
- [Launch](#launch)
4848
- [Claude Desktop](#claude-desktop)
49+
- [Cline](#cline)
4950
- [Goose](#goose)
51+
- [Cursor](#cursor)
52+
- [It Does Not Work](#it-does-not-work)
5053
- [Citation](#citation)
5154

5255

@@ -93,9 +96,9 @@ a default config file is provided in config_demo.yml which looks like this:
9396

9497
```yaml
9598
model:
96-
name: "pre-xiyansql-qwencoder-32b"
99+
name: "XGenerationLab/XiYanSQL-QwenCoder-32B-2412"
97100
key: ""
98-
url: "https://pre-xiyan-stream.biz.aliyun.com/service/api/xiyan-sql"
101+
url: "https://api-inference.modelscope.cn/v1/"
99102

100103
database:
101104
host: "localhost"
@@ -107,6 +110,14 @@ database:
107110
108111
### LLM Configuration
109112
``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.
113+
114+
| versions | general LLMs(GPT,qwenmax) | SOTA model by Modelscope | SOTA model by Dashscope |
115+
|----------|-------------------------------|--------------------------------------------|-----------------------------------------------------------|
116+
| description| basic, easy to use | best performance, stable, recommand | best performance, for trial |
117+
| name | the official model name (e.g. gpt-3.5-turbo,qwen-max) | XGenerationLab/XiYanSQL-QwenCoder-32B-2412 | xiyansql-qwencoder-32b |
118+
| key | the API key of the service provider (e.g. OpenAI, Alibaba Cloud) | the API key of modelscope | the API key via email |
119+
| 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 |
120+
110121
#### general LLMs
111122
if you want to use the general LLMs, e.g. gpt3.5, you can directly config like this:
112123
```yaml
@@ -126,7 +137,25 @@ model:
126137
database:
127138
```
128139
#### Text-to-SQL SOTA model
129-
Last, 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/).
140+
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/).
141+
There are two ways to use the model. You can use either of them.
142+
(1) [Modelscope](https://www.modelscope.cn/models/XGenerationLab/XiYanSQL-QwenCoder-32B-2412), (2) Alibaba Cloud DashScope.
143+
144+
145+
##### (1) Modelscope version
146+
You need to apply a ``key`` of API-inference from Modelscope, https://www.modelscope.cn/docs/model-service/API-Inference/intro
147+
Then you can use the following config:
148+
```yaml
149+
model:
150+
name: "XGenerationLab/XiYanSQL-QwenCoder-32B-2412"
151+
key: ""
152+
url: "https://api-inference.modelscope.cn/v1/"
153+
```
154+
155+
Read our [model description](https://www.modelscope.cn/models/XGenerationLab/XiYanSQL-QwenCoder-32B-2412) for more details.
156+
157+
##### (2) Dashscope version
158+
130159
We deployed the model on Alibaba Cloud DashScope, so you need to set the following environment variables:
131160
Send me your email to get the ``key``. ( godot.lzl@alibaba-inc.com )
132161
In the email, please attach the following information:
@@ -141,9 +170,9 @@ The ``key`` will be expired by 1 month or 200 queries or other legal restrictio
141170
142171
```yaml
143172
model:
144-
name: "pre-xiyansql-qwencoder-32b"
173+
name: "xiyansql-qwencoder-32b"
145174
key: "KEY"
146-
url: "https://pre-xiyan-stream.biz.aliyun.com/service/api/xiyan-sql"
175+
url: "https://xiyan-stream.biz.aliyun.com/service/api/xiyan-sql"
147176
database:
148177
```
149178
@@ -188,13 +217,24 @@ Add this in your claude desktop config file
188217
}
189218
}
190219
```
220+
### Cline
221+
prepare the config like [Claude desktop](#claude-desktop)
222+
191223
### Goose
192224
Add following command in the config.
193225

194226
```yaml
195227
env YML=path/to/yml python -m xiyan_mcp_server
196228
```
197229

230+
### Cursor
231+
use the same command like [Goose](#goose)
232+
233+
## It does not work!
234+
contact us:
235+
<a href="https://github.com/XGenerationLab/xiyan_mcp_server/blob/main/imgs/dinggroup_out.png">Ding Group钉钉群</a>|
236+
<a href="https://weibo.com/u/2540915670" target="_blank">Follow me on Weibo</a>
237+
198238

199239
## Citation
200240
If you find our work helpful, feel free to give us a cite.

README_zh.md

Lines changed: 75 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<h1 align="center">XiYan MCP Server</h1>
1+
<h1 align="center">XiYan MCP 服务器</h1>
22
<p align="center">
33
<a href="https://github.com/XGenerationLab/XiYan-SQL"><img alt="MCP Playwright" src="https://raw.githubusercontent.com/XGenerationLab/XiYan-SQL/main/xiyanGBI.png" height="60"/></a>
44
</p>
55
<p align="center">
6-
<b>一个模型上下文协议 (MCP) 服务器,支持自然语言查询数据库</b></br>
7-
<sub> <a href="https://github.com/XGenerationLab/XiYan-SQL">XiYan-SQL</a> 提供支持,Test-to-SQL公开基准上的SOTA</sub>
6+
<b>一个允许自然语言查询数据库的模型上下文协议 (MCP) 服务器</b></br>
7+
<sub>基于 <a href="https://github.com/XGenerationLab/XiYan-SQL">XiYan-SQL</a>,在开放基准上达到文本到 SQL 的最新技术水平</sub>
88
</p>
99

1010
<p align="center">
1111
💻 <a href="https://github.com/XGenerationLab/xiyan_mcp_server">XiYan-mcp-server</a> |
12-
🌐 <a href="https://github.com/XGenerationLab/XiYan-SQL">XiYan-SQL</a> |
12+
🌐 <a href="https://github.com/XGenerationLab/https://github.com/XGenerationLab/XiYan-SQL">XiYan-SQL</a> |
1313
📖 <a href="https://arxiv.org/abs/2411.08599"> Arxiv</a> |
1414
📄 <a href="https://paperswithcode.com/paper/xiyan-sql-a-multi-generator-ensemble">PapersWithCode</a> |
1515
💻 <a href="https://huggingface.co/collections/XGenerationLab/xiyansql-models-67c9844307b49f87436808fc">HuggingFace</a> |
@@ -20,14 +20,14 @@
2020
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License: Apache 2.0" />
2121
</a>
2222
<a href="https://pepy.tech/projects/xiyan-mcp-server"><img src="https://static.pepy.tech/badge/xiyan-mcp-server" alt="PyPI 下载量"></a>
23-
<a href="https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server"><img alt="Smithery 安装量" src="https://smithery.ai/badge/@XGenerationLab/xiyan_mcp_server" height="20"/></a>
23+
<a href="https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server"><img alt="Smithery 安装次数" src="https://smithery.ai/badge/@XGenerationLab/xiyan_mcp_server" height="20"/></a>
2424
<a href="https://github.com/XGenerationLab/xiyan_mcp_server" target="_blank">
2525
<img src="https://img.shields.io/github/stars/XGenerationLab/xiyan_mcp_server?style=social" alt="GitHub stars" />
2626
</a>
2727
<br />
28-
<a href="https://github.com/XGenerationLab/xiyan_mcp_server">English</a> | <a href="https://github.com/XGenerationLab/xiyan_mcp_server/blob/main/README_zh.md"> 中文 </a><br />
28+
<a href="https://github.com/XGenerationLab/xiyan_mcp_server">English</a> | <a href="https://github.com/XGenerationLab/xiyan_mcp_server/blob/main/README_zh.md">中文</a><br />
2929
<a href="https://github.com/XGenerationLab/xiyan_mcp_server/blob/main/imgs/dinggroup_out.png">钉钉群</a>|
30-
<a href="https://weibo.com/u/2540915670" target="_blank">在微博上关注我</a>
30+
<a href="https://weibo.com/u/2540915670" target="_blank">在微博关注我</a>
3131
</p>
3232

3333
## 目录
@@ -45,55 +45,57 @@
4545
- [数据库配置](#database-configuration)
4646
- [启动](#launch)
4747
- [Claude 桌面](#claude-desktop)
48+
- [Cline](#cline)
4849
- [Goose](#goose)
50+
- [Cursor](#cursor)
4951
- [引用](#citation)
5052

5153
## 功能
52-
- 🌐 通过 [XiYanSQL](https://github.com/XGenerationLab/XiYan-SQL) 以自然语言提取数据
54+
- 🌐 通过 [XiYanSQL](https://github.com/XGenerationLab/XiYan-SQL) 以自然语言获取数据
5355
- 🖱️ 列出可用的 MySQL 表作为资源
5456
- 🔧 读取表内容
5557

5658
## 工具预览
57-
- 工具 ``get_data_via_natural_language`` 提供从数据库检索数据的自然语言接口。该服务器将输入的自然语言转换为 SQL,并调用数据库返回查询结果
59+
- 工具 ``get_data_via_natural_language`` 提供了一个自然语言接口,用于从数据库中检索数据。该服务器将输入的自然语言转换为 SQL,使用内置模型并调用数据库返回查询结果
5860

59-
- ``mysql://{table_name}`` 资源允许在指定特定的表名时,从数据库获取一部分样本数据以供模型参考
60-
- ``mysql://`` 资源将列出当前数据库的名称
61+
- ``mysql://{table_name}`` 资源允许在指定特定表名时,从数据库获取部分示例数据以供模型参考
62+
- ``mysql://`` 资源将列出当前数据库的名称
6163

6264
## 安装
6365
### 通过 pip 安装
6466

65-
需要 Python 3.11 及以上版本
67+
需要 Python 3.11 或更高版本
6668
您可以通过 pip 安装服务器,它将安装最新版本。
6769

6870
```bash
6971
pip install xiyan-mcp-server
7072
```
7173

72-
之后您可以直接运行服务器
74+
然后您可以直接运行服务器
7375
```bash
7476
python -m xiyan_mcp_server
7577
```
76-
但是在您完成后续配置之前,它不会提供任何功能
77-
您将获得一个 yml 文件。之后您可以通过以下命令运行服务器
78+
但在完成以下配置之前,它不提供任何功能
79+
您将获得一个 yml 文件。之后,您可以通过以下方式运行服务器
7880
```yaml
7981
env YML=path/to/yml python -m xiyan_mcp_server
8082
```
8183

8284
### 通过 Smithery.ai 安装
8385
请参见 [@XGenerationLab/xiyan_mcp_server](https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server)
8486

85-
尚未全面测试
87+
未完全测试
8688

8789
## 配置
8890

8991
您需要一个 yml 配置文件来配置服务器。
90-
config_demo.yml 中提供了一个默认配置文件,内容如下
92+
提供了一个默认配置文件 config_demo.yml,格式如下
9193

9294
```yaml
9395
model:
94-
name: "pre-xiyansql-qwencoder-32b"
96+
name: "XGenerationLab/XiYanSQL-QwenCoder-32B-2412"
9597
key: ""
96-
url: "https://pre-xiyan-stream.biz.aliyun.com/service/api/xiyan-sql"
98+
url: "https://api-inference.modelscope.cn/v1/"
9799

98100
database:
99101
host: "localhost"
@@ -104,57 +106,83 @@ database:
104106
```
105107
106108
### LLM 配置
107-
``Name`` 是要使用的模型的名称,``key`` 是模型的 API 密钥,``url`` 是模型的 API 地址。我们支持以下模型。
109+
``Name`` 是要使用的模型名称, ``key`` 是该模型的 API 密钥, ``url`` 是该模型的 API 地址。我们支持以下模型。
110+
111+
| 版本 | 通用 LLM(GPT,qwenmax) | Modelscope 的 SOTA 模型 | Dashscope 的 SOTA 模型 |
112+
|----------|-------------------------------|--------------------------------------------|-----------------------------------------------------------|
113+
| 描述 | 基本,易于使用 | 性能最佳,稳定,推荐 | 性能最佳,供试用 |
114+
| 名称 | 官方模型名称(例如 gpt-3.5-turbo,qwen-max) | XGenerationLab/XiYanSQL-QwenCoder-32B-2412 | xiyansql-qwencoder-32b |
115+
| 密钥 | 服务提供商的 API 密钥(例如 OpenAI,阿里云) | Modelscope 的 API 密钥 | 通过邮件获得的 API 密钥 |
116+
| url | 服务提供商的端点(例如 "https://api.openai.com/v1") | https://api-inference.modelscope.cn/v1/ | https://xiyan-stream.biz.aliyun.com/service/api/xiyan-sql |
117+
108118
#### 通用 LLM
109-
如果您想使用通用 LLM,比如 gpt3.5,您可以直接配置如下:
119+
如果您想使用通用 LLM,例如 gpt3.5,您可以直接配置如下:
110120
```yaml
111121
model:
112122
name: "gpt-3.5-turbo"
113-
key: "您的密钥"
123+
key: "YOUR KEY"
114124
url: "https://api.openai.com/v1"
115125
database:
116126
```
117127
118-
如果您想使用阿里巴巴的 Qwen,例如 Qwen-max,您可以使用以下配置。
128+
如果您想使用来自阿里巴巴的 Qwen,例如 Qwen-max,您可以使用以下配置。
119129
```yaml
120130
model:
121131
name: "qwen-max"
122-
key: "您的密钥"
132+
key: "YOUR KEY"
123133
url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
124134
database:
125135
```
136+
126137
#### 文本到 SQL SOTA 模型
127-
最后,我们推荐使用 XiYanSQL-qwencoder-32B (https://github.com/XGenerationLab/XiYanSQL-QwenCoder),这是文本到 SQL 的 SOTA 模型,见 [Bird benchmark](https://bird-bench.github.io/)。
138+
我们推荐 XiYanSQL-qwencoder-32B (https://github.com/XGenerationLab/XiYanSQL-QwenCoder),这是文本到 SQL 的 SOTA 模型,参见 [Bird benchmark](https://bird-bench.github.io/)。
139+
使用该模型有两种方式。您可以使用任一个。
140+
(1) [Modelscope](https://www.modelscope.cn/models/XGenerationLab/XiYanSQL-QwenCoder-32B-2412),(2) 阿里云 DashScope。
141+
142+
##### (1) Modelscope 版本
143+
您需要从 Modelscope 申请 ``key`` 用于 API推断,网址:https://www.modelscope.cn/docs/model-service/API-Inference/intro。
144+
然后可以使用以下配置:
145+
```yaml
146+
model:
147+
name: "XGenerationLab/XiYanSQL-QwenCoder-32B-2412"
148+
key: ""
149+
url: "https://api-inference.modelscope.cn/v1/"
150+
```
151+
152+
阅读我们的 [模型描述](https://www.modelscope.cn/models/XGenerationLab/XiYanSQL-QwenCoder-32B-2412) 获取更多细节。
153+
154+
##### (2) Dashscope 版本
155+
128156
我们在阿里云 DashScope 上部署了该模型,因此您需要设置以下环境变量:
129-
请发送您的电子邮件以获取 ``key``。 ( godot.lzl@alibaba-inc.com )
130-
在电子邮件中,请附上以下信息:
157+
请发送您的电子邮件以获取 ``key``。 (godot.lzl@alibaba-inc.com)
158+
在邮件中,请附上以下信息:
131159
```yaml
132-
name: "您的姓名",
133-
email: "您的电子邮件",
134-
organization: "您所在的学校或公司或组织"
160+
name: "YOUR NAME",
161+
email: "YOUR EMAIL",
162+
organization: "您的学院或公司或组织"
135163
```
136-
我们将根据您的电子邮件发送给您一个 ``key``您可以将该 ``key`` 填写在 yml 文件中。
137-
``key`` 将在一个月或 200 查询或其他法律限制下过期
164+
我们将根据您的电子邮件发送给您一个 ``key``您可以将 ``key`` 填入 yml 文件中。
165+
``key`` 将在 1 个月或 200 次查询或其他法律限制后过期
138166
139167
```yaml
140168
model:
141-
name: "pre-xiyansql-qwencoder-32b"
142-
key: "密钥"
143-
url: "https://pre-xiyan-stream.biz.aliyun.com/service/api/xiyan-sql"
169+
name: "xiyansql-qwencoder-32b"
170+
key: "KEY"
171+
url: "https://xiyan-stream.biz.aliyun.com/service/api/xiyan-sql"
144172
database:
145173
```
146174
147175
注意:该模型服务仅供试用,如果您需要在生产环境中使用,请与我们联系。
148176
149-
或者,您也可以在自己的服务器上部署模型 [XiYanSQL-qwencoder-32B](https://github.com/XGenerationLab/XiYanSQL-QwenCoder)。
177+
另外,您也可以在自己的服务器上部署 [XiYanSQL-qwencoder-32B](https://github.com/XGenerationLab/XiYanSQL-QwenCoder)。
150178
151179
#### 本地 LLM
152-
未来将支持
180+
将来支持
153181
154182
### 数据库配置
155-
``host``, ``port``, ``user``, ``password``, ``database`` 是 MySQL 数据库的连接信息。
183+
``host````port````user````password````database`` 是 MySQL 数据库的连接信息。
156184
157-
您可以使用本地或任何远程数据库。现在我们支持 MySQL(更多方言将在不久的将来支持)。
185+
您可以使用本地或任何远程数据库。现在我们支持 MySQL(更多方言即将推出)。
158186
159187
```yaml
160188
database:
@@ -184,15 +212,21 @@ database:
184212
}
185213
}
186214
```
215+
### Cline
216+
准备与 [Claude 桌面](#claude-desktop) 类似的配置。
217+
187218
### Goose
188-
在配置中添加以下命令
219+
在配置中添加以下命令
189220

190221
```yaml
191222
env YML=path/to/yml python -m xiyan_mcp_server
192223
```
193224

225+
### Cursor
226+
使用与 [Goose](#goose) 相同的命令。
227+
194228
## 引用
195-
如果您觉得我们的工作对您有帮助,请随时引用我们。
229+
如果您发现我们的工作对您有帮助,请随时引用我们。
196230
```bib
197231
@article{xiyansql,
198232
title={A Preview of XiYan-SQL: A Multi-Generator Ensemble Framework for Text-to-SQL},

0 commit comments

Comments
 (0)