# rebase_branch

Rebases a development branch on production. This will effectively run any newer migrations from production onto this branch to help handle migration drift.

Agent View of the PolicyLayer registry record for `rebase_branch`. HTML page: https://policylayer.com/tools/supabase/rebase-branch

## Facts

- Tool: `rebase_branch`
- Server: Supabase (`@modelcontextprotocol/server-supabase`) — https://policylayer.com/tools/supabase.md
- Install: `npx -y @modelcontextprotocol/server-supabase`
- Homepage: https://github.com/supabase-community/supabase-mcp
- Risk category: Execute (High risk)
- Registry record: grade D, identity verified
- Server auth posture: gated
- Server rate-limited: no
- Parameters: 1
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `branch_id` | string | no |  |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "rebase_branch",
    "arguments": {}
  }
}
```

## Why rebase_branch is rated High

This tool executes database migrations on a branch, which constitutes code execution (migration scripts run against a database). While the description frames it as a helpful drift-resolution operation, the actual effect is to execute arbitrary migration code that could modify schema, data, or both. This goes beyond simple Write (reversible data changes) because migrations can include destructive operations.

From the tool's own definition: "Tool performs 'rebases a development branch on production' and 'run any newer migrations from production onto this branch'."

## Use case

AI agents invoke rebase_branch to trigger actions in Supabase. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Supabase:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "rebase_branch": {
      "limits": [
        {
          "counter": "rebase_branch_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Supabase (28)

- `delete_branch` — Destructive — https://policylayer.com/tools/supabase/delete-branch.md
- `pause_project` — Destructive — https://policylayer.com/tools/supabase/pause-project.md
- `reset_branch` — Destructive — https://policylayer.com/tools/supabase/reset-branch.md
- `apply_migration` — Execute — https://policylayer.com/tools/supabase/apply-migration.md
- `deploy_edge_function` — Execute — https://policylayer.com/tools/supabase/deploy-edge-function.md
- `execute_sql` — Execute — https://policylayer.com/tools/supabase/execute-sql.md
- `merge_branch` — Execute — https://policylayer.com/tools/supabase/merge-branch.md
- `confirm_cost` — Financial — https://policylayer.com/tools/supabase/confirm-cost.md
- `generate_typescript_types` — Read — https://policylayer.com/tools/supabase/generate-typescript-types.md
- `get_advisors` — Read — https://policylayer.com/tools/supabase/get-advisors.md
- `get_cost` — Read — https://policylayer.com/tools/supabase/get-cost.md
- `get_edge_function` — Read — https://policylayer.com/tools/supabase/get-edge-function.md
- `get_logs` — Read — https://policylayer.com/tools/supabase/get-logs.md
- `get_organization` — Read — https://policylayer.com/tools/supabase/get-organization.md
- `get_project` — Read — https://policylayer.com/tools/supabase/get-project.md
- `get_project_url` — Read — https://policylayer.com/tools/supabase/get-project-url.md
- `get_publishable_keys` — Read — https://policylayer.com/tools/supabase/get-publishable-keys.md
- `list_branches` — Read — https://policylayer.com/tools/supabase/list-branches.md
- `list_edge_functions` — Read — https://policylayer.com/tools/supabase/list-edge-functions.md
- `list_extensions` — Read — https://policylayer.com/tools/supabase/list-extensions.md
- `list_migrations` — Read — https://policylayer.com/tools/supabase/list-migrations.md
- `list_organizations` — Read — https://policylayer.com/tools/supabase/list-organizations.md
- `list_projects` — Read — https://policylayer.com/tools/supabase/list-projects.md
- `list_tables` — Read — https://policylayer.com/tools/supabase/list-tables.md
- `search_docs` — Read — https://policylayer.com/tools/supabase/search-docs.md
- `create_branch` — Write — https://policylayer.com/tools/supabase/create-branch.md
- `create_project` — Write — https://policylayer.com/tools/supabase/create-project.md
- `restore_project` — Write — https://policylayer.com/tools/supabase/restore-project.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=supabase · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/supabase
