ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

MySQL Audit

โดย jimmyjan0824รุ่น 0.3.3i★ –iรันบนเครื่อง
ชื่อใน registryio.github.jimmyjan0824/mysql-audit

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

MySQL migration and query safety review for AI agents: locks, table copies, data loss, injection.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: ฐานข้อมูลและชุดข้อมูล

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "mysql-audit": {
      "command": "uvx",
      "args": [
        "mysql-audit-ai-agent"
      ]
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add mysql-audit -- uvx mysql-audit-ai-agent

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "mysql-audit": {
      "command": "uvx",
      "args": [
        "mysql-audit-ai-agent"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "mysql-audit": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mysql-audit-ai-agent"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 8 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub jimmyjan0824 ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด ฐานข้อมูลและชุดข้อมูลi

  • ดาวมากกว่า 0% ของอีก 1144 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 77% ของอีก 1144 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 1144 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

MySQL Audit ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.3.3) เข้า registry 10 วันที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Supabase, MongoDB MCP Server, Elasticsearch MCP Server

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:↓ ดาวน์โหลดต่อสัปดาห์i★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Supabase

server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ

โดย supabaseใช้กันมาก↓ 235.4K/สัปดาห์★ 3Kอัปเดต เมื่อวานซืน

บนเครื่องหรือคลาวด์✓ supabase.com

MongoDB MCP Server

MongoDB Model Context Protocol Server

โดย mongodb-jsใช้กันมาก↓ 157.1K/สัปดาห์★ 1.2Kอัปเดต 3 วันที่ผ่านมา

รันบนเครื่อง

Elasticsearch MCP Server

MCP server for interacting with Elasticsearch

โดย cr7258กำลังโต↓ 2.7K/สัปดาห์★ 315อัปเดต 14 เดือนที่ผ่านมา

รันบนเครื่อง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ 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 block it 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 from DROP / TRUNCATE / RENAME, missing rollbacks and backups.
  • Data changes: UPDATE / DELETE without WHERE, unbatched backfills, LIMIT without ORDER BY, statements that stop replication (sql_log_bin = 0).
  • Queries: WHERE / JOIN columns 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:

SurfaceWho uses itWhat it does
MCP serverClaude Code, Cursor, Windsurf, Claude Desktop and other agentsThe agent calls review_migration, review_query, review_code and preflight_checks on its own
mysql-audit CLIDevelopers and DBAsReview files by hand or in any CI; exit code 0 / 1 / 2
GitHub ActionTeamsReviews 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"] } } }

ClientConfig 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-agent in 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
ToolArgumentsReturns
review_migrationsql, optional schema, stats, mysql_version, free_disk_gb, rollback_sqlVerdict and findings for DDL, migration scripts and bulk writes
review_querysql, optional schema, stats, mysql_versionVerdict and findings for queries the application will run
review_codecodeSQL injection findings in application source
preflight_checkssql, optional mysql_versionPre-deploy SQL to run on the primary
explain_rulerule_id (e.g. L02)Why the rule matters and a safe example
list_rulesEvery 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]

OptionMeaning
filesSQL files to review; reads stdin when omitted
--schema FILECurrent CREATE TABLE statements (e.g. mysqldump --no-data); makes column and index checks exact
--stats FILEJSON table sizes, {"orders": 25000000} or {"orders": {"rows": ..., "data_bytes": ..., "index_bytes": ...}}; enables the large-table rules
--mysql-version VTarget server, e.g. 8.0.28, 8.4.3, 5.7.44, aurora-3.04 (default: 8.0.29 or later)
--free-disk-gb GBFree space on the server's data volume; with byte sizes enables L17
--config FILESettings file (default: the nearest .mysql-audit.toml)
--format jsonMachine-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
--codeThe files are application code: check for SQL injection
--preflightPrint pre-deploy SQL for these migrations instead of reviewing them
--versionPrint 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

IDChecksDefaultNeeds
L01DDL without explicit ALGORITHM / LOCK; ALGORITHM=COPY, LOCK=SHARED/EXCLUSIVEwarn / block
L02Column 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 columnblockschema for exact answers
L03Row-touching DDL on a large table: use gh-ost / pt-online-schema-changewarnstats
L04DDL without a short SET SESSION lock_wait_timeout (metadata-lock pile-up)warn
L05ADD FOREIGN KEY while foreign_key_checks=1 (COPY only)block
L06UPDATE / DELETE / INSERT ... SELECT over a large table in one transaction (replication lag)warnstats

| L07 | DROP / TRUNCATE / RENAME of

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx