← Back to directory
S

Self-Hosted Supabase MCP Server

Community
A database management MCP server for self-hosted Supabase.
Category
Database #74 of 86
Stars
★ 137 Popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Bun 1.1+
Credentials
API key / credential required
Last commit
⚠
Tools
43
44FMRS · D

The README describes a TypeScript/Bun MCP server for self-hosted Supabase and lists tools for databases, auth, Storage, Realtime, and Edge Functions, with client configuration examples. The repository description does not identify it as an official project; the README states that it is MIT licensed.

Strongest · Documentation 12/20 Weakest · Maintenance 5/20

Reliability
8/20
Security and permissions
9/20
Maintenance
5/20
Documentation
12/20
Setup experience
10/20
Why each score
Reliability 8/20
The README lists MCP tools, transports, startup dependencies, and notes that some tools can still work when direct database access is unavailable. It gives some visibility into failure cases. However, no manifest or source files are available to verify implementations, initialization and tool-list handshakes, tool parameters, tests, or CI. Automatic creation of the SQL helper and multiple access paths are additional unverified failure points, so the plausible-path score is limited.
Security and permissions 9/20
The README describes JWT validation, role-based access, rate limits, CORS, and timeouts for HTTP mode. It also discloses that stdio has no authentication and that privileged tools, including arbitrary SQL and user management, have side effects. Deductions reflect the absence of per-call confirmation for privileged actions, unrestricted tool access in stdio mode, and reliance on deployment choices for credential and transport protection. Without source files, the controls cannot be verified. The supplied evidence does not show a listed red-line issue.
Maintenance 5/20
The supplied material gives current stars, open issue count, and unarchived status, and the README claims an MIT license. It provides no evidence of commits, releases, dependency updates, maintainer responses, or a security contact, so maintenance continuity and governance transparency score low.
Documentation 12/20
The README covers the tool list, configuration, permissions, common deployment patterns, and several MCP client examples. It also discloses prerequisites such as direct database access and the migrations table. Deductions reflect missing tool parameter details, a compatibility matrix, verifiable troubleshooting guidance, and cost or resource limits. The examples and capability claims cannot be checked against source files.
Setup experience 10/20
The README provides Bun installation and build steps, stdio and HTTP launch examples, and configuration examples for Cursor, VS Code, and other clients. These help users plan a connection. Deductions reflect the manual installation and build steps and the need to configure several keys or a database connection. No manifest or committed test/CI evidence is available to show that installation and client connectivity were verified, so the static-review cap applies.

Static review · not runReviewed 2026-11-29

Read the FMRS scoring method →

Fit and risk

What it can accessUses the networkChanges third-party account dataConnects to a database

Best for

  • Developers running self-hosted Supabase who want to inspect or manage a project from an MCP client.
  • Teams that need remote access through HTTP JWT authentication and role-based access controls.

Not for

  • Workflows requiring Supabase cloud multi-project management or cloud-specific APIs.
  • Users unable to provide Supabase connection details or unwilling to grant database and service-role access.
  • Remote deployments that require built-in authentication in stdio mode.

Required permissions

  • Basic configuration requires the Supabase URL and anon key.
  • Privileged tools require a service_role JWT in HTTP mode; stdio mode has no authentication and exposes all tools.
  • Tools that directly access auth, storage, pg_catalog, and similar objects generally require DATABASE_URL.
  • HTTP mode requires a JWT secret; JWT role controls access, with authenticated limited to regular tools and anon denied tool access.

Risks and side effects

  • execute_sql can run arbitrary SQL and should be exposed only to service_role.
  • Stdio mode has no authentication and exposes all tools, including privileged ones; it is intended for trusted local clients.
  • Plain-text passwords supplied to auth user tools travel over the MCP transport; use TLS for network deployments.
  • Service role keys, database connection strings, and JWT secrets are sensitive configuration.
  • HTTP access depends on JWT, per-IP rate limits, CORS, and request timeout settings.

Setup

Before you start

Runtime:Bun 1.1+

SUPABASE_URL required The self-hosted Supabase project's HTTP URL; get it from your Supabase deployment configuration.
SUPABASE_ANON_KEY requiredsecret The project's anonymous API key; get it from Supabase configuration.
SUPABASE_SERVICE_ROLE_KEY optionalsecret The service role key for privileged tools; get it from Supabase configuration.
DATABASE_URL optionalsecret The direct PostgreSQL connection string; get it from your database deployment configuration.
SUPABASE_AUTH_JWT_SECRET optionalsecret The Supabase JWT secret; get it from Supabase Auth configuration. Required for HTTP transport.
ANON_KEY optionalsecret The Supabase anonymous key referenced by the Docker Compose example; get it from Supabase environment configuration.
SERVICE_ROLE_KEY optionalsecret The Supabase service role key referenced by the Docker Compose example; get it from Supabase environment configuration.
JWT_SECRET optionalsecret The Supabase JWT secret referenced by the Docker Compose example; get it from Supabase environment configuration.
POSTGRES_PASSWORD optionalsecret The PostgreSQL password in the Docker Compose example; get it from database environment configuration.
Other optional settings (7)
NODE_ENV optional Set to `production` in the Docker example to identify the runtime environment.
POSTGRES_HOST optional The PostgreSQL hostname in the Docker Compose example; get it from database environment configuration.
POSTGRES_PORT optional The PostgreSQL port in the Docker Compose example; get it from database environment configuration.
POSTGRES_DB optional The PostgreSQL database name in the Docker Compose example; get it from database environment configuration.
COMPOSE_PROJECT_NAME optional Optional Docker Compose project name used to form the container name.
COMPOSE_PROFILES optional Set to `mcp` to enable the MCP Docker Compose service in the example.
SITE_URL_PATTERN optional The site URL pattern used by the Kong CORS example; set it for your deployment.

Requires Bun v1.1 or later and the URL and anon key for a self-hosted Supabase instance. Clone the repository, run bun install and bun run build, then start it with bun run dist/index.js using a client configuration example and provide --url and --anon-key. Depending on the tools used, also configure --service-key, --db-url, and --jwt-secret for HTTP mode. Smithery installation for Claude Desktop is also documented.

claude_desktop_config.json
{"mcpServers":{"selfhosted-supabase":{"command":"bun","args":["run","<path-to-dist/index.js>","--url","<your-supabase-url>","--anon-key","<your-anon-key>","--service-key","<your-service-key>","--db-url","<your-db-url>","--jwt-secret","<your-jwt-secret>"]}}}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "selfhosted-supabase": {
      "command": "bun",
      "args": [
        "run",
        "<path-to-dist/index.js>",
        "--url",
        "<your-supabase-url>",
        "--anon-key",
        "<your-anon-key>",
        "--service-key",
        "<your-service-key>",
        "--db-url",
        "<your-db-url>",
        "--jwt-secret",
        "<your-jwt-secret>"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.selfhosted-supabase]
command = "bun"
args = ["run", "<path-to-dist/index.js>", "--url", "<your-supabase-url>", "--anon-key", "<your-anon-key>", "--service-key", "<your-service-key>", "--db-url", "<your-db-url>", "--jwt-secret", "<your-jwt-secret>"]

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

Terminal
claude mcp add selfhosted-supabase -- bun run '<path-to-dist/index.js>' --url '<your-supabase-url>' --anon-key '<your-anon-key>' --service-key '<your-service-key>' --db-url '<your-db-url>' --jwt-secret '<your-jwt-secret>'

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Confirm `list_tables` appears in the client's tool list, then ask it to list the database tables. A returned table list confirms the connection.

Troubleshooting

  1. If migration listing fails, check whether the Supabase CLI created supabase_migrations.schema_migrations.
  2. If RPC-dependent tools fail, check for public.execute_sql and whether service-key and db-url were provided at startup.
  3. If direct database tools fail, check that DATABASE_URL is reachable from the server runtime; container deployments should use an internal hostname.
  4. If startup reports ECONNRESET, check DATABASE_URL network reachability.
  5. If HTTP requests are rejected, check the JWT secret, Authorization bearer token validity and role, plus host, port, and CORS settings.
  6. Confirm Bun v1.1 or later is installed and that the build produced dist/index.js.

Things to try

Once connected, you can ask your AI assistant things like:

  • List the database tables and their columns.
  • Check the current RLS status and policies.
  • List the storage buckets and their objects.
  • Show recent database connections and statistics.

Tools 43

list_tables read-only
Lists tables in database schemas.
list_extensions read-only
Lists installed PostgreSQL extensions.
list_available_extensions read-only
Lists available PostgreSQL extensions for installation.
list_migrations read-only
Lists applied migrations recorded in the Supabase CLI migration table.
apply_migration writes
Applies a SQL migration and records it in the migration table; privileged access required.
list_table_columns read-only
Lists columns for a specified table.
list_indexes read-only
Lists indexes for a specified table.
list_constraints read-only
Lists constraints for a specified table.
Show 35 more tools
list_foreign_keys read-only
Lists foreign keys for a specified table.
list_triggers read-only
Lists triggers for a specified table.
list_database_functions read-only
Lists user-defined database functions.
get_function_definition read-only
Gets the source definition of a function.
get_trigger_definition read-only
Gets the source definition of a trigger.
execute_sql writes
Executes an arbitrary SQL query; privileged access required.
explain_query read-only
Runs EXPLAIN ANALYZE on a query; privileged access required.
get_database_connections read-only
Shows active connections in pg_stat_activity.
get_database_stats read-only
Retrieves pg_stat_* database statistics.
get_index_stats read-only
Shows index usage statistics.
get_vector_index_stats read-only
Shows pgvector index statistics.
list_rls_policies read-only
Lists Row-Level Security policies for a specified table.
get_rls_status read-only
Shows whether Row-Level Security is enabled for tables.
get_advisors read-only
Retrieves security and performance advisories.
get_project_url read-only
Returns the configured Supabase URL.
verify_jwt_secret read-only
Checks whether a JWT secret is configured.
generate_typescript_types read-only
Generates TypeScript types from the database schema.
rebuild_hooks writes
Restarts the pg_net worker, if used; privileged access required.
get_logs read-only
Retrieves recent logs from the analytics stack or CSV fallback.
list_auth_users read-only
Lists users from auth.users.
get_auth_user read-only
Retrieves details for a specified auth user.
create_auth_user writes
Creates an auth user with a bcrypt-hashed password via pgcrypto; privileged access required.
update_auth_user writes
Updates auth user details; changed passwords are bcrypt-hashed; privileged access required.
delete_auth_user destructive
Deletes an auth user; privileged access required.
list_storage_buckets read-only
Lists all Storage buckets.
list_storage_objects read-only
Lists objects in a specified bucket.
get_storage_config read-only
Retrieves bucket configuration.
update_storage_config writes
Updates Storage bucket settings; privileged access required.
list_realtime_publications read-only
Lists PostgreSQL publications such as supabase_realtime.
list_cron_jobs read-only
Lists scheduled jobs; requires the pg_cron extension.
get_cron_job_history read-only
Shows recent execution history for a scheduled job.
list_vector_indexes read-only
Lists pgvector indexes; requires the pgvector extension.
list_edge_functions read-only
Lists deployed Edge Functions.
get_edge_function_details read-only
Gets details and metadata for an Edge Function.
list_edge_function_logs read-only
Retrieves recent logs for an Edge Function.

Use cases

Inspect Supabase database schemas, indexes, constraints, triggers, and functions.
Review database statistics, connections, logs, security policies, and performance advisories.
Manage migrations, auth users, and Storage settings.
Generate TypeScript types and inspect Realtime, cron, pgvector, and Edge Functions.

Supported clients

Claude DesktopPartial support
CursorPartial support
Visual Studio Code CopilotPartial support
WindsurfPartial support
ClinePartial support

Listed from the project's documentation, not tested by this site.

Overview

This MCP server connects MCP clients to local or privately hosted Supabase projects. Its tools cover database schemas and data, migrations, statistics, auth users, Storage, Realtime, Edge Functions, and type generation. It supports stdio and Streamable HTTP; HTTP mode uses Supabase JWT authentication and role-based tool access.

Similar servers

Source revision db8d846c735b Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/selfhosted-supabase-mcp.svg)](https://followmcp.com/en/servers/selfhosted-supabase-mcp)