mysql-mcp-ddz
Provides tools for interacting with MySQL databases, including connecting and validating connections, running parameterized SELECT queries, executing INSERT/UPDATE/DELETE statements, listing tables, and retrieving table schemas.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mysql-mcp-ddz list all tables in the database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mysql-mcp-ddz
MySQL MCP 服务器 - 用于 MySQL 数据库操作的 Model Context Protocol 服务器。
安装
npm install mysql-mcp-ddz或直接使用 npx:
npx -y mysql-mcp-ddzRelated 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"
}
}
}
}环境变量
变量 | 描述 | 默认值 |
| 数据库主机 |
|
| 数据库端口 |
|
| 数据库用户 |
|
| 数据库密码 | (空) |
| 数据库名称 | (必填) |
可用工具
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 toolsconnect_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
Scored across 5 tools
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.
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.
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.
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
Related MCP Connectors
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Work with your database from AI tools: ask, export, approved changes, and scheduled jobs.
Hosted MySQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceA 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.5329 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables 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.-
- FlicenseNot gradedqualityDmaintenanceA 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.-
- AlicenseNot gradedqualityDmaintenanceEnables AI models to interact with MySQL databases through MCP protocol, supporting queries, table schema inspection, and data manipulation operations.MIT