MySQL Audit
Deterministic MySQL migration and query safety review for coding agents
- Platforms
- CLI, self-hosted
- Runs
- Locally
- Version
- 0.3.3
- Listing updated
- today
Similar MCP servers
About MySQL Audit
MySQL Audit is an MCP server for databases. It runs locally on your machine and is started by your AI client.
The review is rule-based rather than another model's opinion. The README says the checks come from DBA experience and that each rule depending on server behaviour is tested against real MySQL 5.7, 8.0 and 8.4 in CI. The same SQL always gets the same verdict: safe, review or block.
Findings point to the line, explain what will happen in production and suggest a safer form, such as ALGORITHM=INSTANT, gh-ost, batching by primary key or expand and contract. Typical catches include silent table copies that block writes, DROP COLUMN on a column the previous release still reads, UPDATE or DELETE without WHERE, unbatched backfills, missing indexes, auto-increment overflow and SQL injection in application code in Python, JS/TS, PHP, Go and Java.
It never connects to your database and runs entirely on your machine over stdio, started with uvx. The same engine is available as a mysql-audit command-line tool with exit codes and as a GitHub Action that annotates pull requests. The status is beta.
Install
Run in a terminal
claude mcp add mysql-audit -- uvx mysql-audit-ai-agentAdd to claude_desktop_config.json
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"mysql-audit": {
"type": "stdio",
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
Tools this server provides (4)
Taken from the project documentation; the running server may differ.
- review_migration
- Reviews migration SQL and returns a verdict with findings
- review_query
- Reviews a query
- review_code
- Reviews application code for SQL issues
- preflight_checks
- Runs pre-deploy checks
What it does
- Migration verdicts
- Returns safe, review or block with a line-level reason for each risk.
- Safer rewrites
- Each finding includes a concrete fix such as batching or expand and contract.
- Query and code review
- Flags unindexed WHERE and JOIN columns and SQL injection in application code.
- Local and private
- Never connects to a database; SQL stays on your machine.
- CLI and CI
- A mysql-audit command with exit codes 0, 1 and 2 works in any pipeline.
- GitHub Action
- Reviews migrations in each pull request, annotates lines and can require DBA approval.
Good for
- Check an ALTER TABLE before an agent runs it on production
- Stop an UPDATE or DELETE without WHERE
- Review a large backfill for replication lag
- Catch SQL injection in code an agent just wrote
- Gate pull request migrations in CI
Pricing
Pricing unknown
Distributed as a PyPI package; licence not published
More servers for the same service
MySQL Audit FAQ
Does it connect to my database?
No. It runs locally and never connects to your database, so SQL and data stay on your machine.
Which MySQL versions are covered?
Server-behaviour rules are tested against MySQL 5.7, 8.0 and 8.4 in CI.
How do I add it to Claude Code?
Run claude mcp add mysql-audit --scope user -- uvx mysql-audit-ai-agent@latest.
Is it production ready?
The README marks it as beta and invites DBAs to report wrong results.
Why does running it in a terminal seem to hang?
It is an MCP server waiting on stdin for a client; use the mysql-audit command to review files by hand.
How do I add MySQL Audit to Claude Code?
Run this command in your terminal: claude mcp add mysql-audit -- uvx mysql-audit-ai-agent
What are the best alternatives to MySQL Audit?
The closest alternatives to MySQL Audit are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.


