Supabase
MCP server for interacting with the Supabase platform
제작자가 쓴 설명(영어 원문)
Safe PostgreSQL migrations: schema drift, lock analysis, safe rewrites, data checksums. Read-only.
이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.
이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
SOURCE_DATABASE_URL, TARGET_DATABASE_URL, PGVOUCH_LLM비밀로 표시된 값은 내 계정의 열쇠예요. 절대 다른 사람과 공유하거나 채팅에 붙여 넣지 마세요.
필요한 것
어떤 앱을 쓰세요?
위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.
Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요
{
"mcpServers": {
"pgvouch": {
"command": "npx",
"args": [
"-y",
"pgvouch",
"mcp"
],
"env": {
"SOURCE_DATABASE_URL": "your-value",
"TARGET_DATABASE_URL": "your-value",
"PGVOUCH_LLM": "your-value"
}
}
}
}터미널에서 이 명령어를 실행하세요
claude mcp add pgvouch --env SOURCE_DATABASE_URL=your-value --env TARGET_DATABASE_URL=your-value --env PGVOUCH_LLM=your-value -- npx -y pgvouch mcp실행하기 전에 빈 값을 채워 주세요.
프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요
{
"mcpServers": {
"pgvouch": {
"command": "npx",
"args": [
"-y",
"pgvouch",
"mcp"
],
"env": {
"SOURCE_DATABASE_URL": "your-value",
"TARGET_DATABASE_URL": "your-value",
"PGVOUCH_LLM": "your-value"
}
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
프로젝트의 .vscode/mcp.json에 붙여 넣으세요
{
"servers": {
"pgvouch": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"pgvouch",
"mcp"
],
"env": {
"SOURCE_DATABASE_URL": "your-value",
"TARGET_DATABASE_URL": "your-value",
"PGVOUCH_LLM": "your-value"
}
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.
선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.
PGVOUCH_LLM env이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 7일 점검
레지스트리 이름이 GitHub 계정 Shubh-Sgr 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
입력해야 할 값: SOURCE_DATABASE_URL, TARGET_DATABASE_URL
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(0.4.4)은 34일 전 레지스트리에 올라왔어요.
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Node.js도 있어야 해요.
같은 카테고리에는: Supabase, MongoDB MCP Server, Elasticsearch MCP Server
같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.
카드 보는 법:★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
MCP server for interacting with the Supabase platform
MongoDB Model Context Protocol Server
MCP server for interacting with Elasticsearch
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
An MCP server + CLI that lets AI assistants safely inspect, plan and _prove_ PostgreSQL migrations. The LLM proposes; deterministic code decides.
Real output against the seeded demo databases (1M transactions, 2M ledger entries) with the target broken as in step 2 below. Typing is real-time; command run times are shortened (the verify run took 14.0 s).
Writing ALTER TABLE is the easy part of a database migration. The hard parts are:
CREATE INDEX on a busy table blocks every write until it finishes. A "1 ms" ALTER TABLE can still cause an outage by waiting in the lock queue.AI assistants now write migrations, but they hallucinate objects, ignore locks and can't prove anything. PgVouch gives them (and you) read-only tools that answer those four questions, and it wraps every AI suggestion in deterministic checks.
All numbers come from npm run eval against the seeded Docker databases. The full tables are in evals/.
| What | Result |
|---|---|
| Drift detection over 32 seeded scenarios (tables, views, functions, triggers, enums, extensions, RLS) | 100% precision, 100% recall (34 true positives, 0 false positives, 0 missed) |
| Exact differing rows found by checksum bisection | 100% of seeded row changes, 0 false rows |
| Rows fetched to find them | 311 rows instead of 6,079,997 (the rows in the mismatched tables, both sides) |
Lock mode predicted vs lock actually taken (read from pg_locks) | 36/36 statements, on PostgreSQL 13, 14, 15, 16 and 17 |
Table rewrite predicted vs actual rewrite (pg_class.relfilenode changed) | 35/35 statements |
| Sequence left behind its data after a copy (next INSERT would hit a duplicate key) | found 1/1, 0 false alarms in 10 checks |
| Rules-only migration plans that pass a shadow run on a real schema copy | 27/27 |
| LLM plans (local llama3.2, 3B), 17 drift scenarios of the first 21-scenario suite, *validator-only acceptance (v0.1.0)* | 5.9% valid on first try, 17.6% after one retry, 82.4% fell back to the rules plan; 0/3 accepted LLM plans passed the shadow run |
Application stall during the migration, measured on the 1M-row table with a probe query every ~10 ms (evals/results-rewrite.md):
| Migration | Original: max stall | PgVouch rewrite: max stall | Rewrite total time |
|---|---|---|---|
CREATE INDEX | 1.58 s | 47 ms | 2.1 s |
ADD FOREIGN KEY (2M rows) | 1.01 s | 49 ms | 1.2 s |
ADD CHECK | 440 ms | 63 ms | 0.85 s |
SET NOT NULL | 625 ms | 31 ms | 0.68 s |
ADD COLUMN ... NOT NULL DEFAULT gen_random_uuid() | 10.94 s | 964 ms | 108.7 s (batched backfill) |
ALTER COLUMN merchant_id TYPE bigint | 6.51 s | 93 ms | 28.0 s (includes re-creating its foreign key; +3 manual steps) |
What the LLM numbers show: a small local model is not reliable at migration planning. That's why PgVouch never trusts it. The validator rejected 14/17 plans (unparseable SQL, hallucinated or duplicate objects, blocking DDL). The 3 it accepted were *safe but incomplete*, and only the shadow run caught that (e.g. a missing index and a sequence left out when re-creating a dropped table). Deterministic rules plans passed all 17 (27/27 with the scenarios added later). Details: evals/results-llm.md.
What changed because of it: those numbers were measured when the validator alone decided. Now an LLM plan is accepted only if it passes the validator and a shadow run whose result matches the source exactly; a shadow failure is sent back to the LLM for one retry, then PgVouch falls back to the rules plan. So the 3 incomplete plans above would now be rejected. The LLM eval has not been re-run with the new pipeline yet, so there is no new number here.
The trade-off is visible: the rewrites that need a backfill take much longer in total, but the application keeps running. These are single runs on a laptop (Apple M1, 8 cores, Docker Desktop). Expect the absolute numbers to vary; the gap is the point.
flowchart LR
A["AI assistant (Claude Code, Cursor)"] -- "MCP (JSON-RPC, stdio)" --> S U["You (terminal)"] -- CLI --> S subgraph S["PgVouch core"] I["F1 introspect pg_catalog"] --> D["F2 diff (pure function)"] D --> P["F7 planner LLM + guardrail validator"] L["F5 lock analyzer (Postgres parser)"] --> R["F6 safe rewrites"] R --> P P --> SH["F10 shadow run (throwaway container)"] V["F3 chunked checksums"] --> B["F4 bisection"] P --> RC["F12 receipt (SHA-256)"] end S -- "read-only SQL" --> SRC[("source DB")] S -- "read-only SQL" --> TGT[("target DB")] P -. "structured facts only, no rows" .-> LLM["Ollama (local) or Gemini"]
Golden rule: the LLM never touches a database and never decides pass/fail. It proposes; the parser, the rules and the shadow run decide.
| # | Feature | How |
|---|---|---|
| F1 | Schema introspection | pg_catalog (not information_schema, which hides index methods, partial-index predicates and NOT VALID) |
| F2 | Drift detection | A pure diffSchemas(source, target) over tables, columns, indexes, constraints, sequences, views, functions, triggers (including disabled ones), enum types, extensions and row-level security: deterministic and sorted, with severity rules, and it never guesses renames |
| F3 | Data verification | md5(string_agg(md5(row::text) ORDER BY pk)) per primary-key chunk, inside a REPEATABLE READ snapshot with normalized session settings. Text keys are ordered byte-wise (COLLATE "C"), so servers with different collations agree. Also checks that every identity/serial sequence on the target is ahead of its data. On a target still being replicated to, --recheck looks at the differences again after a delay and reports only those that never catch up |
| F4 | Checksum bisection | Merkle-style: split the mismatched chunk at its median key and recurse only into halves whose hashes differ |
| F5 | Lock analyzer | libpg-query (Postgres' own parser, WASM) → rule table → risk from reltuples |
| F6 | Safe rewrites | CONCURRENTLY, NOT VALID + VALIDATE, UNIQUE ... USING INDEX, expand/contract, batched DO loops with COMMIT per batch |
| F7 | Guarded LLM planner | zod-checked JSON → validator (parses, allow-list, objects exist, no unsafe DDL) → shadow run (the result must match the source) → one retry with the errors → rules-only fallback |
| F8 | MCP server | 7 read-only tools over stdio |
| F9 | Eval suite | 32 drift/data scenarios, 36 lock statements with ground truth from Postgres, and a stall benchmark under load |
| F10 | Shadow runs | Copies the target's *schema* into a disposable container, applies the plan, and diffs the result against the source |
| F11 | Reversibility | Tags each step reversible / reversible-with-backfill / data-lossy and generates rollback SQL |
| F12 | Receipts | JSON of drift + verification + plan + shadow, with a SHA-256 over canonical (sorted-key) JSON |
| F13 | Lock-queue preflight | "Safe to run right now?": the locks each statement needs vs. live pg_locks + pg_stat_activity, using Postgres' full 8×8 lock conflict table |
| F14 | PR review action | pgvouch review --format markdown + a GitHub Action: lock analysis and safe rewrites of changed migrations as a job summary and one PR comment |
There are two ways to use PgVouch:
| Option A: npm package | Option B: clone the repo | |
|---|---|---|
| Best for | Your own databases, CI, or an AI assistant | Trying every feature on seeded demo databases, or contributing |
| Needs | Node 22 (or 20.12+) | Node 22 (or 20.12+) and Docker |
| Commands run as | pgvouch (or npx pgvouch ) | npm run cli -- |
1. Try it now, no database needed. Point it at any migration file:
npx pgvouch locks my_migration.sql --offline # the locks each statement takes, and the risk
npx pgvouch rewrite my_migration.sql --offline # a safe, non-blocking version of the same migration
No migration file handy? Create one: echo "CREATE INDEX idx_amount ON transactions (amount);" > my_migration.sql
2. Install it (optional: npx pgvouch works without installing):
npm install -g pgvouch
pgvouch --help
3. Point it at your databases. Create a read-only role on each database (the SQL is here), then put a .env file in the folder you run PgVouch from:
SOURCE_DATABASE_URL=postgres://pgvouch_ro:PASSWORD@staging-host:5432/your_db
TARGET_DATABASE_URL=postgres://pgvouch_ro:PASSWORD@prod-host:5432/your_db PGVOUCH_LLM=none # rules-only plans; set it to ollama to let a local LLM propose plans
Variables already set in your environment take precedence over .env. Then check that both connections are read-only:
pgvouch doctor # must say read_only=true and write privileges: none
4. Run it:
pgvouch diff # schema drift (exit code 1 if any)
pgvouch verify --rows # checksums + exact differing rows pgvouch verify --rows --recheck 3 # target still being replicated to: ignore rows in flight pgvouch locks my_migration.sql # lock impact per statement, with real table sizes pgvouch preflight my_migration.sql # would it have to wait for locks RIGHT NOW? pgvouch rewrite my_migration.sql # safe multi-step script pgvouch review --format markdown migrations/*.sql # PR-comment report (offline, used by the GitHub Action) pgvouch plan --no-llm # rules-only plan that makes target match source pgvouch plan # LLM plan (Ollama) behind guardrails pgvouch shadow # plan, then prove it on a throwaway container (needs Docker) pgvouch receipt --shadow # hashed audit record pgvouch receipt-verify pgvouch-receipt.json
locks --fail-on high exits with code 1, so it can gate a CI pipeline on risky migrations.
preflight answers a different question: not "what will this lock?" but "is anyone holding or waiting for a conflicting lock right now?". It lists the sessions it would queue behind (pid, user, application, state, transaction age; never their query text), and flags that CREATE INDEX CONCURRENTLY waits for every older transaction in the database. It exits with code 1 if the migration would wait. PgVouch never terminates sessions.
5. Also: use it from an AI assistant (npx -y pgvouch mcp), or review every migration pull request with the GitHub Action (step 4 there).
The repo includes two seeded Postgres databases, so you can try every feature without touching a real database. Requirements: Node 22 (or 20.12+) and Docker.
git clone https://github.com/Shubh-Sgr/pgvouch.git && cd pgvouch
npm in
앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요