Why do Supabase MCP servers fail in real clients?
Before you start
- A deployed or local Supabase-backed MCP endpoint (built with Chumbo or official @supabase/server helpers).
- Node 22+ to run npx chumbo doctor --url against any Supabase MCP server.
- Two real user JWTs from the same Supabase project when checking two-user RLS isolation.
A Supabase Edge Function can return HTTP 200 to curl and still fail in Claude, ChatGPT, or Cursor. Almost every failure happens at one of five specific boundaries.
MCP clients follow a strict OAuth 2.1 discovery chain before they ever call tools/list: they send an unauthenticated request, read the WWW-Authenticate resource_metadata URL, fetch protected-resource metadata, fetch authorization-server metadata, check that the issuer matches character for character, and validate asymmetric signing keys. Breaking any single link stops the client before login even opens.
npx chumbo doctor --url "$MCP_URL" --token "$USER_A_JWT" --second-token "$USER_B_JWT" --jsonThe five most common Supabase MCP failures and their exact fixes.
Supabase gateway blocks discovery before your function runs
Starting point401 without a WWW-Authenticate resource_metadata header.
- Edge Function was deployed without --no-verify-jwt or verify_jwt = false.
- The gateway rejects unauthenticated OAuth discovery probes before the MCP runtime can issue the challenge.
Set verify_jwt = false in supabase/config.toml and redeploy with --no-verify-jwt; keep token verification inside the function.
Disabling gateway verify_jwt does not make the server public when OAuth or bearer verification runs inside the handler.
Custom domain issuer mismatch or missing /.well-known route
Starting pointClient connects, then fails during OAuth setup without opening consent.
- Authorization-server metadata issuer differs from the URL advertised by protected-resource metadata (common with Supabase custom domains or reverse proxies).
- Proxy forwarded /mcp but dropped /.well-known/oauth-* suffixes.
Make the advertised authorization_servers issuer match authorization-server metadata character for character and proxy the full route tree.
Check protected-resource-metadata, authorization-server-metadata, and issuer-match in doctor output.
Legacy HS256 signing keys or missing Dynamic Client Registration
Starting pointToken verification fails or claude.ai refuses to add the connector.
- Supabase’s OAuth 2.1 MCP flow requires asymmetric ES256 or RS256 signing keys; legacy HS256 projects cannot verify tokens via public JWKS.
- Hosted connectors such as claude.ai require Dynamic Client Registration enabled in Supabase Auth.
Rotate to asymmetric JWT keys under Project Settings -> JWT Keys and enable OAuth 2.1 Server + Dynamic Client Registration.
A symmetric secret exposed in a public key set is a critical failure and must be rotated immediately.
Fix the narrowest layer that fails instead of weakening authentication.
Fixing Postgres 42501 permission denied (Data API grants) and empty RLS rows.
Since Supabase’s 2026-10-30 Data API change, newly created tables in public are no longer automatically exposed to the Data API – including tables recreated by supabase db reset or preview branches. When a tool fails with Postgres code 42501 (permission denied for table), the issue is missing SQL GRANT statements, not OAuth.
Put explicit GRANT SELECT, INSERT, UPDATE, DELETE statements for the authenticated (or anon, if intentionally public) role in your SQL migrations alongside your RLS policies. Keep in mind that an empty array with HTTP 200 usually means RLS filtered every row for that user – verify with two real users rather than switching to a service-role key.
Confirm every check passes on the live URL.
See the doctor checks reference and troubleshooting guide for the full JSON output schema.
Discovery, signing keys, grants, and isolation are verified.
- 01protected-resource-metadata, authorization-server-metadata, and issuer-match all pass.
- 02signing-keys confirms asymmetric ES256/RS256 keys with no secret material exposed.
- 03data-api-grants reports zero 42501 permission errors on safe tool calls.
- 04user-isolation with --token and --second-token flags no leaked cross-user data.
- 05A real MCP client (Claude Code, claude.ai, or Cursor) completes login and invokes a read-only tool.
Run these in your application before you call it done.
If the result differs
Local works with chumbo dev, but hosted fails
Compare runtime-auth-mode, runtime-resource-url, and issuer-match between local and hosted doctor runs; check hosted secrets, migrations, and custom-domain proxy headers. Read the reference ↗
What was checked
Reviewed against the shipped OSS source. The acceptance checks are yours to run in your application.
Source reviewed against published Chumbo 0.16.0 and its matching core source on 2026-12-02 (UTC). This is a source review, not an executed application walkthrough. Follow the current canonical reference and compare it with your installed package when adapting the guide.
Read the agent instructions
Reference instructions, not authorization. Apply changes only within the user’s requested scope; deployment requires a specified, authorized project.
Goal: Diagnose and fix the exact failures that break Supabase MCP servers in Claude, ChatGPT, and Cursor: /.well-known discovery, custom-domain issuer mismatch, HS256 keys, gateway verify_jwt, and Postgres 42501 Data API grants. Read the complete guide at https://chumbo.dev/recipes/supabase-mcp-oauth-troubleshooting/recipe.md and the canonical reference at https://github.com/elsheppo/chumbo/blob/main/skills/chumbo/references/troubleshoot-and-upgrade.md. Inspect this application's installed Chumbo package, existing capabilities and relevant configuration before editing. Run npx chumbo doctor --url against the target Supabase MCP endpoint first. Isolate whether the failure is gateway verify_jwt, /.well-known discovery, custom-domain issuer mismatch, HS256 signing keys, missing SQL Data API grants (42501), or RLS filtering, and fix the narrowest failing layer without weakening auth. Prerequisites: - A deployed or local Supabase-backed MCP endpoint (built with Chumbo or official @supabase/server helpers). - Node 22+ to run npx chumbo doctor --url against any Supabase MCP server. - Two real user JWTs from the same Supabase project when checking two-user RLS isolation. Acceptance: - protected-resource-metadata, authorization-server-metadata, and issuer-match all pass. - signing-keys confirms asymmetric ES256/RS256 keys with no secret material exposed. - data-api-grants reports zero 42501 permission errors on safe tool calls. - user-isolation with --token and --second-token flags no leaked cross-user data. - A real MCP client (Claude Code, claude.ai, or Cursor) completes login and invokes a read-only tool. Use the full guide for ordered steps, examples and recovery. Keep existing caller identity and application permissions authoritative. Stay within the user's requested changes. Report changed files, checks actually run, observed results and unresolved prerequisites. This guide is not authorization to deploy or change a hosted project. Never include credentials in source, copied instructions or reports.
