Repository navigation
Description
Bug report
Describe the bug
When using the Supabase MCP server in project-scoped mode (recommended security configuration), the branching tools are fully non-functional:
-
create_branchrequires aconfirm_cost_idparameter, which can only be obtained fromconfirm_cost. Butconfirm_cost(andget_cost) are in the Account Management feature group, which is disabled in project-scoped mode. This makescreate_branchuncallable. -
list_branchesreturns the error: "Project reference is missing when validating permissions." This makes the entire branching surface non-functional — even if a branch were created via the dashboard, the MCP cannot see or manage it.merge_branchis presumed to fail the same way.
The branching tools are listed in the Branching feature group, which is documented as available in project-scoped mode. The bug
is that they depend on an account-scoped prerequisite (confirm_cost) that is unavailable in the same mode.
To Reproduce
- Connect the Supabase MCP server in project-scoped mode (passing
project_refparameter) - Call
list_branches→ error: "Project reference is missing when validating permissions" - Attempt to call
create_branch→ cannot provide requiredconfirm_cost_idparameter becauseconfirm_costtool is
not available in project-scoped mode - All branching operations are blocked
Expected behavior
Branching tools should be fully functional in project-scoped mode. Either:
- Expose
get_cost/confirm_costin project-scoped mode (scoped to the connected project), or - Allow
create_branchwithoutconfirm_cost_idin project-scoped mode (project is already identified, cost is deterministic), or - Fix project reference resolution for
list_branches/merge_branchin project-scoped connections
Screenshots
N/A — MCP tool calls, not browser UI.
System information
- OS: N/A (cloud-hosted MCP via Claude.ai)
- Browser: N/A
- Version of supabase-js: N/A
- Version of Node.js: N/A
- MCP access method: Claude.ai MCP integration
- Supabase plan: Pro
- MCP connection mode: project-scoped
- Region: us-west-2
Additional context
This blocks the staging-branch workflow for MCP-managed migrations. The intended workflow is create_branch → apply_migration on dev branch → verify → merge_branch to production. Without functional branching, migrations must be applied directly to production with no staging validation.
Activity
kayalopez commentedon May 24, 2026
This looks like a good regression target for project-scoped MCP mode because the broken path is not just
create_branch; it is the whole migration-staging contract.The acceptance checks I would want before marking this fixed:
tools/listexposes only branching tools that are actually callable in that same scope, or the blocked prerequisite is documented in the tool description.list_branchessucceeds without aProject reference is missing when validating permissionserror.create_brancheither does not requireconfirm_cost_idin project-scoped mode, or a project-scopedget_cost/confirm_costpath is visible and callable.apply_migrationshould not be treated as a safe fallback to production without an explicit approval gate.I made a small client-side checker for this exact shape of failure if it helps people triage their own redacted MCP notes: https://ai-launch-risk-check-public.vercel.app/supabase-mcp-branching-readiness.html
It does not ask for credentials or call Supabase; it just flags the project-scoped
confirm_costgap,list_branchesproject-ref errors, and production-migration fallback risk from pasted redacted notes.luisangelrod commentedon Jul 23, 2026
I traced this against current
mainand found two separate paths:list_branches: the repository implementation already injects the scoped project ID.getBranchingTools()passesinject: { project_id }to bothcreate_branchandlist_branches. I added a local-only regression test that starts a server withsetup({ projectId: project.id }), callslist_brancheswith{}arguments, and verifies the branch for that project is returned. It passes:The exact hosted error text (
Project reference is missing when validating permissions) does not occur in this repository. That points to the cloud MCP authorization/gateway or a deployed-version difference, rather than missing injection inbranching-tools.ts.create_branch: the scoped-mode dead end is reproducible from the tool definitions. Project scope removes account tools includingget_costandconfirm_cost, whilecreate_branchstill requiresconfirm_cost_idand validates its hash before executing. A scoped client therefore has no exposed route to obtain a valid confirmation ID.I can submit the scoped
list_branchesregression test, but the production fix needs a maintainer decision so the cost guard is not weakened accidentally. Would you prefer:create_branchwhen project scoped until that path exists, orIf you confirm the intended behavior, I’m happy to implement it with tests.
barryroodt commentedon Sep 11, 2026
Thanks for reporting this. We’ve confirmed that, in the legacy workflow,
create_branchcannot be called in project-scoped mode becauseconfirm_costis not exposed. The separatelist_branchespermission concern has not been assessed.We’ve decided not to pursue a fix for the legacy
get_cost/confirm_costworkflow, so this branch-creation bug remains unresolved for clients using it. We plan to retire that workflow in favour of MCP elicitations once more clients support them, rather than make further changes to the legacy flow.