Supabase — Claude Code MCP server: what it does, how to install
Connects Supabase projects to AI coding tools over MCP. Allows assistants to inspect database schemas and query project tables.
claude mcp add --transport http mcp https://mcp.supabase.com/mcpWhat Supabase does
The server links AI assistants to hosted or local Supabase instances using HTTP or local stdio via @supabase/mcp-server-supabase. It talks to the database directly. The model can inspect table structures and fetch rows without manual context pasting.
Parameters like read_only=true block mutating calls, while features narrows the active tools to specific domains. Local Supabase CLI instances at http://localhost:54321/mcp and self-hosted deployments omit OAuth 2.1 and offer a reduced set of tools.
For custom integrations, the package exports createToolSchemas for Vercel AI SDK and createSupabaseMcpHandler for self-hosted endpoints. The server does not send structuredContent in tool results, meaning clients parse JSON directly from message text.
What it helps with
- inspect database schemas and table definitions
- execute SQL queries directly from an assistant prompt
- restrict AI tools to safe read-only operations
- retrieve project configuration parameters
Example prompts for the agent
- Inspect the schema for the profiles table in my Supabase project.
- Query the latest ten signups from the users table.
- Connect to Supabase in read-only mode and list all active tables.
How to install Supabase
1Platform CLI: remote server
claude mcp add --transport http mcp https://mcp.supabase.com/mcp2Platform CLI
claude mcp add --env SUPABASE_ACCESS_TOKEN=<SUPABASE_ACCESS_TOKEN> --transport stdio mcp-server-supabase -- npx -y @supabase/mcp-server-supabaseReplace <…> with your own values
1Platform CLI: remote server
codex mcp add mcp-server-supabase --url https://mcp.supabase.com/mcp2Platform CLI
codex mcp add mcp-server-supabase --env SUPABASE_ACCESS_TOKEN=<SUPABASE_ACCESS_TOKEN> -- npx -y @supabase/mcp-server-supabaseReplace <…> with your own values
Config file
{
"mcpServers": {
"mcp-server-supabase": {
"url": "https://mcp.supabase.com/mcp"
}
}
}{
"mcpServers": {
"mcp-server-supabase": {
"command": "npx",
"args": [
"-y",
"@supabase/mcp-server-supabase"
],
"env": {
"SUPABASE_ACCESS_TOKEN": "<SUPABASE_ACCESS_TOKEN>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mcp-server-supabase": {
"type": "http",
"url": "https://mcp.supabase.com/mcp"
}
}
}{
"servers": {
"mcp-server-supabase": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@supabase/mcp-server-supabase"
],
"env": {
"SUPABASE_ACCESS_TOKEN": "<SUPABASE_ACCESS_TOKEN>"
}
}
}
}Replace <…> with your own values
1Platform CLI: remote server
gemini mcp add -t http mcp-server-supabase https://mcp.supabase.com/mcp2Platform CLI
gemini mcp add -e SUPABASE_ACCESS_TOKEN=<SUPABASE_ACCESS_TOKEN> mcp-server-supabase npx -y @supabase/mcp-server-supabaseReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Supabase
How to install Supabase in Claude Code?
Connect to the hosted endpoint by running claude mcp add --transport http mcp https://mcp.supabase.com/mcp. For stdio execution with your token, run claude mcp add --env SUPABASE_ACCESS_TOKEN=<SUPABASE_ACCESS_TOKEN> --transport stdio mcp-server-supabase -- npx -y @supabase/mcp-server-supabase.
What does the Supabase MCP server do?
It exposes project inspection and database querying tools to LLM assistants. The model can view table schemas, read records, and verify settings without switching windows.
What are the limitations of running Supabase MCP locally with the CLI?
The local endpoint at http://localhost:54321/mcp does not support OAuth 2.1. CLI and self-hosted environments also include a restricted subset of tools compared to the hosted endpoint.