Supabase
MCP server for interacting with the Supabase platform
作者による説明(英語の原文)
112 rules that catch dangerous PostgreSQL migrations, plus a pass/fail gate to call before any DDL.
この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。
このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。
使っているAIアプリを選んで、設定をコピーしてください。
必要なもの
どのアプリを使っていますか?
上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。
Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます
{
"mcpServers": {
"migrationpilot": {
"command": "npx",
"args": [
"-y",
"migrationpilot"
]
}
}
}ターミナルでこれを実行します
claude mcp add migrationpilot -- npx -y migrationpilotプロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます
{
"mcpServers": {
"migrationpilot": {
"command": "npx",
"args": [
"-y",
"migrationpilot"
]
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
プロジェクトの .vscode/mcp.json に貼り付けます
{
"servers": {
"migrationpilot": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"migrationpilot"
]
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。
選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。
この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。
パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。
誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月6日にチェック
レジストリ名は、リポジトリを所有するGitHubアカウント mickelsamuel で確認済みです
このリポジトリはまだGitHubから読み取っていません
このリポジトリはまだGitHubから読み取っていません
これはパソコンで動くため、インターネット上のエンドポイントはありません
パソコンで動き、代わりにローカルの設定を使います
パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです
レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。
当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。
レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。
あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。
GitHubリポジトリの最終更新は–、最新バージョン(1.6.4)がレジストリに届いたのは24 日前です。
Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにNode.jsも必要です。
同じカテゴリには:Supabase, MongoDB MCP Server, Elasticsearch MCP Server
同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。
カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i
MCP server for interacting with the Supabase platform
MongoDB Model Context Protocol Server
MCP server for interacting with Elasticsearch
作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。
Block unsafe Postgres migrations before merge.
Local, deterministic analysis for PostgreSQL migrations. Uses PostgreSQL's parser, checks 112 rules, and exits non-zero in CI. No account required. MIT.
npx migrationpilot analyze migration.sql
Try it in your browser · GitHub Action · Documentation
| Tool | Strict detection | False positives |
|---|---|---|
| MigrationPilot | 31/33 (93.9%) | 1/17 (5.9%) |
| Squawk | 20/33 (60.6%) | 1/17 (5.9%) |
| pgfence | 25/33 (75.8%) | 3/17 (17.6%) |
56 labelled files. Author-built corpus. Tools pinned.
Methodology · Corpus · What MigrationPilot missed · Reproduce: pnpm build && node bench/run.mjs
-- migration.sql
ALTER TABLE users ADD CONSTRAINT users_email_unique UNIQUE (email);
$ migrationpilot analyze migration.sql
✗ MigrationPilot — RED Score: 80/100 migration.sql ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 1 statement · 2 critical · rollback GREEN
┌─────┬─────────────────────────────────────────────┬─────────────────────────┬────────┬────────────┐ │ # │ Statement │ Lock Type │ Risk │ Long lock? │ ├─────┼─────────────────────────────────────────────┼─────────────────────────┼────────┼────────────┤ │ 1 │ ALTER TABLE users ADD CONSTRAINT users_e... │ ACCESS EXCLUSIVE │ RED │ YES │ └─────┴─────────────────────────────────────────────┴─────────────────────────┴────────┴────────────┘
Violations:
✗ [MP004] CRITICAL (line 1) DDL statement acquires ACCESS EXCLUSIVE lock without a preceding SET lock_timeout. Without a timeout, this statement could block the lock queue indefinitely if it can't acquire the lock, causing cascading query failures.
Safe alternative: -- Set a timeout so DDL fails fast instead of blocking the queue SET lock_timeout = '5s'; ALTER TABLE users ADD CONSTRAINT users_email_unique UNIQUE (email) RESET lock_timeout;
Why: Without lock_timeout, if the table is locked by another query, your DDL waits indefinitely. All subsequent queries pile up behind it in the lock queue, causing cascading timeouts across your application. GoCardless enforces a 750ms lock_timeout for this reason. Docs: https://migrationpilot.dev/rules/mp004
✗ [MP027] CRITICAL (line 1) Adding UNIQUE constraint "users_email_unique" on "users" scans the entire table under ACCESS EXCLUSIVE lock. Create the index concurrently first, then use USING INDEX.
Safe alternative: -- Step 1: Create the unique index concurrently (non-blocking) CREATE UNIQUE INDEX CONCURRENTLY users_email_unique_idx ON users (...);
-- Step 2: Add the constraint using the pre-built index (instant) ALTER TABLE users ADD CONSTRAINT users_email_unique UNIQUE USING INDEX users_email_unique_idx;
Why: ALTER TABLE ADD CONSTRAINT UNIQUE builds a unique index while holding ACCESS EXCLUSIVE lock, blocking all reads and writes for the entire scan. Instead, create the unique index concurrently (non-blocking), then attach it as a constraint with USING INDEX. Docs: https://migrationpilot.dev/rules/mp027
Risk Factors: Lock Severity ██████████ 40/40 — ACCESS EXCLUSIVE (long-held) Rule Violations ████████░░ 80/100 — 2 critical
112 rules checked in 11ms
Exit code is 2. The Risk column combines what a statement's lock does with what the rules found in it, so a statement carrying a critical violation reads RED whatever its lock costs. The lock half of that is capped without a database connection — table size and query frequency need one. See Production context.
Install · AI coding agents · CI · What it checks · Beyond one file · Configuration · Output · Production context · Comparison · Pricing · Architecture · API
npx migrationpilot analyze migration.sql # no install
npm install -g migrationpilot # global
Node 22 or newer. The PostgreSQL parser ships compiled in, so there is nothing else to set up. Exit codes are the same everywhere: 0 clean, 1 warnings under --fail-on warning, 2 critical.
Packaged builds land with each release, including single-file executables for Linux, macOS and Windows on the release page for machines without Node. The Windows .exe is not code-signed, so SmartScreen and most browsers will warn about it on download — SHA256SUMS on the same release is how you check you got the file we published, not a signature.
brew install mickelsamuel/migrationpilot/migrationpilot
docker run --rm -v "$PWD:/work" ghcr.io/mickelsamuel/migrationpilot:1 analyze migration.sql
On Windows in Git Bash, MSYS rewrites paths inside the mount flag, so use the Windows-form working directory instead:
docker run --rm -v "$(pwd -W):/work" ghcr.io/mickelsamuel/migrationpilot:1 analyze migration.sql
Agents write migrations now. They are good at SQL and bad at knowing which statement takes an ACCESS EXCLUSIVE lock on a table with 40 million rows, and by then the outage has already happened.
MCP server. Seven tools, the important one being check_before_apply: a pass/fail gate the agent calls before it writes or runs DDL. It resolves your .migrationpilotrc.yml exactly like the CLI does, so its verdict is the verdict CI will give.
{
"mcpServers": { "migrationpilot": { "command": "npx", "args": ["migrationpilot-mcp"] } } }
| Tool | Purpose | |
|---|---|---|
check_before_apply | {sql, pgVersion?, configPath?} returns `{verdict: pass\ | fail, failOn, violations[], summary}` |
analyze_migration | Violations, risk score and lock analysis for one migration | |
analyze_migration_dir | Per-file results plus an aggregate for a whole folder | |
get_rule | What a rule reports, why it matters, whether it auto-fixes | |
suggest_fix | Auto-fixed SQL plus the violations that need a human | |
explain_lock | The lock one DDL statement takes and what it blocks | |
list_rules | The full catalogue |
Claude Code plugin. integrations/claude-code/ pairs a skill that tells Claude to check migrations with a PreToolUse hook that blocks the tool call when it doesn't. It fails open on purpose: a missing install, unparseable SQL, or a timeout lets the call through with a note on stderr, because a guardrail that breaks your workflow when it can't run gets uninstalled.
claude plugin install ./integrations/claude-code
Cursor and Copilot. Copy integrations/cursor/migrationpilot.mdc into .cursor/rules/, or paste integrations/copilot/copilot-instructions-snippet.md into .github/copilot-instructions.md. Both tell the agent when to run MigrationPilot and that suppressing a rule to get past a violation is the user's call, not the agent's.
# .github/workflows/migration-check.yml
name: Migration Safety Check on: [pull_request]
permissions: contents: read pull-requests: write
jobs: check: runs-on: ubuntu-latest steps:
Posts a report as a PR comment, fails the check on critical violations, and writes a SARIF file. To feed it into Code Scanning, add an upload step (needs Advanced Security on private repos):
- uses: github/codeql-action/upload-sarif@v3
if: always() with: sarif_file: migrationpilot-results.sarif
Without the permissions block the Action still runs. It warns, analyzes every file matching the glob instead of only the ones the PR changed, and skips the comment. The check verdict, the SARIF file and the inline annotations come from the analysis either way.
A migration the Action can't read or parse fails the check, since nothing analyzed it, and the failure names the file and the parser's error. Files that aren't plain SQL, like ones with psql meta-commands or template placeholders, go under ignore in the config. With fail-on: never they're reported and the check passes.
The Action reads the same config file as the CLI, so ignore, rules, failOn, pgVersion and extends all apply there. An input you set in the workflow wins over the config. With an Org license key, so do the config's policy block and audit log, and the policy wins over the inputs: exclude can't drop a required rule, and a blocked statement fails the check even under fail-on: never.
| Input | Description | Default |
|---|---|---|
migration-path | Glob for SQL files, or a directory for every .sql file under it (required) | |
github-token | Token for PR comments | ${{ github.token }} |
pg-version | Target PostgreSQL version | config pgVersion, else 17 |
fail-on | critical, warning, irreversible, never | config failOn, else critical |
exclude | Comma-separated rule IDs to skip | |
config-file | Path to the config file | nearest .migrationpilotrc.yml |
database-url | Connection for production context | |
license-key | Org plan key from a secret. Turns on the config's policy block and audit log; every rule runs without it | MIGRATIONPILOT_LICENSE_KEY env |
Outputs: risk-level, violations, sarif-file.
migrationpilot hook install writes a plain git hook and is Husky-aware. With the pre-commit framework instead:
repos:
Clean files print nothing. Only migrations with violations are reported.
If pre-commit install answers Cowardly refusing to install hooks with 'core.hooksPath' set, something else already owns your hooks directory — Husky sets it. Check with git config core.hooksPath, then either git config --unset-all core.hooksPath and let pre-commit manage the hooks, or keep Husky and run migrationpilot hook install, which appends to .husky/pre-commit instead of fighting it.
include:
migrationpilot: variables: MIGRATIONPILOT_PATH: db/migrate
Runs on merge requests that touch migrations, keeps the JSON report as an artifact, and anno
冒頭だけを表示しています。続きはリポジトリで読めます