Skip to content

Commit 90af2fd

Browse files
author
tianzhen.wtz
committed
Merge branch feat/env_database into master
Title: to #65849001 Update README to #65849001 Update README Link: https://code.alibaba-inc.com/idb/alibabacloud-dms-mcp-server/codereview/21901269
2 parents c29b27b + d97e661 commit 90af2fd

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ DMS MCP Server currently supports two usage modes.
4141
#### Scenario Example:
4242
You are a company DBA who needs to manage and access various types of database instances (e.g., MySQL, Oracle, PostgreSQL) in production, test, and development environments. With DMS MCP Server, you can achieve unified access and centralized management of these heterogeneous databases.
4343

44+
**Typical Question Examples:**
45+
- Get a list of all databases named `test`.
46+
- Retrieve details of the `test_db` database from the `myHost:myPort` instance.
47+
- What tables are in the `test_db` database?
48+
- Use a tool to query data from the `test_db` database and answer: "What is today's user traffic?"
49+
4450
### Mode Two: Single Database Mode
4551
- Directly specify the target database by configuring the `CONNECTION_STRING` parameter in the server (format: `dbName@host:port`).
4652
- Suitable for scenarios that focus on accessing a single database.
@@ -51,6 +57,12 @@ CONNECTION_STRING = mydb@192.168.1.100:3306
5157
```
5258
Afterward, every time the service starts, the DMS MCP Server will directly access this specified database without needing to switch instances.
5359

60+
**Typical Question Examples:**
61+
- What tables do I have?
62+
- Show the field structure of the `test_table` table.
63+
- Retrieve the first 20 rows from the `test_table` table.
64+
- Use a tool to answer: "What is today's user traffic?"
65+
5466
---
5567
## Tool List
5668
| Tool Name | Description | Applicable Mode |

doc/README-zh-cn.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
---
1818

1919
## 核心特性
20-
为AI提供统一的**数据接入层****元数据访问层**,通过标准化接口解决:
20+
为大模型提供统一的**数据接入层****元数据访问层**,通过标准化接口解决:
2121
- 数据源碎片化导致的MCP Server维护成本
2222
- 异构协议间的兼容性问题
2323
- 账号权限不受控、操作无审计带来的安全问题
@@ -39,6 +39,13 @@ DMS MCP Server 现在支持两种使用模式。
3939
#### 场景示例:
4040
你是公司的DBA,需要在生产、测试和开发等多个环境中管理和访问 MySQL、Oracle 和 PostgreSQL 等多种数据库实例。通过DMS MCP Server,可以实现对这些异构数据库的统一接入与集中管理。
4141

42+
**典型提问示例:**
43+
- 获取所有名称为test的数据库列表
44+
- 获取 myHost:myPort 实例中 test_db 数据库的详细信息。
45+
- test_db 数据库下有哪些表?
46+
- 使用工具, 查询test_db 库的数据,回答“今天的用户访问量是多少?”
47+
48+
4249
### 模式二:单数据库模式
4350
- 通过在SERVER中配置 CONNECTION_STRING 参数(格式为 dbName@host:port),直接指定需要访问的数据库。
4451
- 适用于专注一个数据库访问的场景。
@@ -49,6 +56,12 @@ CONNECTION_STRING = mydb@192.168.1.100:3306
4956
```
5057
之后每次启动服务时,DMS MCP Server都会直接访问这个指定的数据库,无需切换实例。
5158

59+
**典型提问示例:**
60+
- 我有哪些表?
61+
- 查看test_table 表的字段结构
62+
- 获取test_table 表的前20条数据
63+
- 使用工具,回答“今天的用户访问量是多少?”
64+
5265
---
5366

5467
## 工具清单
@@ -103,8 +116,8 @@ CONNECTION_STRING = mydb@192.168.1.100:3306
103116
- 具有阿里云DMS访问权限的AK SK或者STS Token
104117

105118
---
106-
## 预配置
107-
在通过DMS访问数据库实例之前,需要将实例添加到DMS中
119+
## 准备工作
120+
在通过DMS MCP访问托管在DMS的数据库实例之前,需要将对应的数据库实例录入至DMS中,并为实例开启 [安全托管](https://help.aliyun.com/zh/dms/product-overview/security-hosting)
108121

109122
可以通过以下两种方式进行实例的添加:
110123

src/alibabacloud_dms_mcp_server/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ async def list_tables( # Renamed from listTable to follow convention
255255
raise
256256

257257
async def get_meta_table_detail_info(
258-
table_guid: str = Field(description="Unique table identifier (format: dmsTableId.schemaName.tableName)")
258+
table_guid: str = Field(description="Unique table identifier (format: dmsTableId.schemaName.tableName),Example: IDB_1567890.mySchema.myTable")
259259
) -> TableDetail:
260260
client = create_client()
261261
req = dms_enterprise_20181101_models.GetMetaTableDetailInfoRequest(table_guid=table_guid)
@@ -537,7 +537,7 @@ def _register_full_toolset(self):
537537
self.mcp.tool(name="searchDatabase", description="Search databases in DMS based on their name.",
538538
annotations={"title": "搜索DMS数据库", "readOnlyHint": True})(search_database)
539539
self.mcp.tool(name="getDatabase",
540-
description="Retrieve detailed information about a specific database from DMS.",
540+
description="Obtain detailed information about a specific database in DMS when the host and port are provided.",
541541
annotations={"title": "获取DMS数据库详情", "readOnlyHint": True})(get_database)
542542
self.mcp.tool(name="listTables",
543543
description="Search for database tables in DMS based on databaseId and tableName.",

0 commit comments

Comments
 (0)