The AnalyticDB for MySQL MCP Server enables AI agents to interact with AnalyticDB for MySQL databases through a standardized interface, providing comprehensive database querying, analysis, and metadata retrieval capabilities.
Core Capabilities:
Execute SQL queries - Run SQL operations directly on AnalyticDB for MySQL clusters
Analyze query performance - Get query execution plans and actual execution plans with runtime statistics to optimize query performance
Browse databases and tables - List all databases in the cluster and tables within specific databases
Access table schemas - Retrieve DDL scripts to understand table structure and definitions
Check cluster configuration - Fetch configuration values for specific keys
Key Features:
Flexible deployment options via pip package or local source code
Local debugging support using the MCP Inspector tool
Seamless integration for AI agents to perform data retrieval, SQL operations, and performance optimization
Provides a universal interface for AI agents to interact with Alibaba Cloud AnalyticDB for MySQL, enabling database metadata retrieval, SQL query execution, query plan analysis, and access to table structures across databases.
AnalyticDB for MySQL MCP Server
AnalyticDB for MySQL MCP Server serves as a universal interface between AI Agents and AnalyticDB for MySQL databases. It enables seamless communication between AI Agents and AnalyticDB for MySQL, helping AI Agents retrieve AnalyticDB for MySQL database metadata and execute SQL operations.
1. MCP Client Configuration
Mode 1: Using Local File
Download the GitHub repository
MCP Integration
Add the following configuration to the MCP client configuration file:
Mode 2: Using PIP Mode
Installation
Install MCP Server using the following package:
MCP Integration
Add the following configuration to the MCP client configuration file:
Related MCP server: MySql MCP Server
2. Develop your own AnalyticDB for MySQL MCP server
If you want to develop your own AnalyticDB for MySQL MCP Server, you can install the python dependency packages using the following command:
Download the source code from GitHub.
Install uv package manager.
Install Node.js which provides a node package tool whose name is
npxInstall the python dependencies in the root diretory of the project using the following command:
If you want to debug the mcp server locally, you could start up an MCP Inspector using the following command:
3. Introduction to the components of AnalyticDB for MySQL MCP Server
Tools
execute_sql: Execute a SQL query in the AnalyticDB for MySQL Clusterget_query_plan: Get the query plan for a SQL queryget_execution_plan: Get the actual execution plan with runtime statistics for a SQL query
Resources
Built-in Resources
adbmysql:///databases: Get all the databases in the analytic for mysql cluster
Resource Templates
adbmysql:///{database}/tables: Get all the tables in a specific databaseadbmysql:///{database}/{table}/ddl: Get the DDL script of a table in a specific databaseadbmysql:///config/{key}/value: Get the value for a config key in the cluster
Prompts
Not provided at the present moment.