Alibaba Cloud ADB MySQL logo

Alibaba Cloud ADB MySQL

Organization
aliyun

AnalyticDB for MySQL MCP Server

Publisheraliyun
Repositoryalibabacloud-adb-mysql-mcp-server
LanguagePython
Forks
20
Stars
31
Available tools
0
Transport typestdio
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Alibaba Cloud ADB MySQL exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    31 stars and 20 forks from the linked repository.

AnalyticDB for MySQL MCP Server

English | 中文

AnalyticDB for MySQL MCP Server is a universal interface between AI Agents and AnalyticDB MySQL. It provides two categories of capabilities:

  • OpenAPI Tools (openapi group): Manage clusters, whitelists, accounts, networking, monitoring, diagnostics, and audit logs via Alibaba Cloud OpenAPI.
  • SQL Tools & Resources (sql group): Connect directly to ADB MySQL clusters to execute SQL, view execution plans, and browse database metadata.

Read-only tools are annotated with ToolAnnotations(readOnlyHint=True) per the MCP protocol, allowing clients to distinguish them from mutating operations.

一、Prerequisites

  • Python >= 3.13
  • uv (recommended package manager and runner)
  • Alibaba Cloud AccessKey (required for OpenAPI tools)
  • Optional: ADB MySQL connection credentials (for SQL tools in direct-connection mode)

二、Quick Start

2.1 Using cherry-studio (Recommended)

  1. Download and install cherry-studio
  2. Follow the documentation to install uv, which is required for the MCP environment
  3. Configure and use ADB MySQL MCP according to the documentation. You can quickly import the configuration using the JSON below.

cherry-studio configuration

Configuration A — SQL tools only (execute queries, view plans, browse metadata):

json
{
  "mcpServers": {
    "adb-mysql-mcp-server": {
      "name": "adb-mysql-mcp-server",
      "type": "stdio",
      "isActive": true,
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/alibabacloud-adb-mysql-mcp-server",
        "run",
        "adb-mysql-mcp-server"
      ],
      "env": {
        "ADB_MYSQL_HOST": "your_adb_mysql_host",
        "ADB_MYSQL_PORT": "3306",
        "ADB_MYSQL_USER": "your_username",
        "ADB_MYSQL_PASSWORD": "your_password",
        "ADB_MYSQL_DATABASE": "your_database"
      }
    }
  }
}

Configuration B — OpenAPI tools (cluster management, diagnostics, monitoring):

Note: Please set ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET to your Alibaba Cloud AccessKey credentials.

json
{
  "mcpServers": {
    "adb-mysql-mcp-server": {
      "name": "adb-mysql-mcp-server",
      "type": "stdio",
      "isActive": true,
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/alibabacloud-adb-mysql-mcp-server",
        "run",
        "adb-mysql-mcp-server"
      ],
      "env": {
        "ALIBABA_CLOUD_ACCESS_KEY_ID": "your_access_key_id",
        "ALIBABA_CLOUD_ACCESS_KEY_SECRET": "your_access_key_secret"
      }
    }
  }
}

You can combine both configurations by setting all environment variables together. When AK/SK is not configured, OpenAPI tools are automatically disabled — only SQL tools remain active.

2.2 Using Claude Code

Download from GitHub and sync dependencies:

shell
git clone https://github.com/aliyun/alibabacloud-adb-mysql-mcp-server
cd alibabacloud-adb-mysql-mcp-server
uv sync

Add the following configuration to the Claude Code MCP config file (project-level: .mcp.json in the project root, or user-level: ~/.claude/settings.json):

stdio transport:

json5
{
  "mcpServers": {
    "adb-mysql-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/alibabacloud-adb-mysql-mcp-server",
        "run",
        "adb-mysql-mcp-server"
      ],
      "env": {
        "ALIBABA_CLOUD_ACCESS_KEY_ID": "your_access_key_id",
        "ALIBABA_CLOUD_ACCESS_KEY_SECRET": "your_access_key_secret",
        "ALIBABA_CLOUD_SECURITY_TOKEN": "",
        // Uncomment the following lines to enable SQL tools for direct database connection:
        // "ADB_MYSQL_HOST": "your_adb_mysql_host",
        // "ADB_MYSQL_PORT": "3306",
        // "ADB_MYSQL_USER": "your_username",
        // "ADB_MYSQL_PASSWORD": "your_password",
        // "ADB_MYSQL_DATABASE": "your_database"
      }
    }
  }
}

SSE transport — start the server first, then configure the client:

bash
export ALIBABA_CLOUD_ACCESS_KEY_ID="your_access_key_id"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="your_access_key_secret"
# Uncomment the following lines to enable SQL tools for direct database connection:
# export ADB_MYSQL_HOST="your_adb_mysql_host"
# export ADB_MYSQL_PORT="3306"
# export ADB_MYSQL_USER="your_username"
# export ADB_MYSQL_PASSWORD="your_password"
# export ADB_MYSQL_DATABASE="your_database"
export SERVER_TRANSPORT=sse
export SERVER_PORT=8000

uv --directory /path/to/alibabacloud-adb-mysql-mcp-server run adb-mysql-mcp-server
json
{
  "mcpServers": {
    "adb-mysql-mcp-server": {
      "url": "http://localhost:8000/sse"
    }
  }
}

Streamable HTTP transport — start the server first, then configure the client:

bash
export ALIBABA_CLOUD_ACCESS_KEY_ID="your_access_key_id"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="your_access_key_secret"
# Uncomment the following lines to enable SQL tools for direct database connection:
# export ADB_MYSQL_HOST="your_adb_mysql_host"
# export ADB_MYSQL_PORT="3306"
# export ADB_MYSQL_USER="your_username"
# export ADB_MYSQL_PASSWORD="your_password"
# export ADB_MYSQL_DATABASE="your_database"
export SERVER_TRANSPORT=streamable_http
export SERVER_PORT=8000

uv --directory /path/to/alibabacloud-adb-mysql-mcp-server run adb-mysql-mcp-server
json
{
  "mcpServers": {
    "adb-mysql-mcp-server": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Note: When ADB_MYSQL_USER and ADB_MYSQL_PASSWORD are not configured but AK/SK is available, a temporary database account is automatically created via OpenAPI for SQL execution and cleaned up afterward.

2.3 Using Cline

Set environment variables and run the MCP server:

bash
export ALIBABA_CLOUD_ACCESS_KEY_ID="your_access_key_id"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="your_access_key_secret"
export SERVER_TRANSPORT=sse
export SERVER_PORT=8000

uv --directory /path/to/alibabacloud-adb-mysql-mcp-server run adb-mysql-mcp-server

Then configure the Cline remote server:

remote_server = "http://127.0.0.1:8000/sse"

三、Environment Variables

VariableRequiredDescription
ALIBABA_CLOUD_ACCESS_KEY_IDYes (OpenAPI tools)Alibaba Cloud AccessKey ID
ALIBABA_CLOUD_ACCESS_KEY_SECRETYes (OpenAPI tools)Alibaba Cloud AccessKey Secret
ALIBABA_CLOUD_SECURITY_TOKENNoSTS temporary security token
ADB_MYSQL_HOSTNoDatabase host (direct-connection mode)
ADB_MYSQL_PORTNoDatabase port, default 3306 (direct-connection mode)
ADB_MYSQL_USERNoDatabase username (direct-connection mode)
ADB_MYSQL_PASSWORDNoDatabase password (direct-connection mode)
ADB_MYSQL_DATABASENoDefault database name (direct-connection mode)
ADB_MYSQL_CONNECT_TIMEOUTNoDatabase connection timeout in seconds, default 2
ADB_API_CONNECT_TIMEOUTNoOpenAPI connection timeout in milliseconds, default 10000 (10s)
ADB_API_READ_TIMEOUTNoOpenAPI read timeout in milliseconds, default 300000 (5min)
SERVER_TRANSPORTNoTransport protocol: stdio (default), sse, streamable_http
SERVER_PORTNoSSE/HTTP server port, default 8000

四、Tool List

4.1 Cluster Management (group: openapi)

ToolDescription
describe_db_clustersList ADB MySQL clusters in a region
describe_db_cluster_attributeGet detailed cluster attributes
describe_cluster_access_whitelistGet cluster IP whitelist
modify_cluster_access_whitelistModify cluster IP whitelist
describe_accountsList database accounts in a cluster
describe_cluster_net_infoGet cluster network connection info
get_current_timeGet current server time

4.2 Diagnostics & Monitoring (group: openapi)

ToolDescription
describe_db_cluster_performanceQuery cluster performance metrics (CPU, memory, QPS, etc.)
describe_db_cluster_health_statusQuery cluster health status
describe_diagnosis_recordsQuery SQL diagnosis summary records
describe_diagnosis_sql_infoGet SQL execution details (plan, runtime info)
describe_bad_sql_detectionDetect bad SQL impacting cluster stability
describe_sql_patternsQuery SQL pattern list
describe_table_statisticsQuery table-level statistics

4.3 Administration & Audit (group: openapi)

ToolDescription
create_accountCreate a database account
modify_db_cluster_descriptionModify cluster description
describe_db_cluster_space_summaryGet cluster storage space summary
describe_audit_log_recordsQuery SQL audit log records

4.4 Advanced Diagnostics (group: openapi)

ToolDescription
describe_executor_detectionCompute node diagnostics
describe_worker_detectionStorage node diagnostics
describe_controller_detectionAccess node diagnostics
describe_available_advicesGet optimization advices
kill_processKill a running query process
describe_db_resource_groupGet resource group configuration
describe_excessive_primary_keysDetect tables with excessive primary keys
describe_oversize_non_partition_table_infosDetect oversized non-partition tables
describe_table_partition_diagnoseDiagnose table partitioning issues
describe_inclined_tablesDetect data-skewed tables

4.5 SQL Tools (group: sql)

ToolDescription
execute_sqlExecute SQL on an ADB MySQL cluster
get_query_planGet EXPLAIN execution plan
get_execution_planGet EXPLAIN ANALYZE actual execution plan

4.6 MCP Resources (group: sql)

Resource URIDescription
adbmysql:///databasesList all databases
adbmysql:///{database}/tablesList all tables in a database
adbmysql:///{database}/{table}/ddlGet table DDL
adbmysql:///config/{key}/valueGet a config key value

五、Local Development

shell
git clone https://github.com/aliyun/alibabacloud-adb-mysql-mcp-server
cd alibabacloud-adb-mysql-mcp-server
uv sync

Run tests:

shell
uv run python -m pytest test/ -v

Debug with MCP Inspector:

shell
npx @modelcontextprotocol/inspector \
  -e ALIBABA_CLOUD_ACCESS_KEY_ID=your_ak \
  -e ALIBABA_CLOUD_ACCESS_KEY_SECRET=your_sk \
  uv --directory /path/to/alibabacloud-adb-mysql-mcp-server run adb-mysql-mcp-server

六、SKILL

In addition to the MCP server above, this project also provides an independent SKILL under the skill/ directory. The Skill can be deployed directly to Claude Code without relying on this MCP server (it calls ADB MySQL OpenAPI through call_adb_api.py in the SKILL directory).

The Skill covers cluster information queries, performance monitoring, slow query diagnosis, SQL Pattern analysis, and SQL execution, with built-in guided diagnostic workflows for common scenarios.

For setup and usage details, see skill/skill_readme.md.

Note: The evolution of this Skill will be aligned with our next-generation Agent in the future. Stay tuned.

License

Apache License 2.0

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "adb-mysql-mcp-server": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "adb-mysql-mcp-server",
        "adb-mysql-mcp-server"
      ],
      "env": {
        "ADB_MYSQL_HOST": "host",
        "ADB_MYSQL_PORT": "port",
        "ADB_MYSQL_USER": "database_user",
        "ADB_MYSQL_PASSWORD": "database_password",
        "ADB_MYSQL_DATABASE": "database"
      }
    }
  }
}

Use Alibaba Cloud ADB MySQL MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Alibaba Cloud ADB MySQL is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Alibaba Cloud ADB MySQL as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Alibaba Cloud ADB MySQL MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "alibaba-cloud-adb-mysql": {
      "command": "npx",
      "args": [
        "-y",
        "adb-mysql-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Alibaba Cloud ADB MySQL MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Alibaba Cloud ADB MySQL MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Alibaba Cloud ADB MySQL to help me with this task?
Alibaba Cloud ADB MySQL
Sure. I read it.
Here is what I found using Alibaba Cloud ADB MySQL.

Frequently asked questions

What is the Alibaba Cloud ADB MySQL MCP server used for?

Alibaba Cloud ADB MySQL is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Alibaba Cloud ADB MySQL MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Alibaba Cloud ADB MySQL with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Alibaba Cloud ADB MySQL MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Alibaba Cloud ADB MySQL connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Alibaba Cloud ADB MySQL MCP to TypingMind?

Alibaba Cloud ADB MySQL runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Alibaba Cloud ADB MySQL MCP provide in TypingMind?

Alibaba Cloud ADB MySQL exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Alibaba Cloud ADB MySQL MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Alibaba Cloud ADB MySQL requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇