Supabase
server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
MySQL migration and query safety review for AI agents: locks, table copies, data loss, injection.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด 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/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"mysql-audit": {
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"mysql-audit": {
"type": "stdio",
"command": "uvx",
"args": [
"mysql-audit-ai-agent"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 8 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub jimmyjan0824 ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 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
server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ 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
ตัดมาแค่ช่วงต้น อ่านต่อใน repo