Supabase MCP Server
## what it does
tl;dr: Supabase’s official MCP supports both remote and local. The remote https://mcp.supabase.com/mcp is the easiest install and gets new tools first. The local TypeScript server is @supabase/mcp-server-supabase (v0.12.0 at the time of writing, 109,666 weekly downloads, Apache-2.0). The Supabase repo is supabase/mcp (2.9k stars).
Install (remote — recommended)
{
"mcpServers": {
"supabase": {
"type": "http",
"url": "https://mcp.supabase.com/mcp"
}
}
}
OAuth consent happens in your MCP client the first time. You’ll be asked which Supabase org to authorize.
Install (local)
For self-hosted Supabase or strict-network environments, the local server reads the same env-driven options.
npx -y @supabase/mcp-server-supabase@latest
or, in a Supabase dashboard:
- Open your project → Connect → top tab MCP.
- Copy the URL the dashboard generates (it pre-fills
project_refand a default feature set).
URL parameters
The remote URL accepts these query params; the local server reads the matching env vars.
| Param | Env | Effect |
|---|---|---|
project_ref | PROJECT_REF | Lock the server to one project — removes project_id from tool inputs and excludes account-level tools. |
read_only | READ_ONLY | Exclude mutating tools. Default false. |
features | FEATURES | Comma list of feature groups (e.g. database,docs). |
Example: https://mcp.supabase.com/mcp?project_ref=<ref>&read_only=true&features=database,docs.
AI SDK integration
The package exports createToolSchemas() so Vercel AI SDK’s MCP client can populate typed input/output schemas client-side. Use the matching options (features, projectScoped, readOnly) to filter.
import { createMCPClient } from '@ai-sdk/mcp';
import { createToolSchemas } from '@supabase/mcp-server-supabase';
const mcpClient = await createMCPClient({
transport: { type: 'http', url: 'https://mcp.supabase.com/mcp' }
});
const tools = await mcpClient.tools({
schemas: createToolSchemas({ features: ['database', 'docs'], readOnly: true })
});
Self-hosting
The package exports createSupabaseMcpHandler() so you can serve the same tools behind your own endpoint. The handler speaks the current protocol revision only (legacy: 'reject'). When platform carries a per-request credential, create a handler per request and close() it on res.close — sharing one handler across requests forces every request through that single credential.
CLI Supabase (supabase start) exposes MCP at http://localhost:54321/mcp with a limited subset of tools and no OAuth 2.1.
Gotchas
- Read Supabase’s security best practices before pointing the agent at production. The default feature set includes destructive tools.
- Self-hosted Supabase MCP is a limited subset today (no OAuth 2.1).
- The server does not send
structuredContentin tool results; the AI SDK falls back to JSON-parsing thecontenttext.
Related
- PostgreSQL MCP — direct DB (the Anthropic reference is archived)
- Notion MCP — workspace docs
- MCP Servers Explained
## compatibility
## exposed tools
## embed this badge
