migrate-mcp
Provides migration framework detection, CLI-backed migration status and schema drift checks, migration generation, risk review, plain-English explanations, and rollback guidance for Prisma projects.
Provides migration framework detection, CLI-backed migration status, migration skeleton generation, risk review, plain-English explanations, and rollback guidance for Sequelize projects.
Provides migration framework detection, CLI-backed migration status and schema drift checks, CLI-backed migration generation, risk review, plain-English explanations, and rollback guidance for TypeORM projects.
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., "@migrate-mcpDetect the migration framework in this repo and review the pending migration."
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.
migrate-mcp
Inspect, explain, and prepare database migrations without giving an agent permission to run them.
migrate-mcp is an open-source MCP server for Alembic, golang-migrate, TypeORM, Sequelize, and Prisma. It detects frameworks from repository evidence, inspects migration state and drift through framework-native commands, reviews risk, generates files with explicit approval, explains changes, and gives rollback guidance.
It deliberately exposes no tool that applies a migration or executes a rollback.
30-second setup
Add this server to your MCP client:
{
"mcpServers": {
"migrate": {
"command": "npx",
"args": ["-y", "migrate-mcp"]
}
}
}Then ask: Detect the migration framework in this repo and review the pending migration.

Related MCP server: MCP Migration Advisor
Tools
Tool | Purpose | Writes files |
| Detect supported frameworks with evidence | No |
| Inventory migrations and query status where configured | No |
| Run verified framework-native drift checks | No |
| Find destructive, availability, data, and rollback risk | No |
| Generate through the framework CLI after approval | Yes |
| Explain recognized operations in plain English | No |
| Describe rollback steps and uncertainty | No |
Safety model
No apply, upgrade, deploy, rollback, or downgrade execution tools.
Generation requires
approved: true, validates the name, and blocks production-like targets.Commands use argument arrays with
shell: false, bounded output, timeouts, and a small environment allowlist.Paths are resolved against a real repository root and symlink escapes are rejected.
Credentials are redacted from diagnostics.
Unsupported capabilities return an explicit unsupported or partial result instead of guessed output.
Generation can still execute project-owned framework configuration, so review repositories before granting an agent access.
Framework support
Framework | Detect | Status | Drift | Generate | Review and explain |
Alembic | Yes | CLI-backed | CLI-backed | Autogenerate | Yes |
golang-migrate | Yes | Version-backed | Partial | Skeleton | Yes |
TypeORM | Yes | CLI-backed | CLI-backed | CLI-backed | Yes |
Sequelize | Yes | CLI-backed | Unsupported | Skeleton | Yes |
Prisma | Yes | CLI-backed | CLI-backed | CLI-backed | Yes |
Database-backed operations require the same framework configuration and credentials that the project CLI requires. Offline inventory remains available when those are absent.
Programmatic API
import { detectMigrationFrameworks, reviewMigrations } from "migrate-mcp";
const frameworks = await detectMigrationFrameworks(process.cwd());
const review = await reviewMigrations({
repository: process.cwd(),
paths: ["migrations/20260923_add_accounts.sql"],
});Development
Requires Node.js 22 or newer.
npm ci
npm run checkSee CONTRIBUTING.md for fixture and adapter guidelines. Security concerns belong in SECURITY.md.
License
MIT
Available Tools
7 toolsdetect_migration_frameworksARead-only
Detect Alembic, golang-migrate, TypeORM, Sequelize, and Prisma from repository evidence.
| Name | Required | Description | Default |
|---|---|---|---|
| repository | Yes | Absolute or current-working-directory-relative repository path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds that detection is based on repository evidence, implying static inspection, but it does not disclose limits such as which files are examined or whether the detection is definitive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no filler. Every word carries content: the verb, the specific frameworks, and the source of evidence are all front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter read-only tool this is mostly sufficient, but since there is no output schema, the description does not state what the result looks like (e.g., a list of detected frameworks, booleans, or evidence paths). That return-format gap is the main omission.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already fully documents the single 'repository' parameter as a path, and schema description coverage is 100%. The description adds no new parameter-level meaning beyond connecting the repository parameter to the notion of evidence, so the baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with the imperative 'Detect' and names exactly five migration frameworks, making the operation and target unambiguous. The phrase 'from repository evidence' clarifies that it scans a repository, distinguishing it from siblings like generate_migration or explain_migration.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies a repository-scanning use case but never states when to choose this over siblings such as detect_schema_drift, review_migrations, or list_migration_status. It offers no exclusion criteria or 'use instead when...' guidance, so an agent must infer applicability largely from the tool name and framework list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
detect_schema_driftCRead-only
Use verified framework-native commands to inspect schema drift and report unsupported dimensions honestly.
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | ||
| framework | No | ||
| repository | Yes | Absolute or current-working-directory-relative repository path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, and the description's 'inspect' wording is consistent with that safety profile. The description adds useful context by stating it uses 'verified framework-native commands' and that it reports unsupported dimensions honestly, which suggests it will not fabricate results. However, it stops short of explaining concrete behavioral details like output shape or failure modes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence with the primary action front-loaded. The word 'honestly' is slightly editorial, but it still communicates a real behavioral intent and does not bloat the description significantly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With three parameters including an opaque nested options object, no output schema, and several sibling tools, the description is too thin to fully guide an agent. It does not explain what inputs are needed, how results are returned, or how this tool fits into the migration workflow.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 33%, with only repository documented; the options object is entirely opaque. The description does not compensate by explaining what options, framework, or repository mean, nor does it clarify how framework selection affects execution. Most parameter semantics remain implicit or undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear verb and resource: 'inspect schema drift.' It also signals an important behavioral constraint, using 'verified framework-native commands,' which gives the agent a sense of what the tool does. It does not explicitly differentiate from siblings, but 'schema drift' is distinct enough from migration status and generation tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description offers no guidance on when to choose this tool over alternatives like detect_migration_frameworks or list_migration_status. It does not specify prerequisites, such as whether a framework must already be detected, nor does it explain when this tool is not appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
explain_migrationCRead-only
Explain migration operations in plain English without executing them.
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | ||
| options | No | ||
| framework | No | ||
| repository | Yes | Absolute or current-working-directory-relative repository path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds useful behavioral context: the tool explains in plain English and does not execute migrations. However, it does not disclose what the explanation output looks like, whether there are side effects beyond reading, or whether any configuration is needed. Since annotations cover the main safety behaviors, a 3 is appropriate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It communicates the action, the subject, the tone of the output, and the non-execution guarantee. This is concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 4 parameters (2 required), nested objects, an enum, and no output schema, the description is minimal but not enough. It fails to explain what 'paths' and 'options' mean, what frameworks are supported, or what the agent should expect in the response. The read-only annotations cover safety, but operational details are missing, making it hard for an agent to invoke correctly on its first try.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 25%, with only 'repository' documented. The description adds no parameter information at all: it does not explain what 'paths' refers to (likely migration files or directories), what 'options' contains, or how 'framework' affects the explanation. With such low schema coverage and no compensation in the description, an agent would be guessing at parameter meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Explain') with a clear resource ('migration operations') and adds a distinguishing qualifier ('without executing them'). It is not a tautology and differentiates well from siblings like generate_migration or list_migration_status. It could be slightly more specific about what counts as 'migration operations' (files? scripts?), but it is clear enough for an agent to understand the core purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention siblings, conditions, or exclusions. The implied use case is 'when you want to understand a migration without running it,' but that is left entirely to inference, and no alternative tools are referenced.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_migrationB
Generate a migration through the detected framework. Requires explicit approval and blocks production-like targets.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| options | No | ||
| approved | Yes | ||
| framework | No | ||
| repository | Yes | Absolute or current-working-directory-relative repository path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish that this is a non-read-only, non-destructive mutation. The description adds two behavioral guardrails not present in the annotations: it requires explicit approval and refuses production-like targets. This is useful context, though file-system side effects are not detailed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, with the core action first and the constraints immediately after. No wasted words; all content carries meaning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This is a 5-parameter operation with nested options and no output schema, but the description omits how to supply approval, what framework detection means for the `framework` parameter, and what 'blocks production-like targets' is based on. An agent has to infer the workflow and parameter requirements from the schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 20%, so the description needed to carry parameter meaning. It only gestures at `approved` ('explicit approval') and `framework` ('detected framework'), leaving `name`, `options`, and repository path semantics to the schema. The `options` object is entirely unexplained.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific action ('Generate') and a clear object ('a migration'), and identifies the mechanism ('detected framework'). This clearly differentiates it from read-only siblings like explain_migration or list_migration_status, though it does not explicitly name them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives a safety prerequisite (explicit approval) and a restriction (blocks production-like targets), but it does not state when to prefer this tool over detect_migration_frameworks, explain_migration, or rollback guidance. The intended workflow—e.g., run detection first, then generate—is left implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_rollback_guidanceBRead-only
Provide rollback guidance and caveats. This tool never runs a rollback.
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | ||
| options | No | ||
| framework | No | ||
| repository | Yes | Absolute or current-working-directory-relative repository path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds a concrete behavioral promise—this tool never runs a rollback—which is consistent, but it does not disclose additional behavior such as response format or how inputs are processed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences front-load the purpose and immediately add the critical safety caveat. Every word earns its place with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With four parameters, nested options, low schema coverage, and no output schema, this description is too thin. An agent can safely infer that it returns guidance, but not what valid paths/options are or what the response will look like, which are material gaps for invoking it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 25%, and only repository is described. The tool description does not clarify what paths should reference, how options are used, or how framework influences the guidance, leaving the agent to infer important parameter meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool provides rollback guidance and caveats, and the explicit disclaimer 'never runs a rollback' distinguishes it from an execution tool. It could be more specific about the kind of guidance returned, so it stops just short of a 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The disclaimer gives a useful negative usage signal: do not use this tool to actually perform a rollback. However, it does not state when to choose this over sibling tools such as explain_migration or review_migrations, or describe conditions that should trigger its use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_migration_statusARead-only
List migration inventory and database-backed status when framework configuration is available.
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | ||
| framework | No | ||
| repository | Yes | Absolute or current-working-directory-relative repository path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the read-only, non-destructive safety profile, so the description need not repeat that. It adds a dependency on framework configuration and describes the output as 'database-backed status', but does not disclose behavior when configuration is unavailable or other side effects. This is moderate added context beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence with no fluff. The verb and resource are front-loaded, and the conditional clause is packed efficiently. Every word contributes.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With three parameters including a nested options object, an enum, and no output schema, the description is too sparse. It does not explain what 'database-backed status' returns, how options affect results, or what happens when framework configuration is not present. An agent would need to infer significant details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 33% — only 'repository' has a description. The phrase 'when framework configuration is available' loosely relates to the framework parameter, but offers no guidance on the 'options' object or how framework is supplied. This does not adequately compensate for the large schema coverage gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('List'), resource ('migration inventory and database-backed status'), and a condition ('when framework configuration is available'). This clearly distinguishes it from sibling tools such as generate_migration, explain_migration, and detect_migration_frameworks, whose verbs signal different actions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides a clear usage condition: use this tool when framework configuration is available. It does not explicitly name alternatives or exclusions, but the condition implies a boundary. This is more than implied usage but stops short of explicit routing to siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
review_migrationsARead-only
Statically review migration files for destructive, availability, data, and rollback risks without executing them.
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | ||
| options | No | ||
| framework | No | ||
| repository | Yes | Absolute or current-working-directory-relative repository path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds valuable behavioral context: it explicitly states the tool does NOT execute migrations, and it enumerates the risk categories it checks (destructive, availability, data, rollback). This goes beyond the annotations by clarifying the non-execution behavior and the scope of analysis.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that front-loads the core action ('Statically review migration files') and then lists the specific risk categories. Every word earns its place; there is no fluff or repetition of schema details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only analysis tool with no output schema, the description covers the key aspects: what it analyzes, what risks it checks, and that it doesn't execute. It doesn't describe the output format or how results are returned, but since there's no output schema, a brief note on return format would help. The framework enum and paths parameter are left to inference, but the overall picture is clear enough for an agent to select and invoke the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is only 25%, with only 'repository' having a description. The tool description does not explain the meaning of 'paths', 'options', or 'framework'. However, the parameter names are fairly self-explanatory: 'paths' likely refers to migration file paths, 'framework' selects the migration framework, and 'options' is a generic options bag. The description adds no parameter-specific detail, so it doesn't fully compensate for the low schema coverage, but the names carry reasonable meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: statically review migration files for destructive, availability, data, and rollback risks without executing them. It uses a specific verb ('review'), names the resource ('migration files'), and distinguishes itself from siblings like generate_migration and explain_migration by emphasizing static analysis and risk categories.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use this tool: when you need to assess migration risks without executing them. It doesn't explicitly name alternatives or exclusions, but the static-analysis framing and risk categories provide clear context. Sibling names like generate_migration and explain_migration suggest alternatives, but the description doesn't explicitly route between them.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.0.1- First observed
detect_migration_frameworks - First observed
detect_schema_drift - First observed
explain_migration - First observed
generate_migration - First observed
get_rollback_guidance - First observed
list_migration_status - First observed
review_migrations
TDQS
Scored across 7 tools
Each tool targets a distinct aspect of migration management: generation, explanation, rollback guidance, framework detection, status listing, drift detection, and risk review. There is no overlap or ambiguity in their purposes.
All tool names follow a consistent verb_noun snake_case pattern (e.g., generate_migration, detect_schema_drift, list_migration_status). This uniform convention makes the set predictable and easy to navigate.
Seven tools is well-scoped for a migration-focused server. Each tool covers a necessary part of the migration workflow without redundancy, fitting the typical 3-15 tool range.
The set covers framework detection, generation, explanation, review, status, drift detection, and rollback guidance. A minor gap is the lack of explicit apply or rollback execution tools, though generate_migration may partially cover apply, and the server may intentionally focus on planning and analysis.
Maintenance
Related MCP Connectors
Detects database migration table locks, terraform cost leaks, and OWASP API flaws.
Scans schema metadata to classify PHI, score HIPAA readiness, and generate compliant migrations.
Security reviews for coding agents: diffs checked against your org policy and live infrastructure.
Threat modeling, code/cloud/pipeline scanning, shadow-AI discovery, compliance checks and fixes.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to understand and query your database safely by providing a semantic layer of metadata, with tools to search, explain, validate, and generate safe SQL.2MIT
- 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.616 npmMIT

terrabaseofficial
AlicenseNot gradedqualityDmaintenanceLLM-assisted, safety-gated Postgres migrations exposed as an MCP server, using a deterministic rule engine over Postgres's own parser AST for safety enforcement, with two-phase approval and append-only audit ledger.Apache 2.0- AlicenseAqualityAmaintenanceBlocks unsafe PostgreSQL migrations before an AI agent writes or runs them. check_before_apply returns a pass/fail gate; reads the real Postgres parser, classifies the lock each statement takes, checks 112 safety rules. Runs offline, no database required.7822 npm7MIT