Migrationpilot logo

Migrationpilot

Analyze PostgreSQL migrations through seven MCP tools for rule violations, lock risks, fixes, and pre-apply checks.

Install Migrationpilot

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "migrationpilot": {
      "command": "npx",
      "args": [
        "-y",
        "migrationpilot"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

The migrationpilot MCP server exposes seven tools for analyzing PostgreSQL migration SQL before it is applied. It checks migrations against 112 rules, reports violations and risk scores, explains DDL locks, and can suggest automatic fixes. Use it when an AI coding agent needs a pass/fail safety gate aligned with MigrationPilot CLI and CI results.

Use cases

  • Gate AI-generated PostgreSQL DDL before applying it
  • Review migration files for lock and rule violations
  • Explain which locks a DDL statement can acquire
  • Generate safer SQL alternatives for supported findings

Key features

  • Seven MCP analysis and safety tools
  • 112 PostgreSQL migration rules
  • Pass/fail pre-apply checking
  • Lock analysis for DDL statements
  • Automatic fix suggestions
  • Single-file and directory analysis

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

6/6 checks healthy over the last 39d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · migrationpilot (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars9Stargazers on the source repository.
npm downloads2.4kPackage downloads in the last 30 days.
Last commit9d agoMost recent push to the default branch.

How Migrationpilot works

What migrationpilot does

The migrationpilot MCP server gives AI coding agents access to local, deterministic PostgreSQL migration analysis. It is designed to identify statements that may block production traffic, acquire severe locks, or violate migration-safety rules before an agent writes or applies DDL.

The server checks 112 rules and can return violations, a risk score, lock information, and suggested safer SQL. Its main gate is check_before_apply, which accepts migration SQL and returns a pass or fail verdict, the configured failure threshold, detected violations, and a summary. This makes it suitable for placing a safety check immediately before a migration is applied.

Analysis does not require a database connection.

How it works

Configure the MCP server with the command npx migrationpilot-mcp. The agent can then call tools over MCP and provide SQL directly. The server uses the same .migrationpilotrc.yml resolution behavior as the command-line interface, allowing check_before_apply to use the project’s configured rules and failure level.

For a single migration, analyze_migration reports rule violations, risk, and lock analysis. analyze_migration_dir evaluates multiple files and produces both per-file results and an aggregate. explain_lock focuses on the lock acquired by one DDL statement and the operations it can block.

The tool output distinguishes warning and critical findings. In the CLI, clean analysis exits with code 0, warnings can produce code 1 when configured with --fail-on warning, and critical findings produce code 2. The MCP gate exposes a pass or fail result based on its configured threshold.

Tools and capabilities

The migrationpilot MCP server provides these seven tools:

  • check_before_apply: Apply a configured pass/fail gate to SQL.
  • analyze_migration: Inspect one migration for violations, risk, and locks.
  • analyze_migration_dir: Analyze a directory and aggregate its results.
  • get_rule: Read what a rule detects, why it matters, and whether it supports an automatic fix.
  • suggest_fix: Return fixed SQL where possible and identify issues requiring human review.
  • explain_lock: Describe a DDL statement’s lock and what it may block.
  • list_rules: Return the complete rule catalogue.

The README gives an example where adding a unique constraint triggers findings for an ACCESS EXCLUSIVE lock and for building a unique index under that lock. The suggested alternative creates the index concurrently before attaching it as a constraint.

Setup and configuration

Run the server through an MCP client with a configuration equivalent to:

config.json
{
  "mcpServers": {
    "migrationpilot": {
      "command": "npx",
      "args": ["migrationpilot-mcp"]
    }
  }
}

The CLI requires Node.js 22 or newer, and the PostgreSQL parser is included in the package. Project configuration can be supplied through .migrationpilotrc.yml; check_before_apply also accepts an optional configPath and PostgreSQL version input.

Claude Code includes a separate plugin with a skill and a pre-tool-use hook. Cursor can use the provided .mdc rule file. These are client integrations in addition to the MCP server configuration.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Migrationpilot

migrationpilot is an MCP server that connects AI coding agents to MigrationPilot’s local PostgreSQL migration analyzer. Its main tools check SQL before application, analyze migrations and directories, explain DDL locks, list rules, inspect individual rules, and suggest automatic fixes for supported violations.

Run it through your MCP client with `npx migrationpilot-mcp` as the command. The README provides a configuration using `command: "npx"` and `args: ["migrationpilot-mcp"]`; the broader package requires Node.js 22 or newer.

Yes, migrationpilot includes a Cursor integration. Copy `integrations/cursor/migrationpilot.mdc` into the project’s `.cursor/rules/` directory so the agent receives instructions about when to run MigrationPilot and how to handle violations.

Call `check_before_apply` with the migration SQL. It returns a pass or fail verdict, the configured failure level, violations, and a summary, while using `.migrationpilotrc.yml` resolution consistent with the CLI.

Yes, `suggest_fix` returns automatically fixed SQL for supported findings and identifies violations that still require human review. The separate `get_rule` tool indicates whether an individual rule supports an automatic fix.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMigrationpilot AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/migrationpilot?style=directory)](https://allmcps.com/mcp/migrationpilot)
HTML Embed
<a href="https://allmcps.com/mcp/migrationpilot"><img src="https://allmcps.com/api/badge/migrationpilot?style=directory" alt="Migrationpilot on AllMCPs" /></a>