How to Connect Claude to Supabase with MCP
Connect Claude to Supabase via MCP: service role vs anon, RLS reality, staging project first, Synra endpoint into Claude connectors. Read-only gateway, table allowlists.
Supabase is Postgres plus Auth and a SQL editor. Claude is already where people ask for numbers. Usually the bridge is copy-paste from the dashboard.
With MCP, Claude runs read-only SQL on your project through a gateway URL. This is the Claude setup: credentials, RLS, connector UI. Cursor: Connect Cursor to Supabase. Shorter overview: Supabase MCP server.
Also: staging first, SELECT-only, table allowlists.
What you can ask once it’s connected
- “How many rows in
profilesvsauthusers that never got a profile?” - “Subscriptions stuck in
trialingolder than 14 days — count by plan.” - “Any
orderswith nulluser_idthat our RLS assumes is always set?”
Claude inspects schema, runs SELECT, answers from rows. Follow-ups don’t need another dashboard trip.
Service role vs anon (the Supabase-specific part)
| Key | Role | For Claude + Synra? | |-----|------|---------------------| | anon | Browser / RLS-limited | Usually too weak for ops questions | | service_role | Bypasses RLS | Common choice — treat like a password | | SELECT-only Postgres user | Your grants only | Best when you can create one |
If you paste anon and Claude “sees no rows,” that’s often RLS — not Synra broken.
Service role sees what RLS would hide from end users. Prefer a staging Supabase project, or a Postgres role with SELECT on specific tables, before production service role in chat. Where query results go still applies.
Step 1 — Credentials
Option A — Project URL + service role
- Supabase project → Project Settings → API
- Copy Project URL (
https://….supabase.co) - Copy service_role (not anon)
Option B — Direct Postgres URI
- Project Settings → Database → Connection string → URI
- Port 5432 (direct), not pooler 6543
- In Synra you’ll pick PostgreSQL and paste the URI
Step 2 — Save in Synra
- mcpserver.design → Connections → Add
- Supabase (Option A) or PostgreSQL (Option B)
- Paste credentials → name it
supabase-staging(be honest) - Test → Save
- Open table access — allow reporting tables, leave secrets/identity off if you can
Encrypted at rest. Claude only gets the MCP endpoint URL later.
Step 3 — Copy the MCP endpoint
Endpoints tab:
https://app.mcpserver.design/api/mcp/aB3xY7zQ9mNpLkRv2wTs
Treat the token like a password. Rotate if it hits Slack. Team sharing if more than you will use it.
Step 4 — Add to Claude
In Claude (web or desktop, with custom connectors):
- Customize → Connectors (menus move; look for custom / MCP connectors)
- Add custom connector
- Name:
Synra Supabase staging - Paste the Synra URL
- Auth: none / as Synra docs — token is in the URL
- Save and confirm tools appear (
list_tables,describe_table,query_table,execute_sql)
If tools don’t show: MCP troubleshooting.
Step 5 — Smoke test
- “List tables in this Supabase database.”
- “Describe
profiles.” - “How many signups in the last 7 days?” (use real table names after inspect)
- Deliberate write → should fail
Then verify against the SQL editor once.
Supabase habits that save pain
Staging project first. Free tier second project is cheaper than explaining a PII paste.
Don’t commit service role keys. Synra holds them; Claude holds the endpoint only.
RLS ≠ gateway read-only. RLS shapes what anon sees. Synra blocks writes at the gateway. Different layers.
auth schema. Questions about auth.users need a role that can read it — service role usually can; a tight custom role might not. Say so in the prompt if you’re limited.
Pooler flakiness. If Option B misbehaves, switch to direct 5432.
Same Synra URL elsewhere
One connection works in Cursor and ChatGPT if you paste the same endpoint. Separate endpoints if staging vs prod — don’t reuse names.
Credentials into Synra, endpoint into Claude, ask something you already know the answer to.
7-day trial: mcpserver.design.
Related reading:
- Connect Cursor to Supabase — same DB, Cursor
- MCP Server for Supabase — shorter overview
- Ask Claude About Your Database — plain-English workflow
- Point AI at a Read Replica — when you outgrow staging
- Share AI Database Access With Your Team — don’t Slack prod service-role endpoints
- Staging First — environment ladder