Skip to content

Commit 666a5e2

Browse files
authored
Merge pull request #15 from yanbeipang/feat/env_database
Update README
2 parents adfd936 + 03bb017 commit 666a5e2

File tree

3 files changed

+98
-44
lines changed

3 files changed

+98
-44
lines changed

README.md

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,38 @@
55

66
# AlibabaCloud DMS MCP Server
77

8-
**AI-powered unified data management gateway** that supports connection to over 40+ data sources, serving as a multi-cloud universal data MCP Server to address cross-source data secure access in one-stop solution.
8+
**AI-Era Data Security Access Gateway |Intelligent Data Query Engine|Supports 40+ Data Sources**
99

10-
- Supports full Alibaba Cloud series: RDS, PolarDB, ADB series, Lindorm series, TableStore series, MaxCompute series.
11-
- Supports mainstream databases/warehouses: MySQL, MariaDB, PostgreSQL, Oracle, SQLServer, Redis, MongoDB, StarRocks, Clickhouse, SelectDB, DB2, OceanBase, Gauss, BigQuery, etc.
10+
---
1211

13-
<img src="images/architecture-0508.jpg" alt="Architecture" width="60%">
12+
## Core Features
13+
**Secure Access**
14+
- **Account and Password Security Management**:Safely manage database account passwords without manual maintenance, effectively preventing sensitive information leakage.
15+
- **Fine-grained Permission Control**:Supports instance, database, table, field, and row-level access control, precisely restricting caller permissions to prevent unauthorized operations and ensure data security.
16+
- **High-risk SQL Identification and Blocking**: Built-in rich rule engine that identifies and blocks potential high-risk SQL in real time to mitigate security risks.
17+
- **SQL Audit Trail**: Records all SQL operation logs, supporting full traceability and compliance audits to meet regulatory requirements.
1418

15-
[//]: # (<img src="https://dms-static.oss-cn-hangzhou.aliyuncs.com/mcp-readme/architecture-0508.jpg" alt="Architecture" width="60%">)
19+
**Intelligent Data Inquiry**
20+
- **Built-in NL2SQL Algorithm**: Based on natural language input questions, it intelligently matches data tables, understands business semantics within tables, generates and executes SQL queries, and quickly obtains results.
21+
- **Personalized Knowledge Base**: Built-in metadata and [knowledge base](https://help.aliyun.com/zh/dms/knowledge-base-management?) for data inquiry, supports custom business knowledge and query patterns to build tailored intelligent data inquiry capabilities aligned with business scenarios.
1622

23+
**Multi-data Source Support**
24+
- **Wide Range of Data Source Support**: Supports over 40 mainstream databases/data warehouses, enabling unified access and integration from multiple sources.
25+
- **Unified Management Across Environments**: Supports centralized management of database instances across development, testing, and production environments to improve operational efficiency.
26+
- **Seamless Integration Across Platforms**: Covers major cloud platforms such as Alibaba Cloud and AWS, as well as self-built databases/data warehouses, effectively reducing maintenance costs.
1727

1828
---
1929

20-
## Core Features
21-
Provides AI with a unified **data access layer** and **metadata access layer**, solving through standardized interfaces:
22-
- Maintenance costs caused by data source fragmentation
23-
- Compatibility issues between heterogeneous protocols
24-
- Security risks from uncontrolled account permissions and non-auditable operations
25-
26-
Key features via MCP include:
27-
- **NL2SQL**: Execute SQL via natural language to obtain data results
28-
- **Code Generation**: Retrieve schema information through this service to generate DAO code or perform structural analysis
29-
- **Data Retrieval**: Automatically route SQL to accurate data sources for business support
30-
- **Security**: Fine-grained access control and auditability
31-
- **Data Migration**: Configure data migration tasks
30+
## Supported Ecosystem
31+
- Supports all Alibaba Cloud data sources: RDS, PolarDB, ADB series, Lindorm series, TableStore series, Maxcompute series.
32+
- Supports mainstream databases/data warehouses: MySQL, MariaDB, PostgreSQL, Oracle, SQLServer, Redis, MongoDB, StarRocks, Clickhouse, SelectDB, DB2, OceanBase, Gauss, BigQuery, etc.
33+
---
34+
35+
## Core Architecture
36+
<img src="images/architecture-0508.jpg" alt="Architecture" width="60%">
37+
38+
[//]: # (<img src="https://dms-static.oss-cn-hangzhou.aliyuncs.com/mcp-readme/architecture-0508.jpg" alt="Architecture" width="60%">)
39+
3240

3341
---
3442

@@ -42,6 +50,7 @@ DMS MCP Server currently supports two usage modes.
4250
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.
4351

4452
**Typical Question Examples:**
53+
- Which of my instances are in the production environment?
4554
- Get a list of all databases named `test`.
4655
- Retrieve details of the `test_db` database from the `myHost:myPort` instance.
4756
- What tables are in the `test_db` database?
@@ -50,7 +59,7 @@ You are a company DBA who needs to manage and access various types of database i
5059
### Mode Two: Single Database Mode
5160
- Directly specify the target database by configuring the `CONNECTION_STRING` parameter in the server (format: `dbName@host:port`).
5261
- Suitable for scenarios that focus on accessing a single database.
53-
#### Scenario Example:
62+
#### Scenario Example 1:
5463
You are a developer who frequently accesses a fixed database (e.g., `mydb@192.168.1.100:3306`) for development and testing. Set the `CONNECTION_STRING` parameter in the DMS MCP Server configuration as follows:
5564
```ini
5665
CONNECTION_STRING = mydb@192.168.1.100:3306
@@ -63,6 +72,21 @@ Afterward, every time the service starts, the DMS MCP Server will directly acces
6372
- Retrieve the first 20 rows from the `test_table` table.
6473
- Use a tool to answer: "What is today's user traffic?"
6574

75+
#### Scenario Example 2:
76+
You are a data analyst at an e-commerce company, needing to frequently query and analyze business data such as orders, users, and products. The company's core business database is located at ecommerce@10.20.30.40:3306.
77+
78+
Configure the following parameters in DMS MCP Server:
79+
```ini
80+
CONNECTION_STRING = ecommerce@10.20.30.40:3306
81+
```
82+
Simply ask questions in natural language, and DMS MCP will parse the question into SQL and return the results.
83+
84+
**Typical Question Examples:**
85+
- What is the total number of orders today?
86+
- How are the order counts ranked by province?
87+
- What is the number of new users each day over the past 7 days?
88+
- Which product category has the highest sales revenue?
89+
6690
---
6791
## Tool List
6892
| Tool Name | Description | Applicable Mode |
@@ -114,9 +138,9 @@ Afterward, every time the service starts, the DMS MCP Server will directly acces
114138

115139
---
116140
## Prerequisites
117-
- uv is installed
141+
- [uv](https://docs.astral.sh/uv/getting-started/installation/) is installed
118142
- Python 3.10+ is installed
119-
- An AK/SK or STS Token with access rights to Alibaba Cloud DMS(AliyunDMSFullAccess)
143+
- An [AK/SK](https://www.alibabacloud.com/help/en/doc-detail/116811.html) or [STS Token](https://www.alibabacloud.com/help/en/ram/product-overview/what-is-sts) with access rights to Alibaba Cloud DMS(AliyunDMSFullAccess).Add permission operations, see [Authorization Management](https://www.alibabacloud.com/help/en/ram/user-guide/authorization-management/).
120144

121145
---
122146
## Pre-configuration

doc/README-zh-cn.md

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,54 @@
44

55
# AlibabaCloud DMS MCP Server
66

7-
**AI 首选的统一数据管理网关,支持40多种数据源**连接的多云通用数据MCP Server,一站式解决**跨源数据安全访问**
7+
**AI时代的数据安全访问网关 |智能问数引擎 | 支持40+数据源**
88

9-
- 支持阿里云全系:RDS、PolarDB、ADB系列、Lindorm系列、TableStore系列、Maxcompute系列。
10-
- 支持主流数据库/数仓:MySQL、MariaDB、PostgreSQL、Oracle、SQLServer、Redis、MongoDB、StarRocks、Clickhouse、SelectDB、DB2、OceanBase、Gauss、BigQuery等。
9+
---
1110

12-
<img src="../images/architecture-0508.jpg" alt="Architecture" width="60%">
11+
## 核心特性
12+
**安全访问**
13+
- **账号密码安全托管**:安全管理数据库账号密码,无需人工维护,有效防止敏感信息泄露。
14+
- **细粒度权限管控**:支持实例、库、表、字段及行级别的精细化访问控制,精准限制调用方权限,杜绝越权操作,保障数据安全。
15+
- **高危SQL识别与拦截**:内置丰富的规则引擎,实时识别并拦截潜在高危SQL,防范安全风险。
16+
- **SQL审计追踪**:记录所有SQL操作日志,支持完整追溯与合规审计,满足监管要求。
1317

14-
[//]: # (<img src="https://dms-static.oss-cn-hangzhou.aliyuncs.com/mcp-readme/architecture-0508.jpg" alt="Architecture" width="60%">)
18+
**智能问数**
19+
- **内置NL2SQL算法**:基于输入的自然语言问题,智能匹配数据表,理解表中业务含义,生成并执行SQL查询,快速获取结果。
20+
- **个性化知识库**:内置元数据和问数[知识库](https://help.aliyun.com/zh/dms/knowledge-base-management?),支持自定义业务知识和查询模式,打造贴合业务场景的专属智能问数能力。
21+
22+
**多数据源支持**
23+
- **广泛数据源支持**:支持40多种主流数据库/数仓类型,实现多源数据统一接入和访问。
24+
- **多环境统一管理**:支持开发、测试、生产等不同环境下的数据库实例集中管理,提升运维效率。
25+
- **多平台无缝集成**:覆盖阿里云、AWS等主流云平台以及自建数据库/数仓,有效降低维护成本。
1526

1627

1728
---
1829

19-
## 核心特性
20-
为大模型提供统一的**数据接入层****元数据访问层**,通过标准化接口解决:
21-
- 数据源碎片化导致的MCP Server维护成本
22-
- 异构协议间的兼容性问题
23-
- 账号权限不受控、操作无审计带来的安全问题
24-
25-
同时,通过MCP将获得以下特性:
26-
- **NL2SQL**:通过自然语言执行SQL,获得数据结果
27-
- **代码生成**:通过该服务获取schema信息,生成DAO代码或进行结构分析
28-
- **取数**:通过SQL自动路由准确数据源获得数据,为上层业务提供数据支持
29-
- **安全**:精细的访问控制和可审计性
30-
- **数据迁移**:配置数据迁移任务
30+
## 支持生态
31+
32+
- 支持阿里云全系数据源:RDS、PolarDB、ADB系列、Lindorm系列、TableStore系列、Maxcompute系列。
33+
- 支持主流数据库/数仓:MySQL、MariaDB、PostgreSQL、Oracle、SQLServer、Redis、MongoDB、StarRocks、Clickhouse、SelectDB、DB2、OceanBase、Gauss、BigQuery等。
34+
35+
---
36+
37+
## 核心架构
38+
<img src="../images/architecture-0508.jpg" alt="Architecture" width="60%">
39+
40+
[//]: # (<img src="https://dms-static.oss-cn-hangzhou.aliyuncs.com/mcp-readme/architecture-0508.jpg" alt="Architecture" width="60%">)
41+
3142

3243
---
3344
## 使用方式
34-
DMS MCP Server 现在支持两种使用模式
45+
DMS MCP Server 支持两种使用模式
3546

3647
### 模式一:多实例模式
3748
- 支持添加实例到DMS,可以访问多个数据库实例。
3849
- 适用于需要管理和访问多个数据库实例的场景。
3950
#### 场景示例:
40-
你是公司的DBA,需要在生产、测试和开发等多个环境中管理和访问 MySQL、Oracle 和 PostgreSQL 等多种数据库实例。通过DMS MCP Server,可以实现对这些异构数据库的统一接入与集中管理
51+
你是公司的DBA,需要在生产、测试和开发等多个环境中管理和访问 MySQL、Oracle 和 PostgreSQL 等多种数据库实例。通过DMS MCP Server,可以实现对这些异构数据源的统一接入与集中管理
4152

4253
**典型提问示例:**
54+
- 我有哪些生产环境的实例?
4355
- 获取所有名称为test的数据库列表
4456
- 获取 myHost:myPort 实例中 test_db 数据库的详细信息。
4557
- test_db 数据库下有哪些表?
@@ -49,7 +61,7 @@ DMS MCP Server 现在支持两种使用模式。
4961
### 模式二:单数据库模式
5062
- 通过在SERVER中配置 CONNECTION_STRING 参数(格式为 dbName@host:port),直接指定需要访问的数据库。
5163
- 适用于专注一个数据库访问的场景。
52-
#### 场景示例
64+
#### 场景示例1
5365
你是一个开发人员,只需要频繁访问一个固定的数据库(如 mydb@192.168.1.100:3306)进行开发测试。在 DMS MCP Server 的配置中设置一个 CONNECTION_STRING 参数,例如:
5466
```ini
5567
CONNECTION_STRING = mydb@192.168.1.100:3306
@@ -62,6 +74,24 @@ CONNECTION_STRING = mydb@192.168.1.100:3306
6274
- 获取test_table 表的前20条数据
6375
- 使用工具,回答“今天的用户访问量是多少?”
6476

77+
78+
#### 场景示例2:
79+
你是一家电商公司的数据分析师,需要频繁查询和分析订单、用户、商品等业务数据。公司的核心业务数据库位于 ecommerce@10.20.30.40:3306。
80+
81+
在DMS MCP Server中设置如下参数:
82+
```ini
83+
CONNECTION_STRING = ecommerce@10.20.30.40:3306
84+
```
85+
86+
只需用自然语言提问,DMS MCP 即可将问题解析为 SQL 并返回结果。
87+
88+
89+
**典型提问示例:**
90+
- 今天的订单总数是多少?
91+
- 各个省份的订单数量排名如何?
92+
- 过去7天内,每天的新增用户数是多少?
93+
- 哪个商品类别的销售额最高?
94+
6595
---
6696

6797
## 工具清单
@@ -112,13 +142,13 @@ CONNECTION_STRING = mydb@192.168.1.100:3306
112142

113143
---
114144
## 前提条件
115-
- 已安装uv
145+
- 已安装[uv](https://docs.astral.sh/uv/getting-started/installation/)
116146
- 已安装Python 3.10+
117-
- 具有阿里云DMS访问权限(AliyunDMSFullAccess)的AK SK或者STS Token
147+
- 具有阿里云DMS访问权限(AliyunDMSFullAccess)[AK SK](https://help.aliyun.com/zh/ram/user-guide/view-the-accesskey-pairs-of-a-ram-user)或者[STS Token](https://help.aliyun.com/zh/ram/product-overview/what-is-sts),添加权限操作,请参见[授权管理](https://help.aliyun.com/zh/ram/user-guide/authorization-management/)
118148

119149
---
120150
## 准备工作
121-
在通过DMS MCP访问托管在DMS的数据库实例之前,需要将对应的数据库实例录入至DMS中,并为实例开启 [安全托管](https://help.aliyun.com/zh/dms/product-overview/security-hosting)
151+
在通过DMS MCP访问托管在DMS的数据源之前,需要将对应的数据源录入至DMS中,并为实例开启 [安全托管](https://help.aliyun.com/zh/dms/product-overview/security-hosting)
122152

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

src/alibabacloud_dms_mcp_server/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ async def list_instance(
224224
search_key: Optional[str] = Field(default=None, description="Optional search key (e.g., instance host, instance alias, etc.)"),
225225
db_type: Optional[str] = Field(default=None, description="Optional instanceType, or called dbType (e.g., mysql, polardb, oracle, "
226226
"postgresql, sqlserver, polardb-pg, etc.)"),
227-
env_type: Optional[str] = Field(default=None, description="Optional Instance EnvType (e.g., product, dev, test, etc.)")
227+
env_type: Optional[str] = Field(default=None, description="Optional instance environment type (e.g., product, dev, test, etc. )")
228228
) -> List[InstanceDetail]:
229229
client = create_client()
230230
req = dms_enterprise_20181101_models.ListInstancesRequest()

0 commit comments

Comments
 (0)