Skip to main content
Glama
mysql-mcp-ddz

mysql-mcp-ddz

by fanzhenddz

mysql-mcp-ddz

MySQL MCP 服务器 - 用于 MySQL 数据库操作的 Model Context Protocol 服务器。

安装

npm install mysql-mcp-ddz

或直接使用 npx:

npx -y mysql-mcp-ddz

Related MCP server: MySQL MCP Server

配置

添加到 MCP 设置(例如 Claude Desktop 配置):

{
  "mcpServers": {
    "mysql-mcp-ddz": {
      "command": "npx",
      "args": ["-y", "mysql-mcp-ddz"],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASSWORD": "your_password",
        "MYSQL_DB": "your_database"
      }
    }
  }
}

环境变量

变量

描述

默认值

MYSQL_HOST

数据库主机

127.0.0.1

MYSQL_PORT

数据库端口

3306

MYSQL_USER

数据库用户

root

MYSQL_PASSWORD

数据库密码

(空)

MYSQL_DB

数据库名称

(必填)

可用工具

connect_db

连接到 MySQL 数据库并验证连接。

query

执行 SELECT 查询。

{
  "sql": "SELECT * FROM users WHERE id = ?",
  "params": [1]
}

execute

执行 INSERT、UPDATE 或 DELETE 查询。

{
  "sql": "INSERT INTO users (name, email) VALUES (?, ?)",
  "params": ["John", "john@example.com"]
}

list_tables

列出数据库中的所有表。

describe_table

获取表结构。

{
  "table": "users"
}

Available Tools

5 tools
connect_dbC

Connect to MySQL database

Inputs: host (required), user (required), database (required), password (required).

describe_tableB

Get table structure

Inputs: table (required).

executeB

Execute an INSERT, UPDATE, or DELETE query

Inputs: sql (required), params.

list_tablesA

List all tables in the database

Inputs: no named parameters.

queryB

Execute a SELECT query

Inputs: sql (required), params.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 5 tools

    Disambiguation4/5

    query and execute are the closest pair, but their descriptions clearly split read (SELECT) from write (INSERT/UPDATE/DELETE) operations, making selection straightforward. list_tables and describe_table both introspect schema but target different granularity (table inventory vs column structure). connect_db is distinct as a session setup step.

    Naming Consistency3/5

    Three tools follow a verb_noun pattern (connect_db, list_tables, describe_table) while query and execute are bare verbs with no object, creating a mixed convention. The names are still readable and guessable, but not a predictable pattern throughout.

    Tool Count4/5

    Five tools is a tight, well-scoped surface for a database access server — each tool maps to a real distinct operation with no filler. It is on the lean side (no schema/DDL or transaction tooling), but nothing is redundant.

    Completeness3/5

    Core DML is covered (SELECT via query, writes via execute) plus basic schema discovery, but there are notable gaps: no DDL (create/alter/drop table), no index or SHOW/EXPLAIN inspection, no transaction control, and no explicit disconnect/connection management. Agents needing schema changes or multi-statement transactions will hit dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI models to interact with MySQL databases, providing tools for querying, executing statements, listing tables, and describing table structures.
      5
      329 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with MySQL databases by executing SQL queries, describing table schemas, and listing tables. It provides seamless database integration for tools like Cursor through the Model Context Protocol.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol service that enables AI assistants to directly query and manage MySQL databases through natural language. It supports SQL execution, schema inspection, and atomic transactions for comprehensive database interaction.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI models to interact with MySQL databases through MCP protocol, supporting queries, table schema inspection, and data manipulation operations.
      MIT