Selfhosted Supabase MCP Server

MCP server for self-hosted Supabase instances with 50+ database management tools

Remote serverstreamable-httpTypeScript

What is the Selfhosted Supabase MCP MCP server?

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.

The short version

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.

  • Regular — tools are accessible by any authenticated Supabase JWT (authenticated or service_role role)
  • Privileged — tools require a service_role JWT (HTTP mode) or direct database/service-key access (stdio mode)

The tools it exposes

The server publishes 13 tools. What each one is for:

  • 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 cd selfhosted-supabase-mcp 2. Install dependencies: bash bun install 3. **Build the

Getting it running

Because 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.

What it needs from you

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.

  • Bun v1.1 or later (replaces Node.js/npm — used for runtime and builds) * Access to your self-hosted Supabase instance (URL, keys, and optionally a direct PostgreSQL connection string).

How it compares

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.

Things to watch

  • Your data travels to the provider's service, so the usual questions apply about what you send and what they retain.
  • With 13 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Selfhosted Supabase MCP.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
generate_typescript_typesGenerates TypeScript types from the database schema
rebuild_hooksRestarts the pg_net worker (if used)
get_logsRetrieves recent log entries (analytics stack or CSV fallback)
list_cron_jobsLists scheduled jobs (requires pg_cron extension)
get_cron_job_historyShows recent execution history for a cron job
list_vector_indexesLists pgvector indexes (requires pgvector extension)
list_edge_functionsLists deployed Edge Functions
get_edge_function_detailsGets details and metadata for an Edge Function
list_edge_function_logsRetrieves recent logs for an Edge Function
StorageThe Storage tool exposed by this server.
PrerequisitesThe Prerequisites tool exposed by this server.
Steps1. **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
Cursor1. Create or open the file .cursor/mcp.json in your project root. 2. Add the following configuration:

How to install the Selfhosted Supabase MCP MCP server

{
  "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.

Configuration

  • Bun v1.1 or later (replaces Node.js/npm — used for runtime and builds) * Access to your self-hosted Supabase instance (URL, keys, and optionally a direct PostgreSQL connection string).
VariableDescriptionRequired
SUPABASE_URLEndpoint or connection string the server talks to.Yes
SUPABASE_ANON_KEYCredential the server authenticates with.Yes
SUPABASE_SERVICE_ROLE_KEYCredential the server authenticates with.Yes
DATABASE_URLEndpoint or connection string the server talks to.Yes
SUPABASE_AUTH_JWT_SECRETCredential the server authenticates with.Yes
ANON_KEYCredential the server authenticates with.Yes
SERVICE_ROLE_KEYCredential the server authenticates with.Yes
POSTGRES_HOSTEndpoint or connection string the server talks to.Optional

Example prompts to try

  • Use Selfhosted Supabase MCP to generate typescript types.
  • Use Selfhosted Supabase MCP to rebuild hooks.
  • Use Selfhosted Supabase MCP to get logs.

Frequently asked questions

It connects Selfhosted Supabase MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 13 tools (generate_typescript_types, rebuild_hooks, get_logs, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Selfhosted Supabase MCP directly.