Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Kurok1/mcp-server-mysql --skill mysql-mcpgit clone --depth 1 https://github.com/Kurok1/mcp-server-mysqlWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kurok1/mcp-server-mysql/mysql-mcp)<a href="https://agentmods.dev/skills/kurok1/mcp-server-mysql/mysql-mcp"><img src="https://agentmods.dev/badge/skills/kurok1/mcp-server-mysql/mysql-mcp/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kurok1/mcp-server-mysql/mysql-mcp"><img src="https://agentmods.dev/badge/skills/kurok1/mcp-server-mysql/mysql-mcp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00080 | $0.03132 |
| Opus 5.5 | $0.00032 | $0.01253 |
| Sonnet 5.5 | $0.00016 | $0.00626 |
| Haiku 4.5 | $0.00008 | $0.00313 |
Grade A, and why
mysql-mcp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
使用 mcp-server-mysql 查询与操作 MySQL
前置检查
本 skill 只适用于已连接 mcp-server-mysql 的会话。动手前先确认当前工具列表里确实存在 list_profile 和 mysql_query 等工具(客户端里通常带 mcp__<server名>__ 前缀,按后缀识别)。工具不存在时按常规方式完成数据库任务,或引导用户按仓库 README 配置连接。
这个 MCP server 是安全优先设计:每条 SQL 先过工业级 AST 解析校验(解析失败一律拒绝),读语句包在只读事务里执行,驱动层禁多语句。理解它的边界,你就能高效使用它;试图绕过只会浪费轮次。
心智模型
- 一次操作绑定一个 profile。profile 是服务端配置的独立连接,拥有自己的默认库、连接池、安全规则、审计及统计。所有
mysql_*工具都必填profile;list_profile无参数,返回按名称排序的{profiles: [{name, description}]},只描述配置,不代表连接健康检查通过。 - 默认只读、白名单默认全拒。能执行什么语句类型(
allowed_statements)、能碰哪些表(table_whitelist)由所选 profile 的服务端配置决定,会话内无法更改。 - DENIED 是边界,不是故障。收到
DENIED [规则名]: 原因时,按下文对照表调整做法;同一条语句换个写法重试大概率还是拒(校验基于语义解析,注释、大小写、版本化注释/*!...*/都藏不住东西)。 - fail-closed。极个别 MySQL 边缘语法解析器不认时也会被拒(
parse_error),这时换等价写法,而不是反复重试原句。 - 需要放宽边界(加白名单、开写权限、调行数上限)时,如实告诉用户去改服务端
config.yaml并重启 MCP,不要在 SQL 层想办法。
工具选择
| 任务 | 工具 |
|---|---|
| 发现可用连接名称与用途 | list_profile |
| 单条读查询(SELECT / SHOW / DESCRIBE / EXPLAIN) | mysql_query |
| 单条写语句(INSERT / UPDATE / DELETE / DDL,需服务端开启) | mysql_execute |
| 多条语句原子执行(全成或全回滚) | mysql_script |
| 看有哪些表可用 | mysql_list_tables |
| 看某张表的列结构 | mysql_describe_table |
| 分析单条 SELECT 的执行计划 | mysql_explain |
| 指定 profile 的执行统计(哪条最慢、拒了几条) | mysql_stats |
硬规则(违反必被拒)
- 一次一条语句。
mysql_query/mysql_execute只接受单语句;多条语句唯一的入口是mysql_script。 - 读写分道。写语句走
mysql_query会被wrong_tool拒,反之亦然。选工具本身就是意图声明。 - UPDATE / DELETE 必须带 WHERE(
block_unfiltered_writes默认开启)。这是防误操作护栏:若用户确实要全表操作,先向用户确认,再用能表达真实意图的条件(如主键范围)执行,不要默默加WHERE 1=1规避。 - 脚本内禁 DDL。MySQL 的 DDL 会隐式提交事务,破坏"全成或全回滚"承诺,所以
mysql_script无条件拒 DDL——即使服务端开了 ddl 权限。DDL 单独用mysql_execute执行。 - 这些语句在任何工具里都不可用:SET、USE、GRANT、CALL、LOAD DATA、LOCK TABLES、BEGIN / COMMIT / ROLLBACK 等事务控制。跨库查询用
库名.表名限定,不要USE;需要事务用mysql_script,不要手写 BEGIN/COMMIT。 SELECT ... INTO OUTFILE/LOAD_FILE()被永久禁止,没有开关,不要尝试。- 只能访问白名单内的表。JOIN、子查询、CTE、
INSERT ... SELECT里涉及的每一张表都会被逐一校验,任何一张不在白名单整条拒。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · +13 lines · -107 tokens per session f779a6d09dda
- 2mo ago First seen · 117 lines · 187 tokens per session scan A 2ce2fac770e3
mysql-mcp is a skill published in the GitHub repository Kurok1/mcp-server-mysql (2 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 80 tokens to every session and 3,132 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
mysql-mcp compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mysql-mcpKurok1/mcp-server-mysql | Skill | 2 | 1mo ago | Apache-2.0 | A | 80 | Claude Code, Codex |
| create-prprisma/orm | Skill | 48k | yesterday | Apache-2.0 | A | 48 | Claude Code, Codex |
| schema-explorationlangchain-ai/deepagents | Skill | 31k | today | MIT | A | 57 | Claude Code, Codex |
| atlas-mssqlariga/atlas | Skill | 8.8k | 2d ago | Apache-2.0 | A | 163 | Claude Code |
| ha-data-storesshiwenwen/hope-agent | Skill | 1.9k | yesterday | MIT | A | 115 | Claude Code, Codex |
| nornicdb-cypher-queriesorneryd/NornicDB | Skill | 924 | today | MIT | A | 79 | Claude Code, Codex |
| volcengine-rds-postgresqlbytedance/agentkit-samples | Skill | 484 | yesterday | Apache-2.0 | A | 63 | Claude Code, Codex |