MySQL Audit
개요
제작자가 쓴 설명(영어 원문)
MySQL migration and query safety review for AI agents: locks, table copies, data loss, injection.
PopNx MCP의 세 기둥
이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.
- 사용자 의견i아직 리뷰가 없어요리뷰는 다음 단계에서 계정 기능과 함께 열려요
- 우리의 기본 점검i1개 중 1개 통과공개된 정보로 점검했으며, 코드는 아직 스캔하지 않았어요
- 사용 정도i아주 새로움↓ 64/주 · ★ –
할 수 있는 일
이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.
- 연결 방식: 내 컴퓨터에서 실행
- 전송 방식: stdio
- 카테고리: 데이터베이스 및 데이터셋
설치
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
설치하기 전에
- 기본 점검: 1개 중 1개 통과
- 내 컴퓨터에서 내 사용자 계정의 권한(파일, 네트워크, 앱)으로 실행돼요.
- 레지스트리에 입력해야 할 키가 나와 있지 않아요.
필요한 것
- PyPIPython의 uv 설치(uvx 명령어용)
어떤 앱을 쓰세요?
위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.
Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}터미널에서 이 명령어를 실행하세요
claude mcp add mysql-audit -- uvx mysql-audit-ai-agent또는 설정을 직접 복사하기
프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
또는 설정을 직접 복사하기
프로젝트의 .vscode/mcp.json에 붙여 넣으세요
{
"servers": {
"mysql-audit": {
"type": "stdio",
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.
선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.
이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
할 수 있는 일
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
기본 점검i
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 8일 점검
- ✓ 통과
제작자와 저장소 일치
레지스트리 이름이 GitHub 계정 jimmyjan0824 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
- … 아직 점검 안 함
계속 관리되고 있음
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
- … 아직 점검 안 함
라이선스 있음
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
- – 해당 없음
엔드포인트 응답
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
- – 해당 없음
OAuth로 로그인
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
- … 아직 점검 안 함
도구 설명에 숨겨진 지시 없음
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
데이터베이스 및 데이터셋 카테고리의 다른 서버와 비교i
- 이 카테고리의 다른 서버 1144개 중 0%보다 스타가 많아요
- 이 카테고리의 다른 서버 1144개 중 77%보다 최근에 레지스트리에 공개됐어요
- 기본 점검 결과가 이 카테고리의 다른 서버 1144개 중 100%와 같거나 더 좋아요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
자주 묻는 질문
MySQL Audit, 안전한가요?
해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
어떤 키나 코드가 필요한가요?
레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.
내 컴퓨터에서 실행되나요, 클라우드에서 실행되나요?
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
아직 관리되고 있나요?
GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(0.3.3)은 10일 전 레지스트리에 올라왔어요.
어떤 앱에서 쓸 수 있나요?
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Python (uv)도 있어야 해요.
대신 쓸 수 있는 건 뭐가 있나요?
같은 카테고리에는: Supabase, MongoDB MCP Server, Elasticsearch MCP Server
대안
같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.
카드 보는 법:↓ 주간 다운로드i★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
제작자의 README
README 열기
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
mysql_audit_ai_agent
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
Why
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:
- Before it runs, not after. The agent calls the review tool before executing a migration, query or SQL-building code. On
blockit rewrites and reviews again. - Deterministic. The same SQL always gets the same verdict. Each rule that depends on server behavior is tested against real MySQL 5.7, 8.0 and 8.4 in CI.
- Actionable. Every finding has the line, the production impact and a concrete fix (for example
ALGORITHM=INSTANT, gh-ost, batching by primary key, expand and contract). - Local and private. It never connects to your database and runs entirely on your machine. Your SQL and data never leave it.
What it checks
- Migrations and DDL: table copies and write locks (Online DDL
ALGORITHM/LOCK), version-dependent INSTANT changes, metadata-lock pile-ups, foreign keys, unique keys, large tables, free disk for rebuilds, data loss fromDROP/TRUNCATE/RENAME, missing rollbacks and backups. - Data changes:
UPDATE/DELETEwithoutWHERE, unbatched backfills,LIMITwithoutORDER BY, statements that stop replication (sql_log_bin = 0). - Queries:
WHERE/JOINcolumns no index can use. - Schema design: tables without a primary key, auto-increment columns that will overflow,
utf8mb3. - Security: SQL injection in application code (Python, JS/TS, PHP, Go, Java) and dangerous
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 |
Quick start
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
or without installing anything, with uv:
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.
Use with an AI agent (MCP)
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.
Tools
| 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.
Command line
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.
Rules
| 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
앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요