MCP server for self-hosted Supabase instances with 50+ database management tools
Most database access work still happens through a UI a human drives. Selfhosted Supabase MCP MCP server moves it into the conversation instead. MCP server for self-hosted Supabase instances with 50+ database management tools.
This project provides a Model Context Protocol (MCP) server designed specifically for interacting with self-hosted Supabase instances. It bridges the gap between MCP clients (like IDE extensions) and your local or privately hosted Supabase projects, enabling database introspection, management, and interaction directly from your development environment.
The server publishes 13 tools. What each one is for:
generate_typescript_types — Generates TypeScript types from the database schemarebuild_hooks — Restarts the pg_net worker (if used)get_logs — Retrieves recent log entries (analytics stack or CSV fallback)list_cron_jobs — Lists scheduled jobs (requires pg_cron extension)get_cron_job_history — Shows recent execution history for a cron joblist_vector_indexes — Lists pgvector indexes (requires pgvector extension)list_edge_functions — Lists deployed Edge Functionsget_edge_function_details — Gets details and metadata for an Edge Functionlist_edge_function_logs — Retrieves recent logs for an Edge FunctionStorage — The Storage tool exposed by this serverPrerequisites — The Prerequisites tool exposed by this serverSteps — 1. Clone the repository: bash git clone cd selfhosted-supabase-mcp 2. Install dependencies: bash bun install 3. **Build theBecause this one is hosted, setup is mostly authentication — you point your client at the endpoint and approve access. Nothing runs on your machine, so there is no runtime to keep patched.
Configuration is passed through the environment: SUPABASE_URL, SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY, DATABASE_URL, SUPABASE_AUTH_JWT_SECRET, ANON_KEY, SERVICE_ROLE_KEY, POSTGRES_HOST. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.
Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Selfhosted Supabase MCP's toolset — generate_typescript_types, rebuild_hooks, get_logs and 10 more — is a fair guide to whether it matches your workflow. It is maintained by HenkDz; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Selfhosted Supabase MCP's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| generate_typescript_types | Generates TypeScript types from the database schema |
| rebuild_hooks | Restarts the pg_net worker (if used) |
| get_logs | Retrieves recent log entries (analytics stack or CSV fallback) |
| list_cron_jobs | Lists scheduled jobs (requires pg_cron extension) |
| get_cron_job_history | Shows recent execution history for a cron job |
| list_vector_indexes | Lists pgvector indexes (requires pgvector extension) |
| list_edge_functions | Lists deployed Edge Functions |
| get_edge_function_details | Gets details and metadata for an Edge Function |
| list_edge_function_logs | Retrieves recent logs for an Edge Function |
| Storage | The Storage tool exposed by this server. |
| Prerequisites | The Prerequisites tool exposed by this server. |
| Steps | 1. **Clone the repository:** bash git clone <repository-url> cd selfhosted-supabase-mcp 2. **Install dependencies:** bash bun install 3. **Build the project:** bash bun run build This compiles the TypeScript source to Ja |
| Cursor | 1. Create or open the file .cursor/mcp.json in your project root. 2. Add the following configuration: |
{
"mcpServers": {
"selfhosted-supabase": {
"command": "npx",
"args": ["-y", "@smithery/cli"],
"env": {
"SUPABASE_URL": "your-value",
"SUPABASE_ANON_KEY": "your-value",
"SUPABASE_SERVICE_ROLE_KEY": "your-value",
"DATABASE_URL": "your-value",
"SUPABASE_AUTH_JWT_SECRET": "your-value",
"ANON_KEY": "your-value",
"SERVICE_ROLE_KEY": "your-value",
"POSTGRES_HOST": "your-value"
}
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
| Variable | Description | Required |
|---|---|---|
| SUPABASE_URL | Endpoint or connection string the server talks to. | Yes |
| SUPABASE_ANON_KEY | Credential the server authenticates with. | Yes |
| SUPABASE_SERVICE_ROLE_KEY | Credential the server authenticates with. | Yes |
| DATABASE_URL | Endpoint or connection string the server talks to. | Yes |
| SUPABASE_AUTH_JWT_SECRET | Credential the server authenticates with. | Yes |
| ANON_KEY | Credential the server authenticates with. | Yes |
| SERVICE_ROLE_KEY | Credential the server authenticates with. | Yes |
| POSTGRES_HOST | Endpoint or connection string the server talks to. | Optional |
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.