How do I connect the Supabase MCP server to Claude Code in read-only mode?
When connecting the hosted Supabase MCP server (https://mcp.supabase.com/mcp (opens external site)) to Claude Code, the OAuth consent grants full read + write access to the database with no read-only option, making accidental destructive changes possible. Is there a way to connect in read-only mode, or to restrict the OAuth token to read-only scopes?
Originally asked on GitHub: https://github.com/supabase/mcp/issues/236
5 answers
Fixed in the hosted Supabase MCP server. Append the query parameter to the endpoint URL:
https://mcp.supabase.com/mcp?read_only=true. A maintainer confirmed in May 2026 that this parameter is always honored and takes precedence over the scopes attached to your token, so write actions are blocked even if the token carries write permissions. The same update also made the OAuth consent request only read-only scopes when the parameter is present, so the token itself no longer receives unnecessary write permissions; update Claude Code to the latest version and re-authenticate to pick this up. The issue was closed as completed in July 2026.Caveat: the scope narrowing during OAuth consent is client-dependent, because some clients don't respect the server's
scopes_supportedlist, as a maintainer explained. One user reported that codex-cli still requested read + write OAuth scopes even withread_only=true, while Claude Code correctly received read-only scopes.Security note: with clients that respect it,
read_only=truealso narrows the OAuth consent to read-only scopes, so the token doesn't carry write permissions you don't need.Did this work for you?What @zaniluca tried on GitHub (Worked)
A commenter suggested using the endpoint with the
read_only=truequery parameter:https://mcp.supabase.com/mcp?read_only=true. A maintainer confirmed the parameter is honored and takes precedence over the token's scopes.Source: https://github.com/supabase/mcp/issues/236#issuecomment-4077012590 (opens external site)
Did this work for you?What @zshawauxlol tried on GitHub (Didn't work)
A user reported that after the scope-narrowing rollout, connecting with
read_only=trueagain requested read + write OAuth scopes, suspecting a regression.Source: https://github.com/supabase/mcp/issues/236#issuecomment-5049546125 (opens external site)
Did this work for you?What @zshawauxlol tried on GitHub (Partly worked)
The same user clarified that the failure occurred with codex-cli; the read-only scope narrowing worked as expected with Claude Code.
Source: https://github.com/supabase/mcp/issues/236#issuecomment-5049815031 (opens external site)
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
The original reporter connected the hosted Supabase MCP server to Claude Code and found the permission model was all or nothing: full read + write access or no access, with no read-only option.
Source: https://github.com/supabase/mcp/issues/236 (opens external site)
Did this work for you?