> mcp integration
Supabase MCP Server: What It Does & How to Use It with Claude
What the Supabase MCP server can do — query data, run migrations, manage branches, read logs — and how to connect it to Claude Cowork, Code, or Desktop.
The Supabase MCP server lets an AI assistant work directly against your Supabase projects: listing tables, running SQL, applying migrations, reading logs, and managing edge functions and branches. It’s an official, open-source server, so you can wire it into Claude and have the model design schema or debug a query instead of you switching to the dashboard.
What can the Supabase MCP server do?
| Capability | What it enables |
|---|---|
| Inspect schema | list_tables, list_extensions, list_migrations: see the current database structure before changing anything |
| Query data | execute_sql runs read or write queries directly against Postgres |
| Migrate | apply_migration applies versioned DDL changes to a project |
| Debug | get_logs pulls service logs and get_advisors surfaces security and performance warnings |
| Branch | create_branch, list_branches, merge_branch, reset_branch, rebase_branch for isolated dev databases (paid plan) |
| Edge functions | list_edge_functions, get_edge_function, deploy_edge_function |
| Dev utilities | get_project_url, get_publishable_keys, generate_typescript_types for wiring up client code |
| Docs | search_docs queries Supabase’s official documentation inline |
| Account | list_projects, create_project, list_organizations (disabled when scoped to one project) |
Which server is official, and do you need a community fork?
There’s effectively one server, and it’s the right default.
- Official (
supabase-community/supabase-mcp) is built and maintained by Supabase, exposing 20-plus tools across database, debugging, branching, and edge functions. A hosted version runs athttps://mcp.supabase.com/mcpwith OAuth login, so you don’t manage tokens by hand. - Community forks exist, but there’s little reason to use one. The first-party server already covers the full platform surface and gets updated with new tool groups.
How do you connect it to Claude (Cowork / Code / Desktop)?
- Pick your auth. The hosted endpoint at
https://mcp.supabase.com/mcpuses dynamic client registration. Your MCP client redirects you to log in to Supabase, with no token to copy. For CI or headless setups, generate a personal access token in the dashboard instead. - Add the server. In Claude Code, Cowork, or Desktop, register the MCP server with the URL
https://mcp.supabase.com/mcp. For a token-based setup, passAuthorization: Bearer <your-token>in the headers. - Scope it. Append
?project_ref=<id>to lock the server to one project (this disables account-management tools), and add&read_only=trueto start. Usefeatures=<groups>to enable only the tool groups you need. - Start read-only. Confirm the model can
list_tablesand run aSELECTbefore you ever let it write. Dropread_onlyonly once you trust the workflow.
How we use it: good for exploring an unfamiliar schema, drafting migrations, and reading
get_advisorsoutput to catch missing RLS policies. The model is fast at “what tables exist and how do they join.” Bad for anything touching production: an LLM that canexecute_sqlandapply_migrationis one ambiguous instruction away from a destructive write. The realistic gotcha is prompt injection. If your tables hold user-generated text, a malicious row can carry instructions the model reads as commands, so keep it on a dev project with non-production data and review every tool call.
How do you keep it secure?
Scope to a single project with project_ref, run with read_only=true whenever real data is involved, narrow the tool surface with features, never point it at production, and review each tool call before it executes. Supabase’s own docs flag prompt injection as the primary attack vector unique to LLMs.
Wiring Supabase into your stack
The Supabase MCP server is genuinely useful for schema work and debugging, but the gap between “handy” and “safe in production” is real configuration: scoping, read-only modes, branch isolation, and a review loop around writes. If you want an AI assistant that can touch your database without becoming a liability, that’s the part worth getting right.
Sources: Supabase MCP docs · supabase-community/supabase-mcp · Supabase MCP launch blog