QueryWeaver
An MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.
MySQL migration and query safety review for AI agents: locks, table copies, data loss, injection.
选择你使用的 AI 应用,然后复制设置。
通过 3/3 项检查 · 在你的电脑上运行 · ✓ 命令已检查 2026年11月14日
第一步:你用哪个 AI?
选择你用的应用,步骤会显示在下方。
可连接 Claude,但需要先准备
需要先在电脑上安装 Python (uv)(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
把这段话复制到 Claude 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。
请在这台电脑上为 Claude 安装 MCP server MySQL Audit,按顺序:1) 用 uv --version 检查是否有 uv。没有的话,请让我从 https://docs.astral.sh/uv/getting-started/installation/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "mysql-audit": { "command": "uvx", "args": [ "mysql-audit-ai-agent" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 MySQL Audit 的工具真的出现了。这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。
已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter
uv --versionMac:按 ⌘ + Space,输入 Terminal 后按 Enter
Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”
还没安装: uv 没有点选式安装程序。从 uv 官方页面复制适合你系统(macOS 或 Windows)的一行命令,粘贴到终端 · 不需要单独安装 Python,uv 会在需要时自动下载
装好后关掉终端再打开,重新运行同一条命令,应显示版本号: uv --version
安装一次,所有需要 uv 的工具都能用
SettingsDeveloperEdit Config
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}用 MySQL Audit 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Claude 说正在使用 MySQL Audit,或回答中出现 MySQL Audit 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同
ChatGPT 暂时无法连接 MySQL Audit
MySQL Audit 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器
A · 使用能连接 MySQL Audit 的应用
B · 数据库与数据集 类中能连接 ChatGPT 的其他服务器
从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的
可连接 Claude Code,但需要先准备
需要先在电脑上安装 Python (uv)(只需一次)
把这段话复制到 Claude Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。
请在这台电脑上为 Claude Code 安装 MCP server MySQL Audit,按顺序:1) 用 uv --version 检查是否有 uv。没有的话,请让我从 https://docs.astral.sh/uv/getting-started/installation/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):claude mcp add --scope user mysql-audit -- uvx mysql-audit-ai-agent 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 MySQL Audit 的工具真的出现了。这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。
已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter
uv --versionMac:按 ⌘ + Space,输入 Terminal 后按 Enter
Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”
还没安装: uv 没有点选式安装程序。从 uv 官方页面复制适合你系统(macOS 或 Windows)的一行命令,粘贴到终端 · 不需要单独安装 Python,uv 会在需要时自动下载
装好后关掉终端再打开,重新运行同一条命令,应显示版本号: uv --version
安装一次,所有需要 uv 的工具都能用
Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell
claude mcp add --scope user mysql-audit -- uvx mysql-audit-ai-agent应能看到 MySQL Audit 在列表中并显示已连接
用 MySQL Audit 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Claude Code 说正在使用 MySQL Audit,或回答中出现 MySQL Audit 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同
可连接 Cursor,但需要先准备
需要先在电脑上安装 Python (uv)(只需一次)
把这段话复制到 Cursor 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。
请在这台电脑上为 Cursor 安装 MCP server MySQL Audit,按顺序:1) 用 uv --version 检查是否有 uv。没有的话,请让我从 https://docs.astral.sh/uv/getting-started/installation/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "mcpServers": { "mysql-audit": { "command": "uvx", "args": [ "mysql-audit-ai-agent" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 MySQL Audit 的工具真的出现了。这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。
已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter
uv --versionMac:按 ⌘ + Space,输入 Terminal 后按 Enter
Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”
还没安装: uv 没有点选式安装程序。从 uv 官方页面复制适合你系统(macOS 或 Windows)的一行命令,粘贴到终端 · 不需要单独安装 Python,uv 会在需要时自动下载
装好后关掉终端再打开,重新运行同一条命令,应显示版本号: uv --version
安装一次,所有需要 uv 的工具都能用
用 MySQL Audit 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Cursor 说正在使用 MySQL Audit,或回答中出现 MySQL Audit 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同
可连接 VS Code,但需要先准备
需要先在电脑上安装 Python (uv)(只需一次)
把这段话复制到 VS Code 的对话里。AI 会先检查电脑,告诉你要改哪个文件,并且每次都等你同意。
请在这台电脑上为 VS Code 安装 MCP server MySQL Audit,按顺序:1) 用 uv --version 检查是否有 uv。没有的话,请让我从 https://docs.astral.sh/uv/getting-started/installation/ 安装,不要自己安装。2) 只使用这份配置(已通过 PopNx MCP 检查):{ "servers": { "mysql-audit": { "type": "stdio", "command": "uvx", "args": [ "mysql-audit-ai-agent" ] } } } 3) 告诉我要修改的文件完整路径或要运行的命令,等我同意。4) 不需要密钥。5) 按约定执行,然后确认 MySQL Audit 的工具真的出现了。这段话不包含你的密钥。如果需要密钥,AI 会请你自己粘贴到文件或应用的输入框里。
已经装好了吗?先检查 · 打开终端,输入这条命令后按 Enter
uv --versionMac:按 ⌘ + Space,输入 Terminal 后按 Enter
Windows:打开“开始”菜单,输入 Windows PowerShell,然后选“打开”
还没安装: uv 没有点选式安装程序。从 uv 官方页面复制适合你系统(macOS 或 Windows)的一行命令,粘贴到终端 · 不需要单独安装 Python,uv 会在需要时自动下载
装好后关掉终端再打开,重新运行同一条命令,应显示版本号: uv --version
安装一次,所有需要 uv 的工具都能用
用 MySQL Audit 告诉我你能帮我做什么,然后做一件给我看✓ 如果 VS Code 说正在使用 MySQL Audit,或回答中出现 MySQL Audit 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同
Claude Code
claude mcp add --scope user mysql-audit -- uvx mysql-audit-ai-agentClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"mysql-audit": {
"type": "stdio",
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。
在你的电脑上运行,适用于
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月15日
注册名称已通过 GitHub 账户 jimmyjan0824 验证,该账户拥有此仓库
代码最后更新于17天前
使用 Apache-2.0
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
尚未检查
提问、分享技巧或报告无法使用。按“有帮助”数量排序。
还没有评价
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 3 项适用的基础检查中通过了 3 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于17天前,最新版本(0.3.3)于17天前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。
同一分类中有:QueryWeaver, Supabase, Neon, DBCode, Keboola MCP
同一分类、其他作者、命令已通过检查。官方的排在前面,再按星标排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
An MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.
Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
English | 繁體中文
MySQL schema-change safety review for AI coding agents.
Before Claude Code, Cursor or another agent runs a migration, it sends the SQL to review_migration and gets back a verdict (safe / review / block) plus, for every risk, the line, what will happen in production, and a safe way to write it. The checks are deterministic rules written from DBA experience, not another LLM guess.
Status: beta. Every rule about server behavior is checked against real MySQL in CI. DBAs: try the trial kit and report wrong results.
Contents: Why · What it checks · Quick start · Use with an AI agent (MCP) · Command line · Rules · Inputs that make results exact · Pre-deploy checks · Rollbacks and backups · GitHub Action · Version and upgrades · Troubleshooting · DBA trial kit · Development
AI coding agents write and run migrations quickly, but the SQL that looks correct is often the SQL that takes production down: an ALTER TABLE that silently copies a 25-million-row table and blocks writes, a column type change that forces a full rebuild, a DROP COLUMN the previous release still reads, an UPDATE without WHERE, a backfill that leaves every replica minutes behind. These are the incidents a DBA catches in review, and an agent has no DBA in the loop.
MySQL Audit puts that review in front of the agent:
block it rewrites and reviews again.ALGORITHM=INSTANT, gh-ost, batching by primary key, expand and contract).ALGORITHM / LOCK), version-dependent INSTANT changes, metadata-lock pile-ups, foreign keys, unique keys, large tables, free disk for rebuilds, data loss from DROP / TRUNCATE / RENAME, missing rollbacks and backups.UPDATE / DELETE without WHERE, unbatched backfills, LIMIT without ORDER BY, statements that stop replication (sql_log_bin = 0).WHERE / JOIN columns no index can use.utf8mb3.GRANTs.It is used in three ways:
| Surface | Who uses it | What it does |
|---|---|---|
| MCP server | Claude Code, Cursor, Windsurf, Claude Desktop and other agents | The agent calls review_migration, review_query, review_code and preflight_checks on its own |
mysql-audit CLI | Developers and DBAs | Review files by hand or in any CI; exit code 0 / 1 / 2 |
| GitHub Action | Teams | Reviews each pull request's migrations, annotates lines, comments, fails on block, supports DBA approval |
You need Python 3.10 or later, or uv (uv brings its own Python).
1. Review a file from the command line
pip install mysql-audit-ai-agent # in a virtual environment
mysql-audit migration.sql
uvx --from mysql-audit-ai-agent mysql-audit migration.sql
Example output:
trial/migrations/12_drop_column.sql: BLOCK (2 statements)
line 5 [block] L07: This statement drops column coupon_code. fix: Use expand and contract: ship code that no longer uses the column or table first, take a backup, then drop it in a later release. ... line 5 [warn] L18: This migration deletes data, and the file does not say where the backup is. fix: Back up what is deleted first ... and note it in the file: -- backup: s3://bucket/orders_2026-10-28.sql.gz
2. Let your AI agent use it (Claude Code)
claude mcp add mysql-audit --scope user -- uvx mysql-audit-ai-agent@latest
From then on, Claude reviews migrations before running them. Other agents: see Use with an AI agent.
3. Review every pull request with the GitHub Action.
Requires uv. The server runs locally over stdio; your SQL never leaves your machine.
Claude Code
claude mcp add mysql-audit --scope user -- uvx mysql-audit-ai-agent@latest
--scope user makes it available in every project. --scope project writes it to the project's .mcp.json instead, so everyone who clones the repo gets it. Check that it is connected with claude mcp list (it should show mysql-audit ... ✓ Connected), or type /mcp inside Claude Code to see the tools. Then ask Claude to review a migration, or just let it run one: it calls review_migration on its own. Remove it with claude mcp remove mysql-audit.
`/mcp` says `Failed to reconnect to mysql-audit: ENOENT`? Claude Code cannot find the uvx command: uv is not installed, or it is installed in a folder that is not on the PATH Claude Code was started with.
which uvx # where is uvx?
curl -LsSf https://astral.sh/uv/install.sh | sh # if not found: install uv, then open a new terminal claude mcp remove mysql-audit # re-add it with the full path to uvx claude mcp add mysql-audit --scope user -- "$(which uvx)" mysql-audit-ai-agent@latest claude mcp list # should show mysql-audit ... ✓ Connected
Restart Claude Code (or reconnect in /mcp) afterwards. The first start downloads the package and can take a few seconds.
Cursor, Windsurf, Claude Desktop and other MCP clients (mcp.json / claude_desktop_config.json):
{
"mcpServers": { "mysql-audit": { "command": "uvx", "args": ["mysql-audit-ai-agent@latest"] } } }
| Client | Config file |
|---|---|
| Cursor | ~/.cursor/mcp.json, or .cursor/mcp.json in the project |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
Restart the client after editing. If a desktop app reports spawn uvx ENOENT, it cannot find uvx: replace "uvx" with the full path from which uvx (Windows: where uvx).
Claude Desktop, one click: download mysql-audit.mcpb from the latest release and open it.
**Running
uvx mysql-audit-ai-agentin a terminal prints nothing and seems to hang. That is
expected:** it is the MCP server, waiting for an MCP client to talk to it over stdin. Press
Ctrl+C to leave. Put the command in your client's MCP config as above, and use
mysql-audit(see Command line) to review files yourself, for example
uvx --from mysql-audit-ai-agent mysql-audit migration.sql.
| Tool | Arguments | Returns |
|---|---|---|
review_migration | sql, optional schema, stats, mysql_version, free_disk_gb, rollback_sql | Verdict and findings for DDL, migration scripts and bulk writes |
review_query | sql, optional schema, stats, mysql_version | Verdict and findings for queries the application will run |
review_code | code | SQL injection findings in application source |
preflight_checks | sql, optional mysql_version | Pre-deploy SQL to run on the primary |
explain_rule | rule_id (e.g. L02) | Why the rule matters and a safe example |
list_rules | Every rule with its id, title and default severity |
Arguments the call leaves out are read from .mysql-audit.toml. Example prompts to try: "Add a nickname column to users", "Drop the note column from orders", "Check this Python for SQL injection: cur.execute(f\"... {email}\")", "Explain mysql-audit rule L03".
In our agent evaluation Claude Code called the tool on its own in 10 of 10 migration tasks, with no extra prompt.
mysql-audit [files ...] [--schema FILE] [--stats FILE] [--mysql-version VERSION]
[--free-disk-gb GB] [--config FILE] [--format text|json] [--color auto|always|never] [--code] [--preflight] [--version]
| Option | Meaning | ||
|---|---|---|---|
files | SQL files to review; reads stdin when omitted | ||
--schema FILE | Current CREATE TABLE statements (e.g. mysqldump --no-data); makes column and index checks exact | ||
--stats FILE | JSON table sizes, {"orders": 25000000} or {"orders": {"rows": ..., "data_bytes": ..., "index_bytes": ...}}; enables the large-table rules | ||
--mysql-version V | Target server, e.g. 8.0.28, 8.4.3, 5.7.44, aurora-3.04 (default: 8.0.29 or later) | ||
--free-disk-gb GB | Free space on the server's data volume; with byte sizes enables L17 | ||
--config FILE | Settings file (default: the nearest .mysql-audit.toml) | ||
--format json | Machine-readable output | ||
| `--color auto\ | always\ | never` | Color text output: [block] lines red, [warn] lines yellow, the verdict red / yellow / green. auto (default) colors only on a terminal and honors NO_COLOR / FORCE_COLOR |
--code | The files are application code: check for SQL injection | ||
--preflight | Print pre-deploy SQL for these migrations instead of reviewing them | ||
--version | Print the installed version |
Examples:
mysql-audit db/migrate/20261027_add_index.sql --schema schema.sql --stats stats.json
mysql-audit db/migrate/*.sql --mysql-version 8.0.28 --format json echo "UPDATE users SET status = 0;" | mysql-audit # from stdin mysql-audit --code app/models/user.py # SQL injection check mysql-audit migration.sql --preflight > preflight.sql # pre-deploy checks
Exit code: 0 = safe, 1 = review, 2 = block, so it can gate any CI.
Verdicts: block means do not run it as written; review means it can run but a person should read the findings first; safe means no findings at warn level or above. Each finding has a severity (block, warn, info), a line number, the impact and a fix.
| ID | Checks | Default | Needs |
|---|---|---|---|
| L01 | DDL without explicit ALGORITHM / LOCK; ALGORITHM=COPY, LOCK=SHARED/EXCLUSIVE | warn / block | |
| L02 | Column changes that force a table copy: type change, VARCHAR shrink or crossing 255 bytes, ENUM reorder, charset conversion, dropping the PK, adding a STORED generated column | block | schema for exact answers |
| L03 | Row-touching DDL on a large table: use gh-ost / pt-online-schema-change | warn | stats |
| L04 | DDL without a short SET SESSION lock_wait_timeout (metadata-lock pile-up) | warn | |
| L05 | ADD FOREIGN KEY while foreign_key_checks=1 (COPY only) | block | |
| L06 | UPDATE / DELETE / INSERT ... SELECT over a large table in one transaction (replication lag) | warn | stats |
| L07 | DROP / TRUNCATE / RENAME of