Skip to content

Commit c7f7d77

Browse files
update readme
1 parent 275ac23 commit c7f7d77

File tree

2 files changed

+42
-18
lines changed

2 files changed

+42
-18
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![smithery badge](https://smithery.ai/badge/@XGenerationLab/xiyan_mcp_server)](https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server)
88

9-
[English](https://github.com/XGenerationLab/xiyan_mcp_server) | [中文](https://github.com/XGenerationLab/xiyan_mcp_server/README_zh.md)
9+
[English](https://github.com/XGenerationLab/xiyan_mcp_server) | [中文](https://github.com/XGenerationLab/xiyan_mcp_server/blob/main/README_zh.md)
1010

1111

1212
# XiYan MCP Server
@@ -16,14 +16,19 @@ A Model Context Protocol (MCP) server that enables natural language queries to d
1616

1717
We support MySQL database now and more dialects are coming soon.
1818

19-
## Features
19+
## 1. Features
2020
- Fetch data by natural language through [XiYanSQL](https://github.com/XGenerationLab/XiYan-SQL)
2121
- List available MySQL tables as resources
2222
- Read table contents
2323

24+
## 2. Tool Preview
25+
- The tool ``get_data_via_natural_language`` 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.
2426

27+
- The ``mysql://{table_name}`` resource allows obtaining a portion of sample data from the database for model reference when a specific table_name is specified.
28+
- The ``mysql://`` resource will list the names of the current databases
2529

26-
## Installation
30+
## 3. Installation
31+
### 3.1 Install from pip
2732

2833
Python 3.11+ is required.
2934
you can install the server through pip, and it will install the latest verion
@@ -43,7 +48,12 @@ env YML=path/to/yml python -m xiyan-mcp-server
4348
```
4449

4550

46-
## Configuration
51+
### 3.2 Install from Smithery.ai
52+
See [@XGenerationLab/xiyan_mcp_server](https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server)
53+
54+
Not fully tested.
55+
56+
## 4. Configuration
4757

4858
You need a yml config file to configure the server.
4959
a default config file is provided in config_demo.yml which looks like this:
@@ -62,7 +72,7 @@ database:
6272
database: ""
6373
```
6474
65-
### About LLM
75+
### 4.1 About LLM
6676
``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.
6777
#### Using general LLMs
6878
if you want to use the general LLMs, e.g. gpt3.5, you can directly config like this:
@@ -97,7 +107,7 @@ database:
97107
#### Local LLMs
98108
To support in the future.
99109
100-
### About the database
110+
### 4.2 About the database
101111
``host``, ``port``, ``user``, ``password``, ``database`` are the connection information of the MySQL database.
102112
103113
You can use local or any remote databases. Now we support MySQL (more dialects soon).
@@ -113,7 +123,7 @@ database:
113123
```
114124
115125
116-
## Citation
126+
## 5. Citation
117127
If you find our work helpful, feel free to give us a cite.
118128
```bib
119129
@article{xiyansql,

README_zh.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1+
以下是您提供的文本的中文翻译:
2+
3+
---
4+
15
[💻 XiYan-mcp-server](https://github.com/XGenerationLab/xiyan_mcp_server) |
26
[💻 XiYan-SQL](https://github.com/XGenerationLab/XiYan-SQL) |
37
[📖 Arxiv](https://arxiv.org/abs/2411.08599) |
48
[📄 PapersWithCode](https://paperswithcode.com/paper/xiyan-sql-a-multi-generator-ensemble)
59

610
[![smithery badge](https://smithery.ai/badge/@XGenerationLab/xiyan_mcp_server)](https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server)
711

8-
[English](https://github.com/XGenerationLab/xiyan_mcp_server) | [中文](https://github.com/XGenerationLab/xiyan_mcp_server/README_zh.md)
12+
[English](https://github.com/XGenerationLab/xiyan_mcp_server) | [中文](https://github.com/XGenerationLab/xiyan_mcp_server/blob/main/README_zh.md)
913

1014
# XiYan MCP 服务器
1115

1216
一个模型上下文协议(MCP)服务器,支持通过自然语言查询数据库,使用 [XiYanSQL](https://github.com/XGenerationLab/XiYan-SQL) 作为文本到 SQL 的技术。
1317

1418
我们目前支持 MySQL 数据库,更多方言即将推出。
1519

16-
## 特性
20+
## 1. 特性
1721
- 通过 [XiYanSQL](https://github.com/XGenerationLab/XiYan-SQL) 以自然语言获取数据
1822
- 列出可用的 MySQL 表作为资源
1923
- 读取表内容
2024

21-
## 安装
25+
## 2. 工具预览
26+
- 工具 ``get_data_via_natural_language`` 提供了一个自然语言接口,从数据库中检索数据。该服务器将输入的自然语言转换为 SQL,并调用数据库返回查询结果。
27+
28+
- ``mysql://{table_name}`` 资源允许在指定特定 `table_name` 的情况下,从数据库中获取部分样本数据,以供模型参考。
29+
- ``mysql://`` 资源将列出当前数据库的名称。
30+
31+
## 3. 安装
32+
### 3.1 从 pip 安装
2233

2334
需要 Python 3.11 或更高版本。
2435
您可以通过 pip 安装该服务器,它将安装最新版本。
@@ -31,12 +42,17 @@ pip install xiyan-mcp-server
3142
```bash
3243
python -m xiyan-mcp-server
3344
```
34-
但在完成以下配置之前,它将不提供任何功能。您将获得一个 yml 文件。之后,您可以通过以下方式运行服务器:
45+
但是在完成以下配置之前,它不会提供任何功能。您将获得一个 yml 文件。之后,您可以通过以下方式运行服务器:
3546
```yaml
3647
env YML=path/to/yml python -m xiyan-mcp-server
3748
```
3849

39-
## 配置
50+
### 3.2 从 Smithery.ai 安装
51+
查看 [@XGenerationLab/xiyan_mcp_server](https://smithery.ai/server/@XGenerationLab/xiyan_mcp_server)
52+
53+
未进行全面测试。
54+
55+
## 4. 配置
4056

4157
您需要一个 yml 配置文件来配置服务器。
4258
默认配置文件在 `config_demo.yml` 中提供,其内容如下:
@@ -55,7 +71,7 @@ database:
5571
database: ""
5672
```
5773
58-
### 关于 LLM
74+
### 4.1 关于 LLM
5975
``Name`` 是要使用的模型名称,``key`` 是模型的 API 密钥,``url`` 是模型的 API 地址。我们支持以下模型。
6076
#### 使用通用 LLM
6177
如果您想使用通用 LLM,例如 gpt3.5,您可以直接如下配置:
@@ -75,9 +91,8 @@ model:
7591
url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
7692
database:
7793
```
78-
7994
#### 使用文本到 SQL 的 SOTA 模型
80-
最后,我们推荐使用 XiYanSQL-qwencoder-32B (https://github.com/XGenerationLab/XiYanSQL-QwenCoder),这是text-to-SQL 的 SOTA 模型。
95+
最后,我们推荐使用 XiYanSQL-qwencoder-32B (https://github.com/XGenerationLab/XiYanSQL-QwenCoder),这是文本到 SQL 的 SOTA 模型。
8196
我们将模型部署在 DashScope 上,因此您需要设置以下环境变量:
8297
请联系我们以获取 ``key``
8398
```yaml
@@ -89,10 +104,9 @@ database:
89104
```
90105
91106
#### 本地 LLM
92-
93107
未来将支持。
94108
95-
### 关于数据库
109+
### 4.2 关于数据库
96110
``host``, ``port``, ``user``, ``password``, ``database`` 是 MySQL 数据库的连接信息。
97111
98112
您可以使用本地或任何远程数据库。现在我们支持 MySQL(即将支持更多方言)。
@@ -106,7 +120,7 @@ database:
106120
database: ""
107121
```
108122
109-
## 引用
123+
## 5. 引用
110124
如果您觉得我们的工作有帮助,请随意引用我们。
111125
```bib
112126
@article{xiyansql,

0 commit comments

Comments
 (0)