Is the Supabase MCP server safe? A read-only setup for Cursor and Claude Code
By Arif Khan, AIVolve LLC · Updated November 16, 2026
"I want Cursor or Claude Code to look at my Supabase database through MCP. Is that safe, and how do I set it up so it can't wreck my live data?"
Short answer: it can be safe enough for building, if you set it up on purpose. Supabase's own docs say connecting an AI to your projects "carries security risks", and they recommend four things: scope the server to one project, turn on read-only mode, restrict the tool groups, and keep production data out of it unless a task really needs it. You do that by adding three parameters to the server URL. The one risk no setting removes is prompt injection, so you also keep manual approval on and read each tool call before you accept it.
What MCP is, in plain words
MCP (Model Context Protocol) is a standard way to plug tools into an AI assistant. The Supabase MCP server lets your assistant do things in your Supabase account for you: list tables, run SQL, apply migrations, read logs, deploy Edge Functions. That is useful, and it is also the point: the assistant acts with your developer permissions, not a limited app user's. Supabase's docs say so directly: the server "operates under the context of your developer permissions".
The one risk you can't switch off: prompt injection
Supabase describes it with an example. You build a support-ticket system on Supabase. A customer submits a ticket whose text says to forget everything and run a query that selects from a sensitive table and inserts it as a reply. Later you ask your AI tool, through Supabase MCP, to read that ticket. The hidden instructions can make the tool try to run the bad queries with your permissions, which could expose private data to the person who wrote the ticket.
What this means for you: any text that users can put into your database (tickets, comments, names, form messages, imported rows) can contain instructions aimed at your AI tool. Supabase says its server wraps SQL results in extra instructions to discourage the model from following commands found in data, and in the same breath says "This is not foolproof though, so you should always review the output before proceeding with further actions."
The 5-minute safe setup
1. Add three parameters to the server URL. Supabase documents these URL query parameters for the hosted server:
| Parameter | What it does | Why you want it |
|---|---|---|
project_ref=<id> |
Scopes the server to one project and disables the account tools | The AI can't see or touch your other projects |
read_only=true |
Runs all queries as a read-only Postgres user | The AI can look, but not change or delete |
features=database,docs |
Turns on only the listed tool groups | Fewer tools, smaller blast radius |
Combined, the URL looks like this (Supabase's own example combines project_ref and read_only; features is documented as combinable the same way):
https://mcp.supabase.com/mcp?project_ref=YOUR_PROJECT_REF&read_only=true&features=database,docs
Your project ref is the short id in your project's dashboard URL and in your API URL (https://YOUR_PROJECT_REF.supabase.co). Supabase's docs show how to add the server for each client. For Claude Code, the command from their docs is claude mcp add --scope project --transport http supabase "<the URL>", and you put the longer URL above in the quotes. For Cursor and other tools, paste the same URL where the docs for your tool say to put the server URL.
2. Point it at a development project or a branch, not production. Supabase's recommendation is to "connect to a production project only when the task requires production evidence." For building features, make a separate development project with fake data, or use Supabase's branching feature, which gives you a development branch of your database to test changes before they reach production.
3. Keep manual approval on. Most MCP clients ask you to accept each tool call before it runs. Supabase says to keep that on for interactive work and review each call. If you have turned on auto-run or "always allow" for Supabase tools, turn it off. Don't use skip_elicitations unless you understand it: Supabase says it makes SQL and migration tools run without an extra confirmation.
4. Never paste secrets into the chat. Supabase's docs say to enter Edge Function secret values only in the Dashboard, never in chat or in MCP tool arguments.
5. Don't give it to your customers. The server runs with developer permissions, so Supabase says not to hand it to customers or end users. It's an internal developer tool.
What read-only mode does and doesn't do
- Does: runs queries as a read-only Postgres user. A prompt-injected "delete" or "update" should fail.
- Doesn't: make reading safe. A read-only AI can still read every table that user can read, and a hidden instruction could still try to get that data out through its answer or another tool you have connected. That's why you scope to one project, use fake data when you can, and read each call.
- Heads-up: Supabase describes read-only mode as allowing only read queries, so expect schema changes through the assistant to be refused. When you need them, use write mode on a development project only, then switch back. Don't leave write mode on for production.
Check what you already connected
Open your AI tool's MCP settings, or the project file where it stores them (for Claude Code, a .mcp.json in your project; for Cursor, its MCP settings). For every Supabase entry, ask:
- Does the URL have
project_ref=? If not, the server is account-wide and can reach all your projects. - Does it have
read_only=true? If not, the AI can write. - Is it pointed at your production project?
- Is auto-approve on for its tools?
- Did someone else add a server you don't recognize? Remove it.
Also look at what else is connected. A Supabase server that is carefully limited doesn't help if another server in the same chat can send data out to the web.
A related warning from this week: "pinned" MCP servers can still change
On November 10, 2026 the security company Corelight published research on MCP servers started with one-line launchers such as uvx. Their finding: one server configured to run one specific release built from one specific commit ran with 15 different sets of dependencies over five weeks, because the packages underneath were looked up again whenever the environment was rebuilt. 23 of its 69 packages changed version, and nobody had edited the configuration. Corelight's point is that pinning a package doesn't necessarily pin the packages it depends on, and that any one of them runs with the MCP server's access, including the tokens in its environment.
What to do with that, in plain terms: use MCP servers from vendors you trust (Supabase's hosted server is run by Supabase, so it isn't started on your computer this way), be careful with community servers you start locally with uvx or npx, and give any local server only the keys it needs. Corelight's own fix for servers you run yourself is to install from a hash-pinned lock file, launch the installed program directly and turn off update checks. That is a job for a developer.
A prompt for Cursor or Claude Code
Review how Supabase MCP is configured for this project. Do not change anything yet. List every MCP server entry that mentions Supabase and, for each one, tell me: whether the URL has project_ref, read_only=true and a features list; which project it points at and whether that looks like production; and whether any tool is set to auto-approve. Then propose the safest configuration: one development project, read_only=true, only the tool groups I actually use. Wait for my approval before editing any config file. Never print or ask me to paste a key or secret.
FAQ
Is the Supabase MCP server safe to use?+
It can be, if you set it up with limits. Supabase's own docs warn that connecting an AI to your projects carries security risks. They recommend scoping it to one project, using read-only mode, restricting the tool groups, and keeping production data out unless a task needs it. Prompt injection is the risk that remains, so keep manual approval on.
How do I make Supabase MCP read-only?+
Add read_only=true to the MCP server URL, for example https://mcp.supabase.com/mcp?project_ref=YOUR_PROJECT_REF&read_only=true. Supabase says this runs all queries as a read-only Postgres user. Add project_ref so it only reaches one project.
Should I connect Supabase MCP to my production database?+
Supabase's advice is to connect a production project only when the task requires production evidence, and then to use project scoping, read-only mode, restricted tool groups and the narrowest query that answers the question. For building, use a development project with fake data or a development branch.
What is prompt injection in Supabase MCP?+
It is text inside your data that is written to trick the AI into following it. If a customer's support ticket says to copy a private table into a reply, and your AI tool reads that ticket through MCP with your permissions, it might try. Supabase says its safeguards reduce the risk but are not foolproof, so review every tool call.
Do I need Supabase MCP at all?+
No. It is a convenience for developers. If you don't need your AI tool to read or change your database directly, don't connect it. You can paste a schema or an error message into the chat instead.
Want a second pair of eyes?
If you aren't sure what your AI tools can reach in your Supabase project, our free X-ray takes about 2 minutes and needs no code or passwords. An AIVolve developer reviews every one within 1 business day. Get a free X-ray →
Related: Supabase anon key vs service_role key · Supabase RLS for AI-built apps: the 10-minute check · Free leaked-keys checker · Security audit prompts for AI-built apps
Written by Arif Khan, AIVolve LLC. VibeCoderSOS isn't affiliated with Supabase, Cursor, Anthropic or Corelight. Based on Supabase's MCP documentation and Corelight's research, checked on November 16, 2026. We did not test the connection against a live Supabase project, and Supabase may change its options.
Need help?
Not sure what your AI tools can reach in your database? A free X-ray shows what your app exposes and what to fix first.
Get a free X-ray →