Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Database migration safety checker MCP server that analyzes SQL for dangerous patterns and provides safe alternatives.

README.md

migratoor

![npm version](https://www.npmjs.com/package/@mrzadexinho/migratoor) ![License: MIT](https://opensource.org/licenses/MIT)

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.

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 finding

MCP Tools

| Tool | Description | |------|-------------| | check_migration | Analyze SQL (file path or inline) for safety issues with risk levels and safe alternatives | | list_rules | List all 14 migration safety rules with severity and description | | explain_rule | 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 | |------|----------------| | add-column-not-null-without-default | Adding NOT NULL column without default rewrites entire table under ACCESS EXCLUSIVE lock | | create-index-not-concurrently | CREATE INDEX blocks all writes during index build | | change-column-type | Changing column type rewrites entire table under ACCESS EXCLUSIVE lock | | add-foreign-key-without-validation | Adding FK validates all rows, blocking writes | | set-not-null-on-existing-column | SET NOT NULL scans all rows under exclusive lock |

Warning (breaks running code, data risk)

| Rule | What it catches | |------|----------------| | drop-column | Dropping column breaks cached ORM attributes and running code | | drop-table | Data loss risk, breaks dependent views/functions | | rename-column | Running code referencing old name fails immediately | | rename-table | Same as rename column with wider blast radius | | add-unique-constraint | ACCESS EXCLUSIVE lock during index build |

Info (best practices)

| Rule | What it catches | |------|----------------| | prefer-text-over-varchar | VARCHAR(N) has no performance benefit over TEXT in PostgreSQL | | prefer-jsonb-over-json | JSON lacks equality operators and indexing, use JSONB | | multiple-ddl-statements | Multiple DDL in one migration makes rollback harder | | data-in-ddl-migration | 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

ALTER TABLE users ADD COLUMN email TEXT NOT NULL `` Safe alternative: Add column as nullable, backfill, then add NOT NULL constraint `sql 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

git clone https://github.com/mrzadexinho/migratoor.git
cd migratoor
npm install
npm run build
npm test

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Databases servers.