supabase-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@supabase-mcplist all tables in the public schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Supabase MCP
A secure remote Model Context Protocol server for the complete API surface of one self-hosted Supabase installation.
This project deliberately has no Supabase Cloud or Management API integration. It does not know about organizations, hosted projects, billing, branches, regions, or access tokens for api.supabase.com.
The production shape is a single Bun/TypeScript binary behind Caddy:
MCP client
│ HTTPS + OAuth 2.1 / scoped API key
▼
Caddy ── /mcp ──► supabase-mcp :4070
│
┌──────────────┼───────────────┐
▼ ▼ ▼
PostgreSQL local services control DB
+ pg-meta Auth/Storage/ OAuth, keys,
Realtime/Edge/ confirmations,
PostgREST/Logs auditWhat is covered
PostgreSQL schema discovery, policies, functions, extensions, advisors, migrations, parameterized read queries, and confirmed administrative SQL.
The complete local PostgREST, GoTrue/Auth, Storage, pg-meta, Realtime HTTP, Edge Functions, and Logflare APIs through service-specific, fixed-origin request tools.
Agent-friendly helpers for Auth users, Storage buckets/objects, Edge Function source/deployment, and live Realtime subscriptions.
Streamable HTTP MCP with sessions, SSE, tools, resources, prompts, protocol-version checks, Origin checks, credential-bound sessions, TTL, and capacity limits.
OAuth 2.1 Authorization Code with PKCE, Dynamic Client Registration, Protected Resource Metadata, refresh-token rotation, and optional login through the installation's own GoTrue OIDC provider.
Scoped operator API keys, scope-filtered tool discovery, encrypted human confirmation for destructive operations, and durable audit records.
OpenAPI 3.1, operator documentation,
llms.txt,llms-full.txt, CI, tests, and cross-compiled self-contained binaries.
The complete list of MCP tools is generated in docs/tools.md.
Quick start
Requirements: Bun 1.3+, PostgreSQL, and a self-hosted Supabase deployment.
bun install --frozen-lockfile
cp .env.example .env
# Fill every CHANGE_ME and point the service URLs at local/loopback services.
bun run devCheck:
curl http://127.0.0.1:4070/health
curl http://127.0.0.1:4070/ready
curl http://127.0.0.1:4070/openapi.jsonConfigure an MCP client:
{
"mcpServers": {
"supabase": {
"type": "http",
"url": "https://supabase.example.com/mcp"
}
}
}Standards-aware clients discover OAuth from the WWW-Authenticate challenge. For automation,
send an operator-created smcp_… key as either Authorization: Bearer … or X-API-Key: ….
OAuth access tokens are accepted only as Bearer tokens.
Security model
There are two PostgreSQL connections:
DATABASE_URLstores only MCP control-plane state (smcp_*tables).SUPABASE_TARGET_DATABASE_URLreaches the Supabase database for privileged operations.SUPABASE_TARGET_READONLY_DATABASE_URLshould use a read-only database role.
API keys and OAuth tokens are HMAC-hashed at rest. OAuth grants created through an API key remain
live-bound to that key: expiry or revocation invalidates their access and refresh tokens. Pending
destructive payloads are encrypted with AES-256-GCM. Tools are absent from tools/list unless the
credential has their scope. Service request tools select only an operator-configured base URL and
cannot become arbitrary network proxies. Supabase service-role and Logflare keys are never returned.
Destructive calls use a two-step flow:
The tool returns
human_confirmation_required, aconfirmation_id, and an expiring review URL.A human approves the exact encrypted operation in the browser.
The client retries the same tool and arguments with
confirmation_id.
Changing any argument invalidates the approval. Approval does not execute anything by itself.
Read docs/security.md before exposing the service to a network.
Scopes
Scope | Capability |
| Schemas, tables, policies, functions, extensions, migrations, advisors |
| SQL reads and PostgREST data operations |
| Administrative SQL and pg-meta mutations |
| Local GoTrue APIs |
| Local Storage APIs |
| Edge Function invocation and lifecycle |
| Realtime subscriptions, messages, and HTTP API |
| Local Logflare query API |
| Non-secret endpoint and capability information |
| Reserved for explicit secret-reading extensions; no secret is exposed by default |
| Reserved; host configuration remains GitOps-managed |
| Administrative ceiling; normalized to every supported scope |
Build
bun run gate
bun run build:binary
SUPABASE_MCP_BUN_TARGET=bun-linux-x64 OUTFILE=dist/supabase-mcp-linux-x64 ./build-binary.sh
./dist/supabase-mcp --versionbun build --compile embeds the runtime and dependencies. The service needs only the binary, environment file, and access to PostgreSQL/local Supabase endpoints.
HTTP endpoints
GET /health,GET /ready,GET /versionGET|POST|DELETE /mcpOAuth metadata under
/.well-known/*; endpoints under/mcp/oauth/*GET /docs,GET /openapi.json,GET /llms.txt,GET /llms-full.txtscoped operator API under
/api/v1/*expiring human reviews under
/mcp/confirm/:id
See docs/operators.md, docs/architecture.md, and the generated OpenAPI document.
Development
bun run format
bun run gateUnit and contract tests do not require Supabase. Integration and E2E tests are separated because they require local services. Contributions must preserve the fixed-origin upstream boundary and must not add Supabase Cloud APIs.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MikeBild/supabase-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server