Supabase MCP server: setup, read-only mode, tools and fixes

Supabase's MCP server at mcp.supabase.com: setup in Claude Code, Cursor and Codex, read-only and project scoping, its tools, safety rails, and common fixes.

Updated

Short answer

Supabase runs an official MCP server (a connector that lets an AI agent use your Supabase projects) at https://mcp.supabase.com/mcp. Add it to your client and sign in to Supabase in your browser, picking the organization that holds your project. In Claude Code:

claude mcp add --transport http supabase "https://mcp.supabase.com/mcp?project_ref=abc123&read_only=true"

Then run /mcp and choose Authenticate. It's free on every Supabase plan and needs no token. Supabase's own advice is to scope it to one project and keep it read-only unless the task needs writes, which the two parameters above do. Add Supabase through Upsy if you want a level per agent, several organizations in one connection, and a history of what each agent ran.

Supabase's MCP server

Address https://mcp.supabase.com/mcp (Streamable HTTP)
Sign-in OAuth with dynamic client registration, or a personal access token as Authorization: Bearer
Organizations One per sign-in, chosen on Supabase's consent page
Plans Every Supabase plan. Branching tools need a paid plan
Code supabase/mcp (moved from supabase-community in June 2026), v0.21.0 on November 26, 2026
Docs Supabase MCP docs, which have a panel that builds the address and command for your client

Personal access tokens are now scoped by default, and Supabase's token docs list the permission each MCP tool needs: execute_sql needs Database read, apply_migration needs Migrations read-write. A token can only narrow what your account can do.

Connect it to your client

Claude Code. Run the command above, then /mcp. Or install the plugin: claude plugin install supabase@claude-plugins-official.

Cursor. Add {"mcpServers":{"supabase":{"url":"https://mcp.supabase.com/mcp"}}} to .cursor/mcp.json, or type /add-plugin supabase.

VS Code. In .vscode/mcp.json: {"servers":{"supabase":{"type":"http","url":"https://mcp.supabase.com/mcp"}}}.

Codex. codex mcp add supabase --url "https://mcp.supabase.com/mcp", then codex mcp login supabase.

Claude. Supabase has been in Claude's connector directory since February 2026. Open the connectors menu and pick Supabase.

ChatGPT. Supabase's app has been in ChatGPT's directory since May 2026.

CI and headless agents. Use a personal access token: put ?project_ref= on the address and send Authorization: Bearer <token>. Not every client can send headers.

npx plugins add supabase-community/supabase-plugin installs the server plus Supabase's agent skills in one step.

Scope it with the address

Parameter What it does
read_only=true Runs SQL as a read-only Postgres user, and hides every tool that changes something
project_ref=abc123 One project only. Removes the account tools (list_projects, create_project and the cost tools)
features=database,docs Only these tool groups
skip_elicitations=execute_sql,apply_migration Skips Supabase's confirmation forms for those tools

Combine them with &. Supabase's security policy points out that read_only is a flag the client sends, so anyone who can edit the client's config can drop it. For a hard limit, use a personal access token with read permissions only.

Its tools

Version 0.21.0 defines 42 tools in ten groups. Every group is on by default except Storage, and notebooks exist only on the hosted server.

Group Read Change
Account list_organizations, get_organization, list_projects, get_project, get_cost, confirm_cost create_project, pause_project, restore_project
Database list_tables, list_extensions, list_migrations execute_sql, apply_migration
Debugging get_issues, get_logs, query_logs, get_advisors
Development get_project_url, get_publishable_keys, generate_typescript_types
Edge Functions list_edge_functions, get_edge_function deploy_edge_function, create_edge_function_secret
Branching (paid plans) list_branches create_branch, delete_branch, merge_branch, reset_branch, rebase_branch
Storage (off by default) list_storage_buckets, get_storage_config update_storage_config
Notebooks list_notebooks, get_notebook create_notebook, run_notebook, delete_notebook
Docs and feedback search_docs submit_feedback, delete_feedback
  • execute_sql runs any SQL you or the agent writes, including DROP and DELETE, unless the connection is read-only. Then it stays, running as the read-only user.
  • Blog posts that say 29 or 32 tools describe earlier versions.

Supabase's safety rails

  • Confirmation forms. In clients that show MCP forms, Supabase asks before destructive SQL, before a project or branch that costs money, and before notebook runs. In clients that don't, SQL runs without that extra prompt; read-only mode and permissions still apply.
  • Untrusted data. Results from execute_sql and the log tools come wrapped in <untrusted-data-…> tags telling the model not to follow instructions inside. Supabase says plainly this isn't foolproof.
  • Production. Supabase's guidance: "Connect to a production project only when the task requires production evidence." Use a development project or a branch otherwise.
  • Not for end users. Supabase says not to give this server to your customers. For an MCP server for your own app's users, see its bring-your-own MCP guide.

Where Supabase's server stops

  • One organization per sign-in. Several projects in different organizations need separately named server entries.
  • Read-only is all or nothing. It's per address, so a second agent with write access needs its own entry.
  • The forms depend on the client. Through a client without forms, the destructive-SQL prompt doesn't appear.
  • Each client keeps its own record of what ran.

For one project in one or two clients, Supabase's server with project_ref and read_only is enough.

Supabase MCP servers compared

Hosted server Supabase CLI (local) Self-hosted Studio Upsy Postgres MCP Pro
Address mcp.supabase.com/mcp http://localhost:54321/mcp after supabase start /mcp on your gateway upsy.ai/connect Runs on your machine
Sign-in OAuth or token None None; denied by default OAuth to Upsy; Upsy signs in to Supabase A Postgres connection string
Tools All groups Docs, database, development, debugging Studio's own set Supabase's, with a level per agent Postgres health, indexes, queries
Limits read_only, project_ref, features Local data only Keep it off the internet Read-only, picked tools or all, per agent Its own restricted mode
  • Self-hosted Supabase: Studio serves the server, but there's no OAuth, so Supabase says to reach it through an SSH tunnel, such as ssh -L localhost:8080:localhost:8000 you@your-host, and point your client at http://localhost:8080/mcp.
  • @supabase/mcp-server-supabase is still published for stdio, with --access-token, --project-ref, --read-only and --features, but the docs now lead with the hosted server.
  • crystaldba/postgres-mcp works on any Postgres, Supabase included. Its last release is from May 2025.
  • @modelcontextprotocol/server-postgres is archived and unmaintained. Don't use it.

Upsy's Supabase MCP server

Upsy connects to Supabase's hosted server with your Supabase sign-in, at the same address as Upsy's other apps, https://upsy.ai/connect.

What it adds:

  • A level per agent. Read-only, Pick actions or Full access for each agent, enforced by Upsy whatever the client does.
  • Up to five Supabase organizations in one connection: Supabase allows one per sign-in, and each Upsy account is its own sign-in.
  • Every client, including ChatGPT, Grok and Muse, without setting Supabase up in each.
  • History and alerts: every Supabase tool an agent runs, refused attempts included, under that agent.

How it behaves, honestly:

  • Upsy's built-in connector uses the default address: every group but Storage, and every project in the organization you picked.
  • Upsy's Read-only doesn't include execute_sql. Upsy never counts a tool named "execute" as read-only, so Read-only means tables, migrations, logs, advisors, types and docs, but no queries.
  • Upsy doesn't show Supabase's confirmation forms, so destructive SQL runs without Supabase's extra prompt. Your client's approval and Upsy's limits are the checks.

For read-only SQL, add Supabase to Upsy as an MCP server with the scope in its address, and give the agent Full access there. Supabase then enforces read-only itself, and since the address lives in Upsy, an agent can't drop read_only from it:

https://mcp.supabase.com/mcp?project_ref=abc123&read_only=true

Connect Supabase to Upsy

  1. Go to upsy.ai and click Set up Upsy.
  2. Open Apps, click Connect an app and pick Supabase. On Supabase's consent page, choose the organization. For another organization, click Add account next to Supabase.
  3. For a scoped server instead, click Add on the MCP Server card under Any MCP server, paste the address above as the MCP Endpoint, and sign in, or paste a scoped personal access token under API key or token. It starts off for every assistant; turn it on where you need it.
  4. On the Assistants page, click Add assistant and choose your client under Which assistant?. In Claude Code: claude mcp add --transport http --scope user upsy https://upsy.ai/connect, then /mcp. In Claude and ChatGPT, add https://upsy.ai/connect as a custom connector (Claude, ChatGPT).

Check that it works

Using Upsy, list my Supabase projects, then the tables in the public schema of the first one.

The agent should call list_projects, then list_tables. Both show in Upsy's History under that agent.

Picking Supabase tools

With Pick actions, a sensible start for a coding agent is every read tool plus execute_sql on a read-only scoped server. Add apply_migration only on a development project or a branch. Leave out create_project, pause_project, delete_branch and deploy_edge_function unless the agent should do exactly that. A tool Supabase adds later stays off until you tick it.

Troubleshooting

{"message":"Unrecognized client_id"}, or "Needs authentication"

Supabase drops a client registration that isn't approved within about 15 minutes, and the client keeps using the old one (issue #355). In Claude Code, run claude mcp logout supabase (or the plugin's name, plugin:supabase:supabase), then connect again.

"Access to project '…' was denied. … select the organization that owns this project"

You picked another organization at sign-in. Sign out of the server, sign in again and choose the organization that owns the project.

{"message":"resource: Resource must be a valid MCP endpoint"}

Seen with ?project_ref=…&read_only=true in Claude Code's VS Code extension, which encodes the address twice (issue #338). Add the server from the Claude Code CLI instead.

VS Code: "Error getting token from server metadata"

Run Remove Dynamic Authentication Providers from the command palette, then add Supabase again. Or use a personal access token in a header.

You sign in again every day

Some clients fail to refresh Supabase's tokens; Codex shows "OAuth token refresh failed: Failed to parse server response" (issue #276). Until it's fixed, use a personal access token.

"Invalid or expired requestState", or a confirmation that returns cancelled

A confirmation form expired or your client didn't show it. Answer it sooner, or add skip_elicitations=execute_sql,apply_migration to the address.

Local localhost:54321/mcp keeps asking you to sign in

The local server needs no sign-in. Skip Authenticate and restart your client.

"The user hasn't allowed you to use Supabase's "execute_sql""

That's Upsy refusing execute_sql because Supabase is Read-only for the agent. Use a scoped read_only=true server with Full access, or tick execute_sql under Pick actions.

Security and privacy

  • Every option acts as you, with your role in the organization you picked.
  • Start scoped: project_ref and read_only=true on a development project, and give write access only for a task that needs it.
  • Keep approvals on in your client for execute_sql, apply_migration and anything in Branching. Supabase asks for manual approval in interactive work.
  • Prompt injection. A row in your database, such as a support ticket, can carry instructions aimed at the agent. That's the attack Supabase warns about most.
  • Tokens in config files act for your account until you revoke them. Prefer OAuth, or a scoped token with only the permissions the tools need.
  • Through Upsy, agents never get your Supabase token: they call Upsy, and Upsy calls Supabase. Upsy emails you when one agent reads 100 or more times or deletes 50 or more items in 10 minutes, and when a new agent or app connects.

FAQ

What is the Supabase MCP server URL?

https://mcp.supabase.com/mcp, over Streamable HTTP with OAuth. Add ?project_ref= and &read_only=true to scope it.

Is the Supabase MCP server free?

Yes, on every Supabase plan. Branching tools need a paid plan, and creating projects or branches can cost money, which Supabase asks you to confirm.

How do I make Supabase MCP read-only?

Add read_only=true to the address. SQL then runs as a read-only Postgres user, and tools that change things are hidden.

Do I need a personal access token?

No. OAuth is the default. Use a token for CI or clients without OAuth, sent as Authorization: Bearer.

Can the Supabase MCP server delete data?

Yes, through execute_sql or apply_migration, unless the connection is read-only. Branch deletes and storage changes have their own tools.

Does it work with local or self-hosted Supabase?

Yes. The Supabase CLI serves a smaller server at http://localhost:54321/mcp, and self-hosted Studio serves one at /mcp, both without OAuth.

Can I connect two Supabase organizations?

Yes, with two sign-ins: two server entries in your client, or two accounts in one Upsy connection.