# migrationpilot

A local MCP server checks PostgreSQL migrations before DDL runs and gives an agent a pass/fail decision.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: mickelsamuel
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mickelsamuel/migrationpilot
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/migrationpilot

## What it does

migrationpilot performs local, deterministic analysis of PostgreSQL migration files. It uses PostgreSQL’s parser and evaluates 112 rules, reporting violations, risk scoring, and lock details. Its main MCP tool, `check_before_apply`, lets an agent gate a DDL change before writing or running it.

The server exposes seven tools, including `analyze_migration` for a single migration. It resolves `.migrationpilotrc.yml` in the same way as the CLI, so the agent’s result matches the CI check. That makes it suitable for a pre-merge migration gate.

Node 22 or newer is required. The PostgreSQL parser is bundled, and the server requires no account.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add migrationpilot -- npx -y migrationpilot
```

### Codex

**Platform CLI**
```bash
codex mcp add migrationpilot -- npx -y migrationpilot
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "migrationpilot": {
            "command": "npx",
            "args": [
                "-y",
                "migrationpilot"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "migrationpilot": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "migrationpilot"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add migrationpilot npx -y migrationpilot
```

## When to use it
- check a PostgreSQL migration before applying DDL
- spot dangerous locks in ALTER TABLE statements
- block an agent before a critical schema change
- align agent checks with the CI result

## Example prompts
- Check `migration.sql` before applying it and explain every violation.
- Run the migration gate before this DDL and stop when the verdict is fail.
- Analyze this migration and report the lock type for each statement.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16730
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40459
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27844
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49863

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
