Labsco
aliyun logo

AlibabaCloud DMS MCP Server

β˜… 46

from aliyun

An AI-powered gateway for managing over 40 data sources like Alibaba Cloud and mainstream databases, featuring NL2SQL, code generation, and data migration.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredNeeds API keys
<!-- ι‘Άιƒ¨θ―­θ¨€εˆ‡ζ’ --> <p align="center">English | <a href="/doc/README-zh-cn.md">δΈ­ζ–‡</a><br></p>

AlibabaCloud DMS MCP Server

AI-Era Data Security Access Gateway |Intelligent Data Query Engine|Supports 40+ Data Sources


Core Features

Secure Access

  • Account and Password Security Management:Safely manage database account passwords without manual maintenance, effectively preventing sensitive information leakage.
  • Intranet Access Support:Enables database access through an internal network, keeping data within the premises and significantly enhancing data security and privacy protection.
  • 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.
  • 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.
  • SQL Audit Trail: Records all SQL operation logs, supporting full traceability and compliance audits to meet regulatory requirements.

Intelligent Data Inquiry

  • 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.
  • Personalized Knowledge Base: Built-in metadata and knowledge base for data inquiry, supports custom business knowledge and query patterns to build tailored intelligent data inquiry capabilities aligned with business scenarios.

Multi-data Source Support

  • Wide Range of Data Source Support: Supports over 40 mainstream databases/data warehouses, enabling unified access and integration from multiple sources.
  • Unified Management Across Environments: Supports centralized management of database instances across development, testing, and production environments to improve operational efficiency.
  • 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.

Supported Ecosystem

  • Supports all Alibaba Cloud data sources: RDS, PolarDB, ADB series, Lindorm series, TableStore series, Maxcompute series.
  • Supports mainstream databases/data warehouses: MySQL, MariaDB, PostgreSQL, Oracle, SQLServer, Redis, MongoDB, StarRocks, Clickhouse, SelectDB, DB2, OceanBase, Gauss, BigQuery, etc.

Core Architecture

<img src="images/architecture-0508.jpg" alt="Architecture" width="60%">

Tool List

Tool NameDescriptionApplicable Mode
addInstanceAdds an instance to DMS. Only Aliyun instances are supported.Multi-instance Mode
listInstancesSearch for instances from DMS.Multi-instance Mode
getInstanceRetrieves detailed information about an instance based on host and port.Multi-instance Mode
searchDatabaseSearches databases based on schemaName.Multi-instance Mode
getDatabaseRetrieves detailed information about a specific database.Multi-instance Mode
listTablesLists tables under a specified database.Multi-instance Mode & Single Database Mode
getTableDetailInfoRetrieves detailed information about a specific table.Multi-instance Mode & Single Database Mode
executeScriptExecutes an SQL script and returns the result.Multi-instance Mode & Single Database Mode
createDataChangeOrderCreates a data change order in DMS.Multi-instance Mode & Single Database Mode
getOrderInfoRetrieves order information from DMS.Multi-instance Mode & Single Database Mode
submitOrderApprovalSubmits the order for approval in DMS.Multi-instance Mode & Single Database Mode
approveOrderApproves or rejects an order in DMS.Multi-instance Mode & Single Database Mode
generateSqlConverts natural language questions into SQL queries.Multi-instance Mode
askDatabaseNatural language querying of a database (NL2SQL + execute SQL).Single Database Mode
fixSqlAnalyzes and fixes SQL errors.Multi-instance Mode & Single Database Mode
answerSqlSyntaxAnswers SQL syntax-related questions.Multi-instance Mode & Single Database Mode
optimizeSqlAnalyzes and optimizes SQL performance.Multi-instance Mode & Single Database Mode
<p> For a full list of tools, please refer to: <a href="/doc/Tool-List-en.md">Tool List</a><br></p>

Supported Data Sources

DataSource/ToolNL2SQL nlsqlExecute script executeScriptShow schema getTableDetailInfoAccess control defaultAudit log default
MySQLβœ…βœ…βœ…βœ…βœ…
MariaDBβœ…βœ…βœ…βœ…βœ…
PostgreSQLβœ…βœ…βœ…βœ…βœ…
Oracleβœ…βœ…βœ…βœ…βœ…
SQLServerβœ…βœ…βœ…βœ…βœ…
RedisβŒβŒβœ…βœ…βœ…
MongoDBβŒβŒβœ…βœ…βœ…
StarRocksβœ…βœ…βœ…βœ…βœ…
Clickhouseβœ…βœ…βœ…βœ…βœ…
SelectDBβœ…βœ…βœ…βœ…βœ…
DB2βœ…βœ…βœ…βœ…βœ…
OceanBaseβœ…βœ…βœ…βœ…βœ…
Gaussβœ…βœ…βœ…βœ…βœ…
BigQueryβœ…βœ…βœ…βœ…βœ…
PolarDBβœ…βœ…βœ…βœ…βœ…
PolarDB-Xβœ…βœ…βœ…βœ…βœ…
AnalyticDBβœ…βœ…βœ…βœ…βœ…
Lindormβœ…βœ…βœ…βœ…βœ…
TableStoreβŒβŒβœ…βœ…βœ…
Maxcomputeβœ…βœ…βœ…βœ…βœ…
Hologresβœ…βœ…βœ…βœ…βœ…

Contact us

For any questions or suggestions, join the Alibaba Cloud DMS MCP Group (DingTalk Group ID: 129600002740) .

<img src="images/ding-en.jpg" alt="DingTalk" width="40%">

Security

Network Binding

This MCP Server only binds to 127.0.0.1 (localhost). It does not support remote network access. All connections must originate from the local machine. This design ensures that even if the server is accidentally started, it will not be exposed to the network.

SQL Execution Disclaimer

IMPORTANT: This tool is designed to provide full SQL execution capabilities, including SELECT, INSERT, UPDATE, DELETE, and DDL statements.

By using this MCP Server, you acknowledge and accept the following:

  1. You are solely responsible for ensuring that the AK/SK (AccessKey) used has appropriate, minimal permissions configured in Alibaba Cloud RAM.
  2. It is strongly recommended to enable DMS Safe Hosting Mode for your database instances, which provides built-in SQL review, risk identification, and approval workflows.
  3. The maintainers of this project are not responsible for any data loss, corruption, or security incidents resulting from SQL execution through this tool.
  4. Best practices:
    • Use read-only AK/SK for query-only scenarios
    • Enable DMS fine-grained permission control
    • Enable SQL audit logging for compliance
    • Regularly review and rotate access credentials

Security Design

  • No command injection risk: The codebase does not use subprocess, os.system, eval(), or exec(). All operations are performed through the Alibaba Cloud SDK.
  • No SSRF risk: All network requests are sent to a fixed Alibaba Cloud endpoint (dms-enterprise.cn-hangzhou.aliyuncs.com) via the SDK. No user-controlled URLs are fetched.
  • Input validation: Search interfaces validate input length and reject potentially dangerous SQL patterns to prevent injection through non-SQL-execution interfaces.

License

This project is licensed under the Apache 2.0 License.


Agent Skills (Independent of MCP)

In addition to the MCP Server, this project also hosts AI Agent skills for DMS Enterprise. These skills enable any AI agent (Codex, ChatGPT, Cursor, etc.) to manage DMS resources directly via OpenAPI β€” no MCP protocol required.

Quick Start (Skills)

  1. Read the skill definition:
    skills/database/dms/alicloud-database-dms-enterprise/SKILL.md

  2. Discover available APIs:

    python3 skills/database/dms/alicloud-database-dms-enterprise/scripts/list_openapi_meta_apis.py
  3. Configure AccessKey:

    export ALICLOUD_ACCESS_KEY_ID="your-ak"
    export ALICLOUD_ACCESS_KEY_SECRET="your-sk"
    export ALICLOUD_REGION_ID="cn-hangzhou"

Skill Capabilities

CategoryOperations
Instance ManagementRegister, list, update, delete database instances
SQL Execution & AuditExecute scripts, NL2SQL, SQL review & optimization
Permission ManagementCreate permission orders, grant/revoke user permissions
Data SecuritySensitive column identification, data masking, audit logs
Task OrchestrationCreate, execute, monitor task flows (DAG)
Metadata KnowledgeGet/edit table business knowledge

Prompt Examples

See skills/examples/prompts/ for DMS scenario-based prompt templates:

  • Instance management & resource query
  • SQL execution & audit
  • Permission & security management
  • Task orchestration & data changes
  • API discovery & metadata

Skill Index

<!-- SKILL_INDEX_BEGIN -->
CategorySkillDescriptionPath
database/dmsalicloud-database-dms-enterpriseManage Alibaba Cloud Data Management Service (DMS Enterprise) via OpenAPI. Use for database instance management, SQL audit, data security, task orchestration, sensitive data protection, permission management, and database operation workflows.skills/database/dms/alicloud-database-dms-enterprise
<!-- SKILL_INDEX_END -->

For agent-specific guidelines, see AGENTS.md.