Supabase
server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Find and fix drift between Supabase environments: schema, RLS, roles, auth, storage and more.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"supaforge": {
"command": "npx",
"args": [
"-y",
"@akal/supaforge",
"mcp"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add supaforge -- npx -y @akal/supaforge mcpวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"supaforge": {
"command": "npx",
"args": [
"-y",
"@akal/supaforge",
"mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"supaforge": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@akal/supaforge",
"mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub akalsoftware ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.0.41) เข้า registry วันนี้
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Node.js ในเครื่องด้วย
ในหมวดเดียวกันมี Supabase, MongoDB MCP Server, Elasticsearch MCP Server
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
server ทางการของ Supabase ให้ AI สร้างตาราง ถามข้อมูล และดูการตั้งค่าโปรเจกต์ในฐานข้อมูล Supabase ของคุณ
MongoDB Model Context Protocol Server
MCP server for interacting with Elasticsearch
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
Diff and sync your Supabase environments.
SupaForge compares two Supabase projects (dev and prod, say) across everything that makes up a project, not just the schema. It reports every difference and makes the target match the source. Fixes run in dependency order, in one transaction, and can be proved on a throwaway copy before anything changes. With a single project, it snapshots, restores and clones it.
--apply, and anything that loses data or opens up access also needs --allow-destructive. A failed apply leaves the target exactly as it was.--prove rehearses the migration and refuses to apply one that wouldn't reproduce the source or would lose rows.Built by Akal.
npm install -g @akal/supaforge
supaforge init # create supaforge.config.json supaforge diff # what has drifted? supaforge diff --detail # with the SQL supaforge diff --apply # fix the target
Everything that writes previews first. Add --apply to make it happen.
| npm | npm install -g @akal/supaforge, or run it with npx @akal/supaforge |
| Homebrew | brew install akalsoftware/tap/supaforge |
| Docker | docker run --rm -v "$PWD:/work" ghcr.io/akalsoftware/supaforge diff |
| GitHub Actions | akalsoftware/supaforge-action — see CI |
| VS Code and its forks | The SupaForge extension: commands, and the MCP server for the editor's agent. Each release carries it as a .vsix |
| Cursor, VS Code, Claude | One-click installs of the MCP server — see MCP |
It needs Node.js 20 or newer. DBDiff, its diff engine, comes with it as a native binary for your platform, so there is nothing else to install. The Docker image needs nothing at all, and carries the PostgreSQL client tools --prove uses; pass connection strings with -e, and mount the project at /work.
| Check | What it reads | Fixed with |
|---|---|---|
| Schema | @dbdiff/cli: every schema you own | SQL |
| Reference data | Rows of the tables in checks.data.tables | SQL |
| RLS policies | pg_policies, compared by meaning, not text | SQL |
| RLS coverage | Tables in the target with RLS off (target only) | SQL, opt-in |
| Edge Functions | Management API, Studio, or a functions directory | Deploy command |
| Storage | Buckets and their policies (objects are never copied) | API and SQL |
| Auth config | Management API, or GoTrue on self-hosted | API (hosted) |
| Cron jobs | cron.job | SQL |
| Queues | Supabase Queues (pgmq.meta), created and dropped through pgmq | SQL |
| Partition sets | pg_partman registrations (part_config), made with create_parent | SQL |
| Webhooks | Triggers calling supabase_functions.http_request | SQL |
| Realtime | Publications, and policies on realtime.messages | SQL |
| Vault | Secret names and descriptions (values can't be read) | Command to run |
| Extensions | pg_extension | SQL |
| Migration history | Local migration files against supabase_migrations (target only) | SQL, opt-in |
| Roles and grants | Custom roles, and grants on tables, views, sequences and functions, including anon, authenticated, service_role | SQL |
The schema check covers tables, columns, keys, indexes, partitions, views, materialized views, functions, aggregates, triggers, event triggers, rules, sequences, enums, composite and range types, domains, casts, extended statistics, text search configurations and dictionaries, foreign servers, user mappings and foreign tables, policies, default privileges, replica identity, statistics targets, extensions and comments. A renamed column, table or sequence is renamed, keeping its rows, rather than dropped and created again. It runs in every schema except Supabase's own (auth, storage, and so on) and those in ignoreSchemas. Objects owned by an extension belong to it and aren't compared. Objects of a kind it doesn't compare, such as operator classes, are named under the check so you can look at them by hand; they aren't counted as drift.
A check that can't run, for example without API credentials, says so and why. It's never reported as a clean pass.
supaforge init Create a config interactively
supaforge diff Report drift (alias: hukam) supaforge sync Alias for diff --apply
supaforge snapshot --apply Capture an environment's structure and configuration supaforge restore --apply Rebuild a database from a snapshot or migrations supaforge clone --apply Copy a remote database to a local one
supaforge migrate create Write a migration file from the current drift supaforge migrate list Local migrations, applied and pending supaforge migrate run --apply Run pending migrations supaforge migrate baseline --apply Mark migrations applied without running them
supaforge report Recent runs, from a local log supaforge mcp MCP server for AI agents supaforge help Every flag, e.g. help diff
Useful diff flags:
| Flag | Does |
|---|---|
--check=rls / --skip=storage | One check, or all but some (--skip repeats) |
--tables=orders,items / --exclude-tables='*_log' | Scope the schema and data checks |
--only= | Apply only these findings (ids come from --json, globs allowed) |
--dry-run | Print the fixes in the order they'd run, run nothing |
--prove | Rehearse the fixes on a throwaway copy first |
--source-dir | Compare a directory of schema files (such as supabase/schemas) with the target instead of a source database |
--allow-destructive | Also apply drops and deletes |
--apply-posture | Also apply the target-only checks' fixes |
--no-transaction | Apply fix by fix, keeping what works |
--no-snapshot | Read each query on its own. By default each database is read as of one instant, so a change made while the scan runs is seen by all of it or none; as with pg_dump, what it reads stays locked until the scan ends |
--json / --ci | Machine-readable output; CI annotations and exit codes |
diff, snapshot, restore, clone and migrate run write nothing without --apply.--allow-destructive. migrate run uses the same gate.supaforge diff --dry-run # the plan, in order
supaforge diff --apply --prove # rehearse, then apply supaforge diff --apply --only='schema-create-*'
RLS coverage and migration history look at the target alone, so they report the same findings whichever pair you diff. They're scored separately (Posture score), don't set the exit code unless you pass --fail-on-posture, and their fixes apply only with --apply-posture, or when you name the check, as in --check=rls-coverage --apply. Applying them blindly would move the target away from the source.
supaforge snapshot --env=prod --apply # capture
supaforge snapshot --env=prod --migration --apply # and write what changed since the last one supaforge restore --env=local --from-snapshot=latest --apply supaforge clone --env=prod --apply # local copy, data included
A snapshot records a project's structure and configuration: schema, RLS policies, cron, webhooks, extensions, storage, auth, Edge Functions, reference data, Realtime, Vault names and grants. It is not a backup. It holds no rows beyond checks.data.tables, and no stored files. Its schema is written as SQL by pg_dump, which has to be at least as new as the server; without one the snapshot can still be diffed but not restored, and snapshot exits 1 unless --allow-schema-json-only says that is enough.
restore --from-snapshot puts back:
| Restored | Notes |
|---|---|
| Extensions, schema, RLS policies, cron jobs, webhooks, Realtime publications, grants | As SQL, in dependency order. Roles a policy or grant names are created first |
| Storage policies and buckets | Bucket rows are created when the target has a storage schema; files never are |
| Reference data | The rows of checks.data.tables, parents before children, sequences moved past the restored ids |
It can't put back auth config, Edge Functions (deploy them with supabase functions deploy), or Vault secret values. Each of these is named in the output.
--force clears the snapshot's own schemas first (never Supabase's) and puts back the triggers and policies outside them that depended on what it cleared. A restore or apply that looks likely to need more locks than the target allows in one transaction says so before it starts; --no-transaction commits as it goes instead.auth.users, a webhook, an extension the server doesn't ship, and everything that needs it.--json prints only JSON, for a preview too.clone copies a remote database into a local server with pg_dump and pg_restore (--schema-only to leave the rows behind). Extensions the local server has are installed first. Objects it couldn't restore are listed by cause. Afterwards the config's target points at the clone, so a bare diff --apply writes there rather than to the remote.
supaforge migrate create --name=add_orders # from the drift between source and target
supaforge migrate run --env=prod # preview supaforge migrate run --env=prod --apply
supabase/migrations (set checks.migrations.dir to change it). Applied versions are recorded in supabase_migrations.schema_migrations, the Supabase CLI'sตัดมาแค่ช่วงต้น อ่านต่อใน repo