Supabase MCP user permission #53387
Replies: 2 comments 2 replies
|
I think the issue is with the OAuth permissions, rather than MCP itself.
Supabase's current MCP docs still require write access to all available scopes for manually configured OAuth apps. The Management API permission reference also lists OAuth project authorization as requiring I couldn't find a documented way for a Developer to complete that OAuth flow without elevated permissions. One alternative worth trying is a project-scoped Personal Access Token instead of OAuth. Supabase now supports scoped PATs, and its MCP permission table explicitly allows Each developer can create their own PAT, limited to the relevant project, with only For Claude Code, the MCP configuration could look like this: {
"mcpServers": {
"supabase": {
"type": "http",
"url": "https://mcp.supabase.com/mcp?project_ref=YOUR_PROJECT_REF&read_only=true&features=database",
"headers": {
"Authorization": "Bearer ${SUPABASE_ACCESS_TOKEN}"
}
}
}
}Each user would set Claude's custom remote connectors also support fixed authentication headers, although I'd be careful with shared team connectors: a shared credential means shared access, not per-user permissions. So this is a documented alternative to OAuth, but not a fix for the OAuth consent issue itself. If the goal is to expose data to a wider group of non-developers, I'd consider a dedicated read-only MCP server with per-user authorization instead of exposing the Supabase management MCP. References: |
|
@joesaunderson — the workaround shape stueberitz described is the right one, and it's worth being precise about why it works, because the part that makes it safe is the same machinery most Supabase app developers already have: RLS evaluated per request with the caller's JWT. The MCP server becomes a thin, read-only front door; authorization stays in the database, where you can audit it. Concretely, the pattern that scales from "a few queries" to "democratised data" without admin rights: 1. Expose views, not base tables, and mark them create view public.team_orders with (security_invoker = true) as
select o.id, o.status, o.created_at, o.total
from public.orders o;
grant select on public.team_orders to authenticated;
revoke all on public.team_orders from anon;2. The MCP server holds no privileged key at all. Each request carries the user's own access token (the same JWT their app session uses); the server calls the views through PostgREST with that token and nothing else. No 3. The permission model you wanted, expressed in RLS instead of dashboard roles. "This user sees their own rows" is a policy on the view's base table, not an MCP or org permission: create policy "own rows" on public.orders
for select using (auth.uid() = user_id);Users connect through their browser (OAuth as stueberitz said), and what they can read is decided by the database per query — which also means it's testable: connect as user A, ask for user B's row through the MCP path, and confirm the empty result. That test is a few minutes and it's the proof that the democratisation didn't quietly become a data dump. The tradeoff to state plainly: this is a small service you own (Edge Functions can host it, as mentioned), and the exposed surface must be deliberately narrow — views with explicit column lists rather than |
Uh oh!
There was an error while loading. Please reload this page.
I want to democratise data, and I want to give access to that data via the MCP.
I have added users as "Developer" in Supabase, and planned to expose the "read-only" MCP to Claude.
However... when users try to connect via OAuth, they are told they must be an admin to do this. Seems bizarre to require admin rights to connect an MCP in this day and age, it's not a a typical OAuth connection, it's dynamic client registration.
What is the solution here, if any? (That isn't a) upgrade to team - the rise is double what our compute costs! or b) upgrade everyone to admin).
All reactions