Database · Developer Tools

Selfhosted Supabase logo

Selfhosted Supabase

henkdz/selfhosted-supabase-mcp

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.

Install

npx -y @smithery/cli install @HenkDz/selfhosted-supabase-mcp --client claude

Client configuration

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

Environment variables

SUPABASE_URLSUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYDATABASE_URLSUPABASE_AUTH_JWT_SECRET
GitHub stars
2
Author
@henkdz
Category
Database, Developer Tools
License
MIT
Updated
Oct 6, 2026

About Selfhosted Supabase

This server was built from scratch, drawing lessons from adapting the official Supabase cloud MCP server, to provide a minimal, focused implementation tailored for the self-hosted use case.

Tools (40)

  • 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).

  • list_tables

    Lists tables in the database schemas

  • list_extensions

    Lists installed PostgreSQL extensions

  • list_available_extensions

    Lists all available (installable) extensions

  • list_migrations

    Lists applied migrations from supabase_migrations.schema_migrations

  • apply_migration

    Applies a SQL migration and records it in supabase_migrations.schema_migrations

  • list_table_columns

    Lists columns for a specific table

  • list_indexes

    Lists indexes for a specific table

  • list_constraints

    Lists constraints for a specific table

  • list_foreign_keys

    Lists foreign keys for a specific table

  • list_triggers

    Lists triggers for a specific table

  • list_database_functions

    Lists user-defined database functions

  • get_function_definition

    Gets the source definition of a function

  • get_trigger_definition

    Gets the source definition of a trigger

  • execute_sql

    Executes an arbitrary SQL query

  • explain_query

    Runs EXPLAIN ANALYZE on a query

  • get_database_connections

    Shows active connections (pg_stat_activity)

  • get_database_stats

    Retrieves database statistics (pg_stat_*)

  • get_index_stats

    Shows index usage statistics

  • get_vector_index_stats

    Shows pgvector index statistics

  • list_rls_policies

    Lists Row-Level Security policies for a table

  • get_rls_status

    Shows RLS enabled/disabled status for tables

  • get_advisors

    Retrieves security and performance advisory notices

  • get_project_url

    Returns the configured Supabase URL

  • verify_jwt_secret

    Checks if the JWT secret is configured

  • 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_auth_users

    Lists users from auth.users

  • get_auth_user

    Retrieves details for a specific user

  • create_auth_user

    Creates a new user in auth.users (password bcrypt-hashed via pgcrypto)

  • update_auth_user

    Updates user details (password bcrypt-hashed if changed)

  • delete_auth_user

    Deletes a user from auth.users

  • list_storage_buckets

    Lists all storage buckets

  • list_storage_objects

    Lists objects within a specific bucket

  • get_storage_config

    Retrieves storage bucket configuration

  • update_storage_config

    Updates storage bucket settings

  • list_realtime_publications

    Lists PostgreSQL publications (e.g. supabase_realtime)

  • list_cron_jobs

    Lists scheduled jobs (requires pg_cron extension)

Details on this page are taken from the project's README. Open README

Supported clients

Clients mentioned in this server's README:

View all
Claude Desktop logo

Claude Desktop

Desktop · Freemium · Proprietary

Anthropic's official Claude AI desktop application. Supports MCP servers to extend functionality.

WindowsMacOS
Cline logo

Cline

Desktop · Free · MIT

An AI coding assistant integrated into the IDE. Supports MCP servers for enhanced functionality.

WindowsMacOSLinux
Cursor logo

Cursor

Desktop · Freemium · Proprietary

The first agentic IDE. The Cursor editor truly merges how developers and AI work together, delivering a magical coding experience.

WindowsMacOSLinux
Windsurf logo

Windsurf

Desktop · Freemium · Proprietary

The first agentic IDE. The Windsurf editor truly merges how developers and AI work together.

WindowsMacOSLinux

Related MCP servers

More servers
Supabase MCP logo

Supabase MCP

supabase-community/supabase-mcp

1.3k

The Model Context Protocol (MCP) standardizes how Large Language Models (LLMs) talk to external services like Supabase. It connects AI assistants directly with your Supabase project and allows them to perform tasks like managing tables, fetching config, and querying data. See the full list of tools.

Database
Genai Toolbox logo

Genai Toolbox

googleapis/genai-toolbox

769

MCP Toolbox for Databases is an open source Model Context Protocol (MCP) server that connects your AI agents, IDEs, and applications directly to your enterprise databases.

Database
Supabase MCP Server logo

Supabase MCP Server

alexander-zuev/supabase-mcp-server

677

Query MCP is an open-source MCP server that lets your IDE safely run SQL, manage schema changes, call the Supabase Management API, and use Auth Admin SDK — all with built-in safety controls.

Database
Awesome MCP List logo

Awesome MCP List

MobinX/awesome-mcp-list

645

This is a continuously updated curated list of MCP servers, covering categories such as browser control, arts and culture, cloud platforms, command line, communication, customer data platforms, databases, developer tools, data science tools, file systems, finance and fintech, gaming, knowledge and memory, location services, marketing, monitoring, search and utilities. Each project includes a GitHub link and star count for quick reference and use.

Database
PostgreSQL Model Context Protocol (PG MCP) Server logo

PostgreSQL Model Context Protocol (PG MCP) Server

stuzero/pg-mcp-server

440

PG-MCP is a server implementation of the Model Context Protocol for PostgreSQL databases. It provides a comprehensive API for AI agents to discover, connect to, query, and understand PostgreSQL databases through MCP's resource-oriented architecture.

Database
dbhub logo

dbhub

bytebase/dbhub

332

[!NOTE] If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase.

Database