You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 🌐 Fetch data by natural language through [XiYanSQL](https://github.com/XGenerationLab/XiYan-SQL)
58
60
- 🤖 Support general LLMs (GPT,qwenmax), Text-to-SQL SOTA model
59
61
- 💻 Support pure local mode (high security!)
60
-
- 🖱️ List available MySQL tables as resources
62
+
- 📝 Support MySQL and PostgreSQL.
63
+
- 🖱️ List available tables as resources
61
64
- 🔧 Read table contents
62
65
63
66
## Tool Preview
64
67
- 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.
65
68
66
-
- 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.
67
-
- The ``mysql://`` resource will list the names of the current databases
69
+
- 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.
70
+
- The ``{dialect}://`` resource will list the names of the current databases
68
71
69
72
## Installation
70
73
### Installing from pip
@@ -224,10 +227,11 @@ model:
224
227
Til now the local mode is ready.
225
228
226
229
### Database Configuration
227
-
``host``, ``port``, ``user``, ``password``, ``database`` are the connection information of the MySQL database.
230
+
``host``, ``port``, ``user``, ``password``, ``database`` are the connection information of the database.
228
231
229
-
You can use local or any remote databases. Now we support MySQL (more dialects soon).
232
+
You can use local or any remote databases. Now we support MySQL and PostgreSQL(more dialects soon).
230
233
234
+
#### MySQL
231
235
232
236
```yaml
233
237
database:
@@ -237,7 +241,23 @@ database:
237
241
password: ""
238
242
database: ""
239
243
```
244
+
#### PostgreSQL
245
+
step1: Install python packages
246
+
```bash
247
+
pip install psycopg2
248
+
```
249
+
step2: prepare the config.yml like this:
250
+
```yaml
251
+
database:
252
+
dialect: "postgresql"
253
+
host: "localhost"
254
+
port: 5432
255
+
user: ""
256
+
password: ""
257
+
database: ""
258
+
```
240
259
260
+
Note that ``dialect`` should be ``postgresql`` for postgresql.
241
261
## Launch
242
262
### Claude desktop
243
263
Add this in your claude desktop config file, ref <a href="https://github.com/XGenerationLab/xiyan_mcp_server/blob/main/imgs/claude_desktop.jpg">claude desktop config example</a>
Copy file name to clipboardExpand all lines: pyproject.toml
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
[project]
2
2
name = "xiyan_mcp_server"
3
-
version = "0.1.3"
3
+
version = "0.1.4"
4
4
description = "A Model Context Protocol (MCP) server that utilizes XiyanSQL with databases. This server enables AI assistants to list tables, read data, and execute natural language queries"
0 commit comments