Skip to main content
Glama
aliyun

Adb MySQL MCP Server

Official
by aliyun

AnalyticDB para el servidor MCP de MySQL

El servidor MCP de AnalyticDB para MySQL funciona como una interfaz universal entre los agentes de IA y las bases de datos de AnalyticDB para MySQL . Permite una comunicación fluida entre ambos, lo que ayuda a los agentes de IA a recuperar metadatos de la base de datos de AnalyticDB para MySQL y a ejecutar operaciones SQL.

1. Configuración del cliente MCP

Modo 1: Uso de archivo local

  • Descargar el repositorio de GitHub

git clone https://github.com/aliyun/alibabacloud-adb-mysql-mcp-server
  • Integración MCP

Agregue la siguiente configuración al archivo de configuración del cliente MCP:

{
  "mcpServers": {
    "adb-mysql-mcp-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/alibabacloud-adb-mysql-mcp-server",
        "run",
        "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"
      }
    }
  }
}

Modo 2: Uso del modo PIP

  • Instalación

Instale MCP Server utilizando el siguiente paquete:

pip install adb-mysql-mcp-server
  • Integración MCP

Agregue la siguiente configuración al archivo de configuración del cliente MCP:

 {
  "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"
      }
    }
  }
}

Related MCP server: Hologres MCP Server

2. Desarrolle su propio servidor AnalyticDB para MySQL MCP

Si desea desarrollar su propio AnalyticDB para MySQL MCP Server, puede instalar los paquetes de dependencia de Python utilizando el siguiente comando:

  1. Descargue el código fuente de GitHub .

  2. Instalar el administrador de paquetes uv .

  3. Instale Node.js que proporciona una herramienta de paquete de nodos cuyo nombre es npx

  4. Instale las dependencias de Python en el directorio raíz del proyecto usando el siguiente comando:

uv pip install -r pyproject.toml 
  1. Si desea depurar el servidor mcp localmente, puede iniciar un Inspector MCP usando el siguiente comando:

npx @modelcontextprotocol/inspector  \
-e ADB_MYSQL_HOST=your_host \
-e ADB_MYSQL_PORT=your_port \
-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 

3. Introducción a los componentes de AnalyticDB para MySQL MCP Server

  • Herramientas

    • execute_sql : ejecuta una consulta SQL en el clúster AnalyticDB para MySQL

    • get_query_plan : Obtener el plan de consulta para una consulta SQL

    • get_execution_plan : obtiene el plan de ejecución real con estadísticas de tiempo de ejecución para una consulta SQL

  • Recursos

    • Recursos integrados

      • adbmysql:///databases : obtiene todas las bases de datos en el análisis para el clúster MySQL

    • Plantillas de recursos

      • adbmysql:///{schema}/tables : Obtener todas las tablas en una base de datos específica

      • adbmysql:///{database}/{table}/ddl : Obtener el script DDL de una tabla en una base de datos específica

      • adbmysql:///{config}/{key}/value : Obtener el valor de una clave de configuración en el clúster

  • Indicaciones

No proporcionado en el momento actual.

Available Tools

3 tools
execute_sqlC

Execute a SQL query in the Adb MySQL Cluster

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL query to execute

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure but provides minimal information. It states what the tool does but doesn't disclose important behavioral traits like whether this is a read-only or write operation, what permissions are required, whether there are query size or complexity limits, what happens with malformed queries, or what the response format will be. The description adds almost no behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that directly states the tool's purpose without any wasted words. It's front-loaded with the essential information and appropriately sized for what it communicates.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that this is a SQL execution tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what kind of SQL queries are supported, what database/schema context is used, whether transactions are supported, what the return format will be, or any error handling behavior. For a tool that could potentially execute destructive operations, this level of documentation is inadequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage with the 'query' parameter clearly documented. The description doesn't add any meaningful parameter semantics beyond what the schema already provides - it doesn't specify query syntax requirements, supported SQL dialects, parameter binding methods, or any constraints on the query content. With complete schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Execute') and target resource ('a SQL query in the Adb MySQL Cluster'), providing specific verb+resource pairing. However, it doesn't explicitly differentiate from sibling tools like get_execution_plan or get_query_plan, which appear to be related query analysis tools rather than execution tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools, suggest appropriate query types, warn about limitations, or provide any context about when this execution tool should be preferred over the analysis-focused sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_execution_planC

Get the actual execution plan with runtime statistics for a SQL query

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL query to analyze

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves 'actual execution plan with runtime statistics', which implies a read-only, non-destructive operation, but doesn't clarify performance impact, permissions needed, or what 'runtime statistics' include (e.g., execution time, row counts). This leaves significant gaps for a tool that likely interacts with a database system.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of SQL execution plans and the lack of annotations or output schema, the description is incomplete. It doesn't explain what an 'execution plan' entails, how runtime statistics are presented, or potential limitations (e.g., only for certain databases). For a tool with no structured output documentation, this leaves the agent with insufficient context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'query' fully documented in the schema as 'The SQL query to analyze'. The description adds no additional semantic context beyond this, such as query format requirements or supported SQL dialects, so it meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('execution plan with runtime statistics for a SQL query'), making the purpose immediately understandable. It distinguishes from 'execute_sql' (which runs queries) and 'get_query_plan' (which likely provides theoretical plans without runtime data), though the distinction from the latter could be more explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'execute_sql' or 'get_query_plan'. It doesn't mention prerequisites, such as needing a valid SQL query or when runtime statistics are available, leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_query_planC

Get the query plan for a SQL query

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL query to analyze

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden but only states what the tool does without behavioral details. It doesn't disclose if this is a read-only operation, has side effects, requires specific permissions, or involves rate limits, which are critical for a tool analyzing SQL queries.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero wasted words, making it highly concise and front-loaded. It efficiently communicates the core function without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a tool that likely returns complex query plan data, the description is insufficient. It doesn't explain the return format, potential errors, or usage context, leaving gaps in understanding for effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the 'query' parameter. The description adds no additional meaning beyond this, such as SQL dialect support or query complexity limits, so it meets the baseline for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and target ('query plan for a SQL query'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'get_execution_plan', which might be similar, so it misses the highest score for sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'execute_sql' or 'get_execution_plan'. It lacks context such as whether this is for debugging, optimization, or pre-execution analysis, leaving the agent with no usage criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updates
    • First observedexecute_sql
    • First observedget_execution_plan
    • First observedget_query_plan

TDQS

B3/5.0
Disambiguation3/5

The tools have overlapping purposes focused on SQL query analysis, with execute_sql clearly distinct for running queries, but get_execution_plan and get_query_plan could be confused as both relate to query plans. Descriptions help differentiate them slightly (one includes runtime statistics), but the boundaries are somewhat unclear.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (execute_sql, get_execution_plan, get_query_plan) with clear, predictable naming. There are no deviations in style or convention across the set.

Tool Count3/5

With only 3 tools, the server feels thin for a MySQL cluster management domain, as it lacks operations for database/table management, user permissions, or monitoring. However, the tools are focused on query execution and analysis, which is a reasonable but limited scope.

Completeness2/5

For a MySQL server, there are significant gaps in the tool surface: no CRUD operations for databases/tables, no user management, no backup/restore, and no monitoring tools. The set only covers query execution and plan analysis, leaving many core database management tasks unaddressed.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables AI models to perform MySQL database operations through a standardized interface, supporting secure connections, query execution, and comprehensive schema management.
    7
    121
    33
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    A universal interface that enables AI Agents to communicate with Hologres databases, allowing them to retrieve database metadata and execute SQL operations.
    12
    34
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Serves as a universal interface between AI Agents and AnalyticDB PostgreSQL databases, enabling metadata retrieval and SQL execution, with additional capabilities for knowledge graph and LLM memory management.
    16
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to interact with a MySQL database using natural language, automating SQL tasks like querying, inserting, updating, and deleting data.
    1
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aliyun/alibabacloud-adb-mysql-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server