migratoor
Provides database migration safety checking for PostgreSQL by analyzing SQL statements against safety rules, identifying dangerous patterns like adding NOT NULL columns without defaults or creating indexes without CONCURRENTLY, and suggesting safe alternatives.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@migratoorcheck this SQL: ALTER TABLE users ADD COLUMN email TEXT NOT NULL;"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
migratoor
Database migration safety checker MCP server. Catch dangerous migrations before they hit production.
Problem
Developers write migrations, deploy, and accidentally lock production tables for minutes. Or drop a column that running code still references. Or create an index that blocks all writes. These cause real outages.
migratoor checks your SQL migrations against 14 proven safety rules from Squawk and strong_migrations, explains why each pattern is dangerous, and suggests the safe alternative — all as MCP tools in your AI editor.
Related MCP server: MigratorXpress MCP Server
Quick Start
As MCP Server
Works with any MCP-compatible client — Claude Code, Claude Desktop, Cursor, Windsurf, VS Code (Copilot), Continue.dev, Zed, Cline, and more.
{
"mcpServers": {
"migratoor": {
"command": "npx",
"args": ["-y", "@mrzadexinho/migratoor"]
}
}
}As Library
import { analyzeMigration, formatReport } from '@mrzadexinho/migratoor';
const result = analyzeMigration(`
ALTER TABLE users ADD COLUMN email TEXT NOT NULL;
CREATE INDEX idx_email ON users (email);
`);
console.log(formatReport(result));
// [CRITICAL] Adding NOT NULL column without default blocks reads/writes
// [CRITICAL] Creating index without CONCURRENTLY blocks all writes
// Safe alternatives provided for each findingMCP Tools
Tool | Description |
| Analyze SQL (file path or inline) for safety issues with risk levels and safe alternatives |
| List all 14 migration safety rules with severity and description |
| Deep dive on a specific rule — why it's dangerous, what lock it takes, safe pattern |
Rules
Critical (blocks reads/writes, causes outages)
Rule | What it catches |
| Adding NOT NULL column without default rewrites entire table under ACCESS EXCLUSIVE lock |
| CREATE INDEX blocks all writes during index build |
| Changing column type rewrites entire table under ACCESS EXCLUSIVE lock |
| Adding FK validates all rows, blocking writes |
| SET NOT NULL scans all rows under exclusive lock |
Warning (breaks running code, data risk)
Rule | What it catches |
| Dropping column breaks cached ORM attributes and running code |
| Data loss risk, breaks dependent views/functions |
| Running code referencing old name fails immediately |
| Same as rename column with wider blast radius |
| ACCESS EXCLUSIVE lock during index build |
Info (best practices)
Rule | What it catches |
| VARCHAR(N) has no performance benefit over TEXT in PostgreSQL |
| JSON lacks equality operators and indexing, use JSONB |
| Multiple DDL in one migration makes rollback harder |
| Mixing DML with DDL risks inconsistent state on failure |
Every critical and warning finding includes the safe alternative SQL — not just "this is wrong" but "here's exactly how to fix it."
Example Output
# Migration Safety Check
**3 statement(s) analyzed, 2 issue(s) found:**
- 2 critical
**This migration is NOT safe to run in production.**
## Critical
[CRITICAL] **Adding NOT NULL column without default blocks reads/writes**
Rule: `add-column-not-null-without-default` | Line: 1
```sql
ALTER TABLE users ADD COLUMN email TEXT NOT NULLSafe alternative: Add column as nullable, backfill, then add NOT NULL constraint
ALTER TABLE users ADD COLUMN email TEXT;
ALTER TABLE users ALTER COLUMN email SET DEFAULT <value>;
UPDATE users SET email = <value> WHERE email IS NULL;
ALTER TABLE users ALTER COLUMN email SET NOT NULL;
## Architecture
migratoor/ src/ sql/ # SQL parsing layer types # Statement, ParsedMigration parser # Split SQL, classify DDL operations rules/ # Safety rules types # Rule, Finding, Severity postgres # 14 PostgreSQL safety rules registry # Rule lookup, list, filter engine/ # Analysis engine analyzer # Apply rules, collect findings, summarize reporter # Format results (structured + markdown) mcp/ # MCP server layer tools/ # 3 MCP tools tests/ # 93 tests mirroring src/ structure
## Prerequisites
- **Node.js** >= 20.0.0
- No other dependencies required — migratoor analyzes SQL statically
## Development
```bash
git clone https://github.com/mrzadexinho/migratoor.git
cd migratoor
npm install
npm run build
npm testLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mrzadexinho/migratoor'
If you have feedback or need assistance with the MCP directory API, please join our Discord server