Publishing
A development-only Supabase token gets a permission error when it merges a branch
Cataloged November 23, 2026 · Supabase · Cursor
Symptom
This applies when a merge into the main Supabase project uses a scoped personal access token that has Development Branches read-write and does not have Production Branches read-write. If this project does not merge a Supabase branch, this card does not apply. The Supabase changelog index dates the entry "Merging a branch now requires Production Branches read-write" as 2026-11-16 and labels it a breaking change. The entry says: "Since November 12, 2026, merging a branch into your main project needs a scoped personal access token with Production Branches: Read-write. A token that only has Development Branches: Read-write gets a permission error when it calls Merge a branch or the MCP `merge_branch` tool." The index line for that entry says: "Merging a Supabase branch through the Management API or MCP now requires a scoped access token with Production Branches read-write. Development-only tokens get a permission error." The entry says: "Creating, pushing, resetting, and deleting preview branches with a development-only token works as before." It says: "Merges made with a development-only token fail with a permission error. Your projects, branches, and data stay the same." It does not print the error text, and it does not print a status code. The Management API page "Merge a branch" lists 201, 401, 403, 429, and 500 as response codes. It does not print a body for 403. The 201 schema on that page requires message, and the only enum value it prints is ok. This card does not say the permission error is one of those codes. The Personal Access Tokens page shows a denied call with the comment "Returns HTTP 403". The URL in that example ends in /types/typescript, and the comment above it says the token lacks the Database permission this endpoint needs. The permission table lists Generate typescript types under Database, Read. The page does not print that example URL next to the row. It is not Merge a branch. Cursor is on this card because the Supabase docs page "Supabase MCP Server" includes Cursor and tells you to add the server in .cursor/mcp.json, or in ~/.cursor/mcp.json for every project. That page says: "Cursor IDE and the Cursor CLI (`agent`) use the same MCP configuration." The configuration it prints for Cursor is a url, https://mcp.supabase.com/mcp, and no header. The Authentication section says: "You don't need a personal access token (PAT)." The Manual authentication section says the hosted server uses dynamic client registration by default, so you don't need to manually create a personal access token or an OAuth app. The changelog does not mention that browser sign-in. This card does not say a Cursor session that signed in through the browser fails this way. The same page's CI section is the setup that uses a personal access token: "To authenticate the MCP server in a CI environment, create a personal access token (PAT) and pass it as a header to the MCP server." The header example on that page is for Claude Code, and the page says not every MCP client supports custom headers. This card does not say Cursor's mcp.json accepts that header. The changelog says: "A token you give to CI or an AI agent for preview work can no longer write to production." The MCP page says the Branching tool group is experimental and requires a paid plan, and it lists merge_branch in that group. This card does not say a free project has merge_branch. The changelog says: "Classic personal access tokens are not affected." The Personal Access Tokens page says: "You can still create a token with your account's full access. The Dashboard shows these tokens with a Legacy badge." This card does not say that page uses the word Classic for the badge. The same page says tokens created with a scope start with sbp_fc. It does not say what a full-access token starts with.
Root cause
The changelog entry "Merging a branch now requires Production Branches read-write" dates the new rule as since November 12, 2026. It says: "A merge applies a branch's changes to your production project. Before this change, a token meant only for development branches could still write to production through a merge. Requiring production access closes that gap." The Personal Access Tokens page says personal access tokens authenticate you to the Management API and the tools built on it, like the Supabase CLI and the MCP server. It says: "A token used to authenticate the MCP server can only call the tools its granted permissions unlock." Its MCP tools table says merge_branch requires Production Branches (Read-write). The same table says create_branch requires Development Branches (Read-write) or Production Branches (Read-write). Under Permission scopes, Merge a branch is listed on Production Branches, Read-write. It is not listed on Development Branches. The Management API page "Merge a branch" says the fine-grained token must include branching_production_write. The Personal Access Tokens page says: "Commands that call the Management API fail with a permission error when the token lacks the required permission." The command it names next is supabase link, which needs Project Settings, API Keys, and API Key Secrets, all with Read access. That sentence is not about Merge a branch. The changelog says you can't change the permissions of an existing token. It says to create a new token in Account > Access Tokens with Production Branches read-write, use the new token for the merge step in your CI or scripts, and keep the development-only token for everything else, such as creating and resetting preview branches. It says: "We plan to add a separate Merge permission later, so a token can merge without full production write access." That is a plan. This card does not say that permission exists now. The Personal Access Tokens page says: "We recommend scoping every token, especially tokens for AI agents, automation scripts, and CI environments. If a token leaks, the blast radius stays small." The MCP CI section says to grant only the permissions your enabled tools need. The MCP tools table lists the required permission for merge_branch as Production Branches (Read-write). The changelog does not say to put that permission on the token the agent uses for preview work.
Before and after
The permission names are the ones in the changelog entry "Merging a branch now requires Production Branches read-write". The before block is the access that entry calls a development-only token: Development Branches: Read-write. The entry says that token gets a permission error on Merge a branch and on the MCP merge_branch tool. The after block is not a replacement of that token. The entry says you can't change the permissions of an existing token, and to keep the development-only token for creating and resetting preview branches. The second pair of lines is a new token, used for the merge step, with Production Branches read-write. The words "preview token" and "merge step, a new token" are this card's labels. The changelog does not print them. This pair does not show a token value. The Personal Access Tokens page says a scoped token starts with sbp_fc. The Merge a branch page names the fine-grained permission branching_production_write. The after block uses the Dashboard label from the changelog, not that identifier.
Before
preview token Development Branches: Read-write
After
preview token, unchanged Development Branches: Read-write merge step, a new token Production Branches: Read-write
Fix prompt
In this project only. Do not scan or test anyone else's project. Do not open a Supabase account you do not own. Do not print keys, tokens, passwords, or environment variable values. When you mention a variable, print the name only. Do not create a token. Do not merge a branch. Do not call the Management API. 1. This prompt applies if this project merges a Supabase branch into the main project. Search this project's files for merge_branch, for the path /v1/branches/, and for api.supabase.com. Give the file and the line. Do not call the URL. If this project does not merge a Supabase branch, say so and stop. 2. If a file in this project contains a token value, tell me the file and the line, and stop. Do not print the value. The Personal Access Tokens page says tokens created with a scope start with sbp_fc. Do not print characters from the token to check that. Tell me to look at the start of my own token in Account > Access Tokens. The Supabase changelog entry "Merging a branch now requires Production Branches read-write" says a scoped token that only has Development Branches: Read-write gets a permission error when it calls Merge a branch or the MCP merge_branch tool. It says classic personal access tokens are not affected. The Personal Access Tokens page says a full-access token shows a Legacy badge. This prompt does not say that page uses the word Classic for the badge. If my token shows that badge, say this prompt's token steps do not apply, and stop. 3. Do not edit a token, and do not create one. The changelog says you can't change the permissions of an existing token. Tell me its three steps, and do not do them yourself. Create a new token in Account > Access Tokens with Production Branches read-write. Use the new token for the merge step in CI or scripts. Keep the development-only token for everything else, such as creating and resetting preview branches. The changelog says creating, pushing, resetting, and deleting preview branches with a development-only token works as before. Do not replace that token with the new one. The Personal Access Tokens page says: "We recommend scoping every token, especially tokens for AI agents, automation scripts, and CI environments." Its MCP tools table says merge_branch requires Production Branches (Read-write). The changelog says: "We plan to add a separate Merge permission later, so a token can merge without full production write access." Do not tell me that permission is available. It is a plan on that page. 4. If this project's Cursor config is .cursor/mcp.json or ~/.cursor/mcp.json and the Supabase server url is https://mcp.supabase.com/mcp with no Authorization header, say so. That is the configuration the Supabase MCP docs page prints for Cursor. The Authentication section of that page says: "You don't need a personal access token (PAT)." The changelog does not mention that browser sign-in. Do not add an Authorization header to that file. The header example on the MCP page is for Claude Code, and the page says not every MCP client supports custom headers. Do not add that example to a Cursor file. Do not print a header value. 5. The MCP page says the Branching group is experimental and requires a paid plan, and it lists merge_branch there. If this project is not on a paid plan, say this card does not establish that merge_branch is available, and stop. Do not upgrade a plan. Do not open a billing page. 6. Show me the diffs. Do not deploy. Do not merge. Do not print tokens. Do not edit unrelated files. If the only change this prompt calls for is a new token in the Supabase account, say that, and do not edit a file.
Paste this into the coding tool that has your own project open.
2-minute self-check
These steps are for an app you own. Do not run them against someone else's project.
- Signed in to your own Supabase account, open Account > Access Tokens. That is the path in the changelog entry "Merging a branch now requires Production Branches read-write". Find the token your CI or agent uses for preview branches. See whether it has Development Branches read-write and does not have Production Branches read-write. The Personal Access Tokens page says a scoped token starts with sbp_fc. Look at the start yourself. Do not copy the token into a chat, a file, or a commit. Do not open an account you do not own. The changelog says classic personal access tokens are not affected. The Personal Access Tokens page says a full-access token shows a Legacy badge. If your token shows that badge, this card does not tell you to replace it.
- Do not edit that token. The changelog says you can't change the permissions of an existing token. If merges need to work, create a new token there with Production Branches read-write and use it only for the merge step. Leave the development-only token for creating and resetting preview branches. The changelog says those actions still work with a development-only token. Do not paste the new token into a chat or a repository. The Personal Access Tokens page says: "We recommend scoping every token, especially tokens for AI agents, automation scripts, and CI environments. If a token leaks, the blast radius stays small."
- In your own project, open .cursor/mcp.json if it exists, and ~/.cursor/mcp.json if you use that one. The Supabase MCP docs page says the Cursor configuration is the url https://mcp.supabase.com/mcp. If that is all the file has, the Authentication section says you don't need a personal access token, and this card does not say that browser sign-in fails. If a config you own passes an Authorization header, do not print it. On your own token, compare its permissions with the MCP tools table, which says merge_branch requires Production Branches (Read-write). Do not call merge_branch. Do not point this at a project you do not own.
Common questions
Creating and resetting preview branches still works. Why does the merge fail?
The changelog entry "Merging a branch now requires Production Branches read-write" says creating, pushing, resetting, and deleting preview branches with a development-only token works as before. It says a token that only has Development Branches: Read-write gets a permission error when it calls Merge a branch or the MCP merge_branch tool. The Personal Access Tokens page lists Merge a branch under Production Branches, Read-write, and does not list it under Development Branches. Its MCP tools table says create_branch requires Development Branches (Read-write) or Production Branches (Read-write), and merge_branch requires Production Branches (Read-write). The entry says: "Merges made with a development-only token fail with a permission error. Your projects, branches, and data stay the same." It does not print the error text, and it does not print a status code.
I connected Supabase in Cursor through the browser and I never created a token. Does this card apply?
The Supabase MCP docs page prints a Cursor configuration with the url https://mcp.supabase.com/mcp and no header. Its Authentication section says: "You don't need a personal access token (PAT)." Its Manual authentication section says the hosted server uses dynamic client registration by default, so you don't need to manually create a personal access token or an OAuth app. The changelog's affected case is a scoped personal access token with Development Branches read-write and without Production Branches read-write. The changelog does not mention the browser sign-in. This card does not say that sign-in fails. The page's CI section is the one that creates a personal access token and passes it in an Authorization header. That header example is for Claude Code. The page says not every MCP client supports custom headers.
Can I add Production Branches read-write to the token the agent already uses?
The changelog says you can't change the permissions of an existing token. It says to create a new token in Account > Access Tokens with Production Branches read-write, use that token for the merge step, and keep the development-only token for everything else, such as creating and resetting preview branches. It also says: "A token you give to CI or an AI agent for preview work can no longer write to production." The Personal Access Tokens page says: "We recommend scoping every token, especially tokens for AI agents, automation scripts, and CI environments. If a token leaks, the blast radius stays small." The changelog says: "We plan to add a separate Merge permission later, so a token can merge without full production write access." This card does not say that permission exists now.