Skip to content

Commit adfd936

Browse files
authored
Merge pull request #14 from yanbeipang/feat/env_database
Add listInstances tool and update README
2 parents ff4cefd + d7ef2c0 commit adfd936

File tree

7 files changed

+182
-65
lines changed

7 files changed

+182
-65
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,21 @@ Afterward, every time the service starts, the DMS MCP Server will directly acces
6565

6666
---
6767
## Tool List
68-
| Tool Name | Description | Applicable Mode |
69-
|---------------------|---------------------------------------------|-------------------------------|
70-
| addInstance | Adds an instance to DMS. If the instance already exists, it returns its information. | Multi-instance Mode |
71-
| getInstance | Retrieves detailed information about an instance based on host and port. | Multi-instance Mode |
72-
| searchDatabase | Searches databases based on schemaName. | Multi-instance Mode |
73-
| getDatabase | Retrieves detailed information about a specific database. | Multi-instance Mode |
74-
| listTable | Lists tables under a specified database. | Multi-instance Mode & Single Database Mode |
75-
| getTableDetailInfo | Retrieves detailed information about a specific table. | Multi-instance Mode & Single Database Mode |
76-
| executeScript | Executes an SQL script and returns the result. | Multi-instance Mode & Single Database Mode |
77-
| nl2sql | Converts natural language questions into SQL queries. | Multi-instance Mode |
78-
| askDatabase | Natural language querying of a database (NL2SQL + execute SQL). | Single Database Mode |
79-
| configureDtsJob | Configures a DTS migration task | Multi-instance Mode |
80-
| startDtsJob | Starts a DTS migration task | Multi-instance Mode |
81-
| getDtsJob | Views details of a DTS migration task | Multi-instance Mode |
68+
| Tool Name | Description | Applicable Mode |
69+
|--------------------|---------------------------------------------------------------------------------------------------------------------------|-------------------------------|
70+
| addInstance | Adds an instance to DMS. Only Aliyun instances are supported. | Multi-instance Mode |
71+
| listInstances | Search for instances from DMS. | Multi-instance Mode |
72+
| getInstance | Retrieves detailed information about an instance based on host and port. | Multi-instance Mode |
73+
| searchDatabase | Searches databases based on schemaName. | Multi-instance Mode |
74+
| getDatabase | Retrieves detailed information about a specific database. | Multi-instance Mode |
75+
| listTable | Lists tables under a specified database. | Multi-instance Mode & Single Database Mode |
76+
| getTableDetailInfo | Retrieves detailed information about a specific table. | Multi-instance Mode & Single Database Mode |
77+
| executeScript | Executes an SQL script and returns the result. | Multi-instance Mode & Single Database Mode |
78+
| nl2sql | Converts natural language questions into SQL queries. | Multi-instance Mode |
79+
| askDatabase | Natural language querying of a database (NL2SQL + execute SQL). | Single Database Mode |
80+
| configureDtsJob | Configures a DTS migration task | Multi-instance Mode |
81+
| startDtsJob | Starts a DTS migration task | Multi-instance Mode |
82+
| getDtsJob | Views details of a DTS migration task | Multi-instance Mode |
8283

8384
<p> For a full list of tools, please refer to: <a href="/doc/Tool-List-en.md">Tool List</a><br></p>
8485

doc/README-zh-cn.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,21 @@ CONNECTION_STRING = mydb@192.168.1.100:3306
6565
---
6666

6767
## 工具清单
68-
| 工具名称 | 描述 | 适用模式 |
69-
|------------------|-------------------------------------|----------------------|
70-
| addInstance | 将实例添加到 DMS。如果实例已存在,则返回已实例的信息。 | 多实例模式 |
71-
| getInstance | 根据 host 和 port 获取实例详细信息。 | 多实例模式 |
72-
| searchDatabase | 根据 schemaName 搜索数据库。 | 多实例模式 |
73-
| getDatabase | 获取特定数据库的详细信息。 | 多实例模式 |
74-
| listTable | 搜索指定数据库下的数据表。 | 多实例模式 & 单数据库模式 |
75-
| getTableDetailInfo | 获取特定数据库表的详细信息。 | 多实例模式 & 单数据库模式 |
76-
| executeScript | 执行 SQL 脚本并返回结果。 | 多实例模式 & 单数据库模式 |
77-
| nl2sql | 将自然语言问题转换为 SQL 查询。 | 多实例模式 |
78-
| askDatabase | 自然语言查询数据库(NL2SQL + 执行 SQL)。 | 单数据库模式 |
79-
| configureDtsJob | 配置DTS迁移任务 | 多实例模式 |
80-
| startDtsJob | 启动DTS迁移任务 | 多实例模式 |
81-
| getDtsJob | 查看DTS迁移任务详情 | 多实例模式 |
68+
| 工具名称 | 描述 | 适用模式 |
69+
|------------------|-------------------------------|----------------------|
70+
| addInstance | 将阿里云实例添加到 DMS。 | 多实例模式 |
71+
| listInstances | 搜索DMS中的实例列表。 | 多实例模式 |
72+
| getInstance | 根据 host 和 port 获取实例详细信息。 | 多实例模式 |
73+
| searchDatabase | 根据 schemaName 搜索数据库。 | 多实例模式 |
74+
| getDatabase | 获取特定数据库的详细信息。 | 多实例模式 |
75+
| listTable | 搜索指定数据库下的数据表。 | 多实例模式 & 单数据库模式 |
76+
| getTableDetailInfo | 获取特定数据库表的详细信息。 | 多实例模式 & 单数据库模式 |
77+
| executeScript | 执行 SQL 脚本并返回结果。 | 多实例模式 & 单数据库模式 |
78+
| nl2sql | 将自然语言问题转换为 SQL 查询。 | 多实例模式 |
79+
| askDatabase | 自然语言查询数据库(NL2SQL + 执行 SQL)。 | 单数据库模式 |
80+
| configureDtsJob | 配置DTS迁移任务 | 多实例模式 |
81+
| startDtsJob | 启动DTS迁移任务 | 多实例模式 |
82+
| getDtsJob | 查看DTS迁移任务详情 | 多实例模式 |
8283

8384
<p> 详细工具列表请查阅:<a href="/doc/Tool-List-cn.md">工具清单</a><br></p>
8485

doc/Tool-List-cn.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
### 元数据相关
3-
#### addInstance:将实例添加到 DMS。如果实例已存在,则返回已有实例信息
3+
#### addInstance:将阿里云实例添加到 DMS。
44

55
- **db_user** (字符串, 必需): 用于连接数据库的用户名。
66
- **db_password** (字符串, 必需): 用于连接数据库的密码。
@@ -9,6 +9,12 @@
99
- **port** (字符串, 可选): 实例的连接端口号。
1010
- **region** (字符串, 可选): 实例所在的区域(例如 "cn-hangzhou")。
1111

12+
#### listInstances:搜索DMS中的实例列表。
13+
14+
- **search_key** (字符串, 可选): 搜索关键词,例如实例地址、实例别名等。
15+
- **db_type** (字符串, 可选): 数据库类型,例如mysql、oracle、postgresql等。
16+
- **env_type** (字符串, 可选): 实例环境类型,例如product(生产)、dev(开发)、test(测试)等。
17+
1218
#### getInstance:根据 host 和 port 信息从 DMS 中获取实例详细信息。
1319

1420
- **host** (字符串, 必需): 实例的连接地址。
@@ -31,7 +37,7 @@
3137
#### listTable:根据 databaseId 和 tableName 在 DMS 中搜索数据表。
3238

3339
- **database_id** (字符串, 必需): 用于限定搜索范围的数据库 ID(可通过 getDatabase 工具获取)。
34-
- **search_name** (字符串, 必需): 作为搜索关键词的非空字符串,用于匹配表名。
40+
- **search_name** (字符串, 可选): 作为搜索关键词的字符串,用于匹配表名。
3541
- **page_number** (整数, 可选): 分页页码(默认:1)。
3642
- **page_size** (整数, 可选): 每页结果数量(默认:200,最大:200)。
3743

doc/Tool-List-en.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
- **port** (string, optional): Connection port number of the instance.
1111
- **region** (string, optional): Region where the instance is located (e.g., "cn-hangzhou").
1212

13+
#### listInstances:Search for instances from DMS.
14+
15+
- **search_key** (string, optional): Search key (e.g., instance host, instance alias, etc.)
16+
- **db_type** (string, optional): InstanceType, or called dbType (e.g., mysql, polardb, oracle, postgresql, sqlserver, polardb-pg, etc.)
17+
- **env_type** (string, optional): Instance EnvType (e.g., product, dev, test, etc.)
18+
1319
#### getInstance: Retrieve instance details from DMS based on host and port information.
1420

1521
- **host** (string, required): Connection address of the instance.
@@ -32,7 +38,7 @@
3238
#### listTable: Search for data tables in DMS based on databaseId and tableName.
3339

3440
- **database_id** (string, required): Database ID to limit the search scope (obtained via getDatabase).
35-
- **search_name** (string, required): Non-empty string as a search keyword to match table names.
41+
- **search_name** (string, optional): String as a search keyword to match table names.
3642
- **page_number** (integer, optional): Pagination page number (default: 1).
3743
- **page_size** (integer, optional): Number of results per page (default: 200, maximum: 200).
3844

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "alibabacloud-dms-mcp-server"
3-
version = "0.1.8"
3+
version = "0.1.9"
44
description = "MCP Server for AlibabaCloud DMS"
55
readme = "README.md"
66
authors = [

0 commit comments

Comments
 (0)