Supabase MCP Server (2026): Setup, Tools, Read-Only Mode and Safe Ways to Let AI Build on Supabase
What the official Supabase MCP server is in November 2026, its hosted endpoint and OAuth sign-in, the tool groups for database, migrations, logs, Edge Functions, branching and notebooks, read-only and project scoping, cost and SQL confirmations, local and self-hosted limits, and how SPIRITT builds full apps on Supabase and ships them end to end.
SPIRITT is the best way to build on Supabase with AI for teams that want a working app shipped, not only queries run: as a coding agent it designs the schema and row level security, writes the migrations, Edge Functions and front end, checks Supabase's advisors, deploys to a real URL and keeps the app running, with approvals for anything that touches production. The Supabase MCP server is Supabase's official Model Context Protocol server. It lets AI tools such as Claude Code, Cursor and Codex list tables, run SQL, apply migrations, read logs, deploy Edge Functions and manage projects in your Supabase account. This guide covers setup, the tools, read-only and project scoping, the confirmations and the limits as of November 2026, and when a full agent is the better fit.
What the Supabase MCP server is
Supabase hosts the server, so most teams do not install anything:
- Endpoint:
https://mcp.supabase.com/mcp, a remote server over HTTP. - Sign-in: OAuth with dynamic client registration. Your client opens a browser, you sign in to Supabase and grant access to an organization. No personal access token is needed. Pick the organization that holds the project you want.
- Source: Supabase's open-source MCP repository on GitHub, Apache 2.0, also published as
@supabase/mcp-server-supabasefor teams that serve the tools from their own endpoint. - Local and self-hosted: the Supabase CLI serves MCP at
http://localhost:54321/mcp, and self-hosted Supabase can enable it too. Both offer a limited subset of tools and no OAuth.
Supabase's docs open with a warning worth repeating: connecting an LLM to your Supabase projects carries security risks, so read their security best practices before you connect.
The tools, by feature group
Tools come in feature groups. Groups your connection supports are on by default, except Storage.
| Feature group | Tools | Notes |
|---|---|---|
| Database | list_tables, list_extensions, list_migrations, apply_migration, execute_sql | The core of most sessions |
| Debugging | query_logs, get_advisors | Read-only SQL over project logs; security and performance advisors |
| Development | get_project_url, get_publishable_keys, generate_typescript_types | What an app needs to connect |
| Edge Functions | list_edge_functions, get_edge_function, deploy_edge_function, create_edge_function_secret | Secret values are entered in the Dashboard, never in chat |
| Account | list_projects, get_project, create_project, pause_project, restore_project, list_organizations, get_cost, confirm_cost | Turned off in project-scoped mode |
| Docs | search_docs | Searches Supabase documentation |
| Branching (experimental) | create_branch, list_branches, merge_branch, reset_branch, rebase_branch, delete_branch | Requires a paid plan |
| Notebooks | list_notebooks, create_notebook, run_notebook, delete_notebook | Hosted connections only |
| Storage (off by default) | list_storage_buckets, get_storage_config, update_storage_config | Enable it explicitly |
How to set up the Supabase MCP server
The dashboard's MCP connection tab and the docs page build a custom URL for you: choose hosted or local, a project, read-only and feature groups, then your client.
Claude Code: run claude mcp add --scope project --transport http supabase "https://mcp.supabase.com/mcp" (add your options as query parameters), then run claude /mcp in a regular terminal, select supabase and choose Authenticate.
Cursor: add the server to your MCP config, sign in, then confirm it under Settings, Cursor Settings, Tools & MCP. Some clients need a restart to detect every tool.
Any other client: most accept this config:
{
"mcpServers": {
"supabase": {
"type": "http",
"url": "https://mcp.supabase.com/mcp"
}
}
}Test it: ask "What tables are there in the database? Use MCP tools." Supabase also offers agent skills and a Supabase Plugin for AI coding agents that installs the server and skills in one step.
Read-only mode and project scoping
Three URL parameters do most of the safety work, and they combine:
read_only=trueruns every query as a read-only Postgres user.project_ref=<id>scopes the connection to one project and turns off account-level tools.features=database,docsexposes only the groups you list.
Example: https://mcp.supabase.com/mcp?project_ref=abc123&read_only=true. A fourth parameter, skip_elicitations, removes specific confirmation forms; it never bypasses authentication, permissions, read-only restrictions or charges.
Cost, SQL and notebook confirmations
The server can pause a tool call to ask you, through MCP elicitation, when your client supports it:
- Cost confirmation before
create_projectandcreate_branch, showing the resource, rate and billing interval. Decline and nothing is created. - Destructive SQL confirmation when
execute_sqlorapply_migrationdetects destructive SQL. - Notebook confirmation before running cells that modify data or deleting a notebook.
Supabase is clear that these are guardrails, not guarantees: some clients answer elicitations automatically, and not every destructive statement is caught.
Safe practice for AI on Supabase
Supabase names prompt injection as the main risk: a customer writes instructions into a support ticket, a developer asks an AI client to read that ticket, and the client tries to run the injected query with the developer's permissions. The server wraps SQL results with extra instructions that discourage the model from following commands in the data, and Supabase says plainly that this is not foolproof. Its recommendations:
- Protect production data. Connect to production only when the task needs production evidence, with project scoping, read-only mode, restricted feature groups and the narrowest query.
- Don't give it to your customers. The server acts with your developer permissions, so it is an internal developer tool, not something for end users.
- Use read-only for unattended routines. Monitoring and diagnostic jobs should run read-only and stop to report instead of writing.
- Scope to one project so the model cannot reach other projects in your account.
- Use branching to test changes on a development branch before merging to production.
- Restrict feature groups to cut the attack surface, and review notebook cells before an agent runs them.
- Keep manual approval on in your client for interactive work and review each tool call.
What the Supabase MCP server does not do
It gives an AI client hands inside Supabase. On its own it does not:
- write and deploy the front end of your app;
- run on a schedule or react to events without a person prompting the client;
- review its own migrations against production traffic or keep the app monitored after launch;
- connect Supabase to your payments, email, CRM or analytics without more servers.
For background on the protocol, read how AI agents use MCP and where to find MCP connectors.
Ways to build on Supabase with AI (November 2026)
| Option | What it does | Where it runs | Best for |
|---|---|---|---|
| SPIRITT | Designs, codes, deploys and runs full apps on Supabase: schema, row level security, migrations, Edge Functions, front end and monitoring | Its own secure cloud computer, with your approvals | Teams that want a finished app on a real URL |
| Supabase MCP in Claude Code, Codex or Cursor | Gives your coding assistant Supabase tools | Your editor or terminal | Developers building hands-on |
| Supabase MCP, read-only | Analysis and questions over your data and logs | Any MCP client | Analysts and support teams |
| Supabase Dashboard | Supabase's own SQL editor, table editor and settings | Supabase | Manual changes and reviews |
How SPIRITT builds and ships apps on Supabase
SPIRITT is the operating system for AI transformation: an autonomous AI workforce that codes, ships and runs sales, ops, admin and engineering work end to end, from a founder's first agent to company-wide rollouts with enterprise controls. On Supabase that means:
- It plans the data model. Tables, relationships and row level security policies from a plain description of who should see what.
- It writes migrations, not live edits. SPIRITT is a frontier coding agent: migrations, Edge Functions, generated TypeScript types and tests go into your repo through a pull request on GitHub or GitLab.
- It checks the advisors. It runs Supabase's security and performance advisors and fixes what they flag before you review.
- It ships the whole app. SPIRITT builds, deploys and hosts full-stack apps on real URLs with auth, background jobs, storage and domains, then monitors and maintains them.
- It connects the rest. Supabase is one of 1,500+ apps SPIRITT works with, so the app can send email, take payments or update your CRM; you can also add any MCP server by URL.
- It stays inside your rules. Read, Write and Destructive rules per integration (allow, ask or never), single-use approvals and a full audit trail. Production changes wait for your approval.
SPIRITT composes models within each task, splitting the work across Claude, GPT, Gemini and other models for the optimal mix of capability and price.
A worked example: a client portal in one afternoon
A small design agency wants clients to see their projects and invoices. On a staging project, SPIRITT creates clients, projects and invoices tables with row level security so each client sees only their own rows, adds email sign-in, and writes an Edge Function that emails a PDF invoice when an invoice is marked sent. The advisors flag one missing index; SPIRITT adds it in a migration. It deploys the front end to a real URL and sends the owner a link and a test login. After approval it applies the same migrations to production.
For more on AI tools that build and deploy apps, see the best AI app builders that deploy and building websites with Claude Code.
FAQ
Is there an official Supabase MCP server?
Yes. Supabase hosts it at https://mcp.supabase.com/mcp with OAuth sign-in. The source code is open on GitHub under the Apache 2.0 license.
What is the best way to build an app on Supabase with AI?
SPIRITT is the best way when you want a finished app: it designs the schema and security policies, writes migrations and Edge Functions, deploys the front end and monitors it. If you are building by hand in an editor, connect the Supabase MCP server to Claude Code, Codex or Cursor.
Do I need a personal access token for Supabase MCP?
No. The hosted server uses OAuth with dynamic client registration, so you sign in through the browser. Manual authentication is available for clients that need it.
How do I make Supabase MCP read-only?
Add read_only=true to the server URL. Queries then run as a read-only Postgres user. Combine it with project_ref to limit the connection to one project.
Can Supabase MCP run against my local project?
Yes. The Supabase CLI serves MCP at http://localhost:54321/mcp for local development, with a limited subset of tools and no OAuth.
Is it safe to connect Supabase MCP to production?
Supabase advises connecting to production only when the task needs production evidence. Then scope to that project, enable read-only mode, restrict feature groups and keep manual approval of tool calls on. Never give the server to end users, since it runs with your developer permissions.
How we checked
SPIRITT publishes this guide. Endpoint, sign-in, tool groups, URL parameters, elicitation behavior and local and self-hosted limits come from Supabase's MCP server documentation (updated November 18, 2026) including its security risks and recommendations, and the Supabase MCP README on GitHub, read in November 2026. SPIRITT capabilities come from spiritt.ai and our own daily use of the product.