Back to Blog

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 profiles vs auth users that never got a profile?”
  • “Subscriptions stuck in trialing older than 14 days — count by plan.”
  • “Any orders with null user_id that 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

  1. Supabase project → Project Settings → API
  2. Copy Project URL (https://….supabase.co)
  3. Copy service_role (not anon)

Option B — Direct Postgres URI

  1. Project Settings → Database → Connection string → URI
  2. Port 5432 (direct), not pooler 6543
  3. In Synra you’ll pick PostgreSQL and paste the URI

Step 2 — Save in Synra

  1. mcpserver.designConnectionsAdd
  2. Supabase (Option A) or PostgreSQL (Option B)
  3. Paste credentials → name it supabase-staging (be honest)
  4. TestSave
  5. 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):

  1. CustomizeConnectors (menus move; look for custom / MCP connectors)
  2. Add custom connector
  3. Name: Synra Supabase staging
  4. Paste the Synra URL
  5. Auth: none / as Synra docs — token is in the URL
  6. 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: