AnalyticDB for MySQL MCP Server – bridges AI-Agent MCP clients with Alibaba Cloud AnalyticDB for MySQL clusters, exposing tools to run SQL, fetch plans and read metadata.
https://github.com/aliyun/alibabacloud-adb-mysql-mcp-serverSkip the custom database integration code. This MCP server connects your AI agents directly to Alibaba Cloud's AnalyticDB for MySQL, giving them instant access to execute queries, analyze execution plans, and explore schema metadata.
Most AI agents hit a wall when you need them to work with your actual data. They can generate SQL all day, but executing it? Analyzing query performance? Understanding your schema? You're back to writing custom integration code.
This MCP server solves that gap. Your AI agent gets three powerful capabilities out of the box:
Automated Performance Tuning: Ask your AI agent "Why is this query slow?" and it can execute the query, fetch the execution plan, and suggest optimizations based on actual runtime statistics.
Interactive Data Exploration: "Show me the top revenue-generating products this quarter" becomes a natural conversation where the agent discovers your schema, writes the query, executes it, and explains the results.
Schema Documentation: Need to understand an unfamiliar database? The agent can explore tables, fetch DDL scripts, and explain the relationships between entities.
Query Optimization Workflows: Instead of manually running EXPLAIN statements, your agent can compare multiple query approaches and recommend the most efficient execution path.
Two installation paths depending on your preference:
Quick Start with pip:
pip install adb-mysql-mcp-server
Then add this to your MCP client config:
{
"mcpServers": {
"adb-mysql-mcp-server": {
"command": "uv",
"args": ["run", "--with", "adb-mysql-mcp-server", "adb-mysql-mcp-server"],
"env": {
"ADB_MYSQL_HOST": "your-host",
"ADB_MYSQL_PORT": "3306",
"ADB_MYSQL_USER": "your-username",
"ADB_MYSQL_PASSWORD": "your-password",
"ADB_MYSQL_DATABASE": "your-database"
}
}
}
}
Development Setup:
git clone https://github.com/aliyun/alibabacloud-adb-mysql-mcp-server
cd alibabacloud-adb-mysql-mcp-server
uv pip install -r pyproject.toml
For debugging, spin up the MCP Inspector:
npx @modelcontextprotocol/inspector \
-e ADB_MYSQL_HOST=your-host \
-e ADB_MYSQL_PORT=3306 \
-e ADB_MYSQL_USER=your-username \
-e ADB_MYSQL_PASSWORD=your-password \
-e ADB_MYSQL_DATABASE=your-database \
uv --directory /path/to/alibabacloud-adb-mysql-mcp-server run adb-mysql-mcp-server
Execution Tools:
execute_sql: Run any SQL query against your clusterget_query_plan: Fetch logical execution plans for optimizationget_execution_plan: Get runtime statistics and actual performance metricsSchema Resources:
adbmysql:///databases: List all databases in your clusteradbmysql:///{schema}/tables: Browse tables in any databaseadbmysql:///{database}/{table}/ddl: Get complete table definitionsadbmysql:///{config}/{key}/value: Read cluster configuration valuesInstead of writing database connection code, handling connection pools, parsing execution plans, and building schema introspection logic, you get a battle-tested interface that's already MCP-compatible.
The server handles the complexity of AnalyticDB's specific SQL dialect, execution plan formats, and metadata structures. Your AI agent just makes standard MCP calls and gets structured responses.
Perfect for teams running analytical workloads on Alibaba Cloud who want their AI agents to be first-class participants in data analysis workflows, not just SQL generators.