MigrateSafe MCP
Allows CrewAI agents to analyze database migration scripts, flagging table-locking statements, destructive drops, and incompatible schema changes before deployment.
Integrates migration safety inspection into LangGraph agent workflows, allowing SQL migration analysis for lock contention, destructive DDL, and estimated production outage risk.
Click on "Deploy 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., "@MigrateSafe MCP check if this migration is safe: ALTER TABLE users ADD COLUMN email 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.
MigrateSafe MCP (Lite Edition)
MigrateSafe MCP is a zero-downtime database migration inspection and verification Model Context Protocol server for AI coding assistants (Claude Desktop, Cursor, LangGraph, CrewAI).
It analyzes DDL migration scripts before execution, flagging table-locking statements, destructive drops, and backward-incompatible schema changes that would otherwise cause production downtime or data loss.
π― The Problem
When autonomous AI agents write database migrations:
Production Table Lockups: A naive
ALTER TABLE ... ADD COLUMN ... NOT NULLor unindexed column change acquires anAccessExclusiveLock, blocking all reads and writes and taking down user-facing services.Silent Breaking Changes: Dropping or renaming columns without an Expand/Contract migration pattern breaks active application pods during rolling deployments.
Write-Blocking Index Builds: Running
CREATE INDEXinstead ofCREATE INDEX CONCURRENTLYblocks INSERT and UPDATE traffic on critical transactional tables.
MigrateSafe catches these issues automatically inside your AI workflow before migration scripts ever reach production.
Related MCP server: MCP Migration Advisor
β¨ Features (Lite Edition)
π Lock Contention Detection: Identifies statements that acquire
AccessExclusiveLockorShareLock.β οΈ Destructive Statement Detection: Flags
DROP TABLE,DROP COLUMN,RENAME COLUMN, and incompatible column type rewrites.β±οΈ Lock Duration & Risk Estimator: Estimates exclusive lock durations based on table row volume.
π οΈ Full MCP Stdio Protocol: Native integration with Claude Desktop, Cursor, and agent frameworks.
π Quickstart
1. Installation
git clone https://github.com/johannschiffer/migratesafe-mcp.git
cd migratesafe-mcp
pip install -e .2. Configure in Claude Desktop or Cursor
Add to your claude_desktop_config.json or Cursor MCP configuration:
{
"mcpServers": {
"migratesafe": {
"command": "migratesafe",
"args": ["run"]
}
}
}3. CLI Inspection
# Analyze migration safety via CLI
migratesafe analyze path/to/migration.sql --dialect postgresπ οΈ MCP Tools Reference
Tool | Parameters | Description |
|
| Inspects migration for table locks and destructive patterns |
|
| Maps lock levels ( |
|
| Estimates exclusive lock time and production outage risk |
|
| Identifies breaking changes between DDL schemas |
π Upgrade to MigrateSafe Pro
Need production-grade rolling upgrade validation and automated safe refactoring?
The MigrateSafe Pro Edition adds:
π Zero-Downtime Pattern Generator: Automatically transforms dangerous DDL into safe 3-phase Expand/Contract migrations.
β‘ Live Shadow Traffic Simulation Harness: Runs concurrent read/write transactions against a clone database while executing the migration to benchmark lock contention and latency spikes.
βͺ Automated Rollback Verifier: Proves that
down.sqlcompletely restores original schema with 0 data loss.π³ Production Docker & Compose: Ready-to-deploy CI/CD sidecar.
π§ͺ 100% Passing Pytest Suite.
π Get MigrateSafe Pro on Gumroad ($14.99 USD)
π License
MIT Β© 2026 Johann Schiffer
Available Tools
4 toolsanalyze_migration_safetyB
Analyze a SQL migration script for table locks, destructive drops, and breaking changes.
Inputs: sql (required), dialect.
detect_table_locksC
Map out lock levels (AccessExclusiveLock, ShareLock) acquired per statement in migration.
Inputs: sql (required), dialect.
generate_dry_run_planC
Estimate lock duration and production outage risk based on table row count.
Inputs: sql (required), sample_row_count.
inspect_schema_diffB
Compare before and after SQL DDL schemas to identify breaking changes.
Inputs: after_sql (required), before_sql (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 4 tools
Each tool has a distinct focus: safety analysis, lock detection, dry-run risk estimation, and schema diffing. analyze_migration_safety is somewhat umbrella-like and overlaps conceptually with the other three, but the descriptions still make tool boundaries understandable.
All four tools follow a consistent snake_case verb_noun pattern: analyze_migration_safety, detect_table_locks, generate_dry_run_plan, inspect_schema_diff. No mixed conventions or vague names.
Four tools is well-scoped for a focused SQL migration safety server. Each tool maps to a clear, non-redundant capability within that domain.
The surface covers core migration-safety workflows: broad analysis, lock mapping, outage-risk estimation, and schema diffing. Minor gaps exist around rollback planning or safe-rewrite suggestions, but agents can work around them.
Related MCP Connectors
Review your AI agent's database changes on your schema, with plain-language risk, before they run.
Guard AI agents' PostgreSQL/MySQL access via MCP: SQL audit, auth, masking, write approval
The AI that understands raw data: Schema over your tables and databases, as MCP tools.
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to query live schema, lineage, and query-context across data warehouses, dbt projects, orchestration systems, and BI tools via MCP tools.Apache 2.0
- AlicenseAqualityDmaintenanceAnalyzes database migrations for risks like lock contention and data loss before they run. Supports Flyway and Liquibase formats, providing risk scores and rollback generation.624 npmMIT
- AlicenseAqualityBmaintenanceMCP server providing deep PostgreSQL context to AI assistants, including schema DDL, index health, foreign key associations, query execution plans, and performance statistics via read-only tools.121MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to safely explore PostgreSQL schemas, inspect sample rows, draft queries, and read EXPLAIN plans through a read-only enforced interface for MCP clients.MIT