MCP server for MySQL database access, enabling AI to query, inspect, and manage MySQL databases via natural language.
mysql-mcp has well-structured tool definitions with clear naming (verb_noun pattern: mysql_query, mysql_execute, etc.) and comprehensive descriptions in Chinese. All 8 tools have input schemas with type definitions. However, parameter descriptions are minimal (often just the SQL statement or table name), and output schemas are not documented. Error handling exists but lacks recovery guidance. Security checks (SQL injection prevention, permission gates) are present but not reflected in tool annotations. The server caps results at MAX_ROWS (1000) but does not document pagination or result limits in tool descriptions.
查看指定表的详细字段信息:字段名、类型、是否可空、键类型、默认值、注释
执行 INSERT / UPDATE / DELETE 操作,自动包裹事务。当前权限:INSERT=❌未开启,UPDATE=❌未开启,DELETE=❌未开启。【重要】如果目标操作的权限为❌未开启,请不要调用本工具,直接告知用户需在 mcp.json 的 env 中将对应的 ALLOW_*_OPERATION 设为 true 并重启 MCP 后才能执行。
分析 SQL 语句的执行计划,帮助定位慢查询原因(全表扫描、缺少索引等)
列出 MySQL 实例中的所有数据库及其大小
列出当前数据库中所有表,包含引擎、行数、大小、排序规则等信息
执行只读 SELECT 查询,返回查询结果(最多 1000 行)。支持 SELECT / WITH / EXPLAIN / SHOW / DESCRIBE 语句。
查看指定表的完整 DDL 建表语句,包含字段、索引、外键、引擎、字符集等
Output schemas not documented. Tools return JSON but LLMs cannot infer field names, types, or structure. Downstream tool chaining is impossible without trial-and-error.
Parameter descriptions are minimal. 'sql' param lacks format/constraint guidance (e.g., max length, allowed statement types). 'table' param has no validation hints. LLMs cannot self-correct invalid input.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint). mysql_execute is destructive but unmarked. LLMs cannot distinguish safe reads from risky writes without parsing descriptions.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 59 | 2026-07-28+ | v2 |
查看指定表的所有索引信息,包含索引名、唯一性、字段、基数等
Error messages are generic. checkSQL() throws 'dangerous SQL detected' without stating which pattern matched or how to fix it. mysql_execute catches errors but returns raw error.code/errno instead of recovery guidance.
Result limits (MAX_ROWS=1000) not documented in tool descriptions. LLMs may expect complete result sets and fail silently when truncated. No pagination support (offset/limit params).