80 rules to catch dangerous PostgreSQL migrations before production. Lock analysis + auto-fix.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
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
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
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.
On Windows in Git Bash, MSYS rewrites paths inside the mount flag, so use the Windows-form working directory instead:
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.
| 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.
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.
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):
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.
| Input | Description | Default |
|---|---|---|
migration-path | Glob for SQL files (required) | |
github-token | Token for PR comments | ${{ github.token }} |
pg-version | Target PostgreSQL version | 17 |
fail-on | critical, warning, irreversible, never | critical |
exclude | Comma-separated rule IDs to skip | |
config-file | Path to .migrationpilotrc.yml | auto-detected |
database-url | Connection for production context | |
license-key | Org plan license key |
Outputs: risk-level, violations, sarif-file.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/migrationpilot)<a href="https://allmcps.com/mcp/migrationpilot"><img src="https://allmcps.com/api/badge/migrationpilot?style=directory" alt="Migrationpilot on AllMCPs" /></a>