Supabase MCP
Supabase's official MCP server — run SQL and migrations, read logs and advisors, generate types, and deploy Edge Functions, with read-only and project scoping.
Supabase's official MCP server (hosted, Apache-2.0) lets agents work a Supabase project end to end: execute_sql and apply_migration, list tables and extensions, fetch service logs and security/performance advisors, generate TypeScript types, deploy Edge Functions, and manage branches. URL params scope it down — project_ref pins one project, read_only=true disables every mutating tool.
Supabase MCP gives agents the whole Supabase loop — schema, SQL, logs, advisors, types, Edge Functions — through one official server. The standout design choice is scoping by URL: ?project_ref= pins the server to one project and &read_only=true flips it to a read-only Postgres role with every mutating tool disabled, so the safety posture is visible in the config itself.
Highlights
- Database work end to end —
execute_sqlfor queries,apply_migrationfor tracked DDL, plus table/extension/migration listings. - Debugging with ground truth —
get_logsper service (API, Postgres, Edge Functions) andget_advisorssurfacing Supabase's security and performance findings for the agent to fix. - Codegen and deploy —
generate_typescript_typesfrom the live schema; list, read, and deploy Edge Functions. - Branching on paid plans — create/merge/reset/rebase database branches, the Supabase-native way to let an agent experiment off-prod.
- Hosted with OAuth —
mcp.supabase.com/mcp(Streamable HTTP, dynamic client registration); a limited local variant ships in the Supabase CLI atlocalhost:54321/mcp.
In an AI-assisted workflow
claude mcp add --transport http supabase \
"https://mcp.supabase.com/mcp?project_ref=<your-project>&read_only=true"
# /mcp → supabase → Authenticate, then:
# > Check the advisors and slow queries on this project and propose the top 3 fixesStart read-only: advisors, logs, and EXPLAIN-style analysis cover most day-to-day value. Granting writes is a deliberate second step — ideally against a branch, with apply_migration so changes land as tracked migrations rather than ad-hoc DDL.
WARNING
An agent with execute_sql against production is a footgun with OAuth. Default to read_only=true, pin project_ref, do write work on branches, and put ask rules on the mutating tools in your permissions. Supabase's docs say the same thing louder.
Good to know
Apache-2.0, developed in the open at supabase/mcp (the repo moved from supabase-community/supabase-mcp as it became fully official), and still flagged pre-1.0 — expect some breaking changes. The hosted endpoint is free with a Supabase account; the branching tool group requires a paid plan. For Postgres that isn't Supabase, see Postgres MCP Pro.
Frequently asked questions
- How do I connect Supabase to Claude Code?
- Add the hosted server and authenticate: claude mcp add --transport http supabase "https://mcp.supabase.com/mcp?project_ref=<your-project>&read_only=true", then /mcp → Authenticate (OAuth). For CI, pass a personal access token as an Authorization: Bearer header instead of the OAuth flow.
- What can agents do through the Supabase MCP server?
- Grouped feature sets: database (execute_sql, apply_migration, list_tables/extensions/migrations), debugging (get_logs per service, get_advisors for security and performance findings), development (generate_typescript_types, project URL and keys), functions (list/get/deploy_edge_function), docs search, account-level project management, and branching on paid plans.
- Is it safe to point it at production?
- Supabase's own docs lead with the warning: don't connect it to production with write access. Use read_only=true (it switches to a read-only Postgres user and disables mutating tools), scope to one project with project_ref, and review tool calls — execute_sql on a prod database is exactly as dangerous as it sounds.
Related
- The Best MCP Servers in 2026The MCP servers actually worth connecting in 2026 — Context7, GitHub, Chrome DevTools, Playwright, Serena, Exa, Firecrawl, and the best official vendor servers, by use case.
- Adding MCP Servers to Claude Code: Local, Remote, and Project-ScopedThe complete claude mcp add reference — stdio vs HTTP transports, local/project/user scopes, .mcp.json with env expansion, OAuth via /mcp, and the gotchas.
- Postgres MCP ProThe maintained Postgres MCP server — safe SQL execution, EXPLAIN with hypothetical indexes, workload-driven index tuning, and database health checks.
- DB MigrateGenerate and apply a database migration the safe way — using the project's migration tool, with expand-contract discipline for breaking changes, lock-free DDL, and a reversible up/down.
- Postgres Migration EngineerUse this agent to plan and execute a zero-downtime Postgres schema migration — decomposing a breaking change into expand-contract steps, writing batched backfills, building indexes CONCURRENTLY, validating constraints online, and keeping every step reversible with the project's migration tooling. Examples — "add a NOT NULL column to a 200M-row table without downtime", "rename a column safely across a rolling deploy", "split this risky migration into reversible expand/contract steps".
- Scaffold a pgvector Schema & HNSW IndexScaffold a production-ready pgvector schema and HNSW index for a corpus — matching the project's migration tooling, distance metric, and embedding dimensions.