Skip to content

Feature: Add MCP tool for migration repair parity with CLI #5

@sujaritnrc

Description

@sujaritnrc

Problem

When local migration files and remote migration history drift, there is currently no first-class MCP equivalent of:

  • supabase migration repair --status applied ...
  • supabase migration repair --status reverted ...

This blocks fully plugin-first workflows and forces fallback to CLI or manual SQL edits on supabase_migrations.schema_migrations.

Proposed Solution

Add a dedicated MCP tool, e.g. repair_migrations, with inputs like:

  • project_id
  • status (applied | reverted)
  • versions (array of migration versions)
  • optional dry_run (default true)

Expected Behavior

  • Supports batch updates to migration history.
  • Validates version format and existence.
  • Returns structured diff before apply (when dry_run).
  • Returns clear summary: applied_count, reverted_count, skipped_count.

Why this matters

This is a critical missing operation for real-world migration drift recovery and is required for safe plugin-first DB operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions