Self-Hosted Supabase

v1.0.0Databasesstable

A Model Context Protocol server that enables interaction with self-hosted Supabase instances, allowing developers to query database schemas, manage migrations, inspect statistics, and interact with Supabase features directly from MCP-compatible devel

self-hosted-supabase-mcp-servermcpai-integration
Share:
137
Stars
0
Downloads
0
Weekly
0/5

What is Self-Hosted Supabase?

Self-Hosted Supabase is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that enables interaction with self-hosted supabase instances, allowing developers to query database schemas, manage migrations, inspect statistics, and interact with supa...

A Model Context Protocol server that enables interaction with self-hosted Supabase instances, allowing developers to query database schemas, manage migrations, inspect statistics, and interact with Supabase features directly from MCP-compatible devel

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol server that enables interaction wit

Use Cases

Query and manage database schemas in self-hosted Supabase instances.
Execute migrations and inspect database statistics directly through MCP.
HenkDz

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx self-hosted-supabase-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Self-Hosted Supabase

The Self-Hosted Supabase MCP Server is a Model Context Protocol server designed specifically for Supabase instances running on your own infrastructure rather than the Supabase cloud platform. It exposes over 40 tools covering database schema inspection, migration management, SQL execution, Row Level Security policy review, authentication user management, storage bucket operations, Edge Functions, cron jobs, and TypeScript type generation. Teams running self-hosted Supabase deployments use it to give AI assistants direct, privileged access to their database and infrastructure from within their development environment.

Prerequisites

  • A self-hosted Supabase instance with accessible HTTP endpoint and PostgreSQL connection string
  • Bun runtime installed (bun.sh) or Node.js 18+ for running the server
  • Supabase service role key and anon key from your self-hosted instance
  • Direct PostgreSQL DATABASE_URL for the selfhosted instance
  • An MCP-compatible client such as Claude Desktop or Cursor
1

Install via Smithery (recommended)

Use the Smithery CLI to automatically configure the server for Claude Desktop.

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

Alternative: clone and build manually

Clone the repository and build with Bun for manual installation or self-hosted deployment.

git clone https://github.com/HenkDz/selfhosted-supabase-mcp.git
cd selfhosted-supabase-mcp
bun install
bun run build
3

Gather your Supabase connection details

From your self-hosted Supabase admin panel, collect the HTTP endpoint URL, anon key, service role key, and PostgreSQL connection string. These are required for all connection modes.

4

Configure Claude Desktop

Add the server to your Claude Desktop configuration with your self-hosted Supabase credentials passed as command-line arguments.

{
  "mcpServers": {
    "supabase-self-hosted": {
      "command": "bun",
      "args": [
        "run",
        "/path/to/selfhosted-supabase-mcp/dist/index.js",
        "--url", "http://your-supabase-host:8000",
        "--anon-key", "your-anon-key",
        "--service-key", "your-service-role-key",
        "--db-url", "postgresql://postgres:password@your-host:5432/postgres"
      ]
    }
  }
}
5

Verify the connection

Restart Claude Desktop and ask it to list tables in your database to confirm the MCP server is connected to your Supabase instance.

Self-Hosted Supabase Examples

Client configuration

Claude Desktop configuration for the Self-Hosted Supabase MCP server connecting to a local Supabase instance.

{
  "mcpServers": {
    "supabase-self-hosted": {
      "command": "bun",
      "args": [
        "run",
        "/path/to/selfhosted-supabase-mcp/dist/index.js",
        "--url", "http://localhost:8000",
        "--anon-key", "your-anon-key",
        "--service-key", "your-service-role-key",
        "--db-url", "postgresql://postgres:password@localhost:5432/postgres"
      ]
    }
  }
}

Prompts to try

Example prompts for managing a self-hosted Supabase instance through Claude Desktop.

- "List all tables in my Supabase database and describe their schemas"
- "Show me all pending migrations that haven't been applied yet"
- "Review the Row Level Security policies on the users table"
- "List all authenticated users created in the last 7 days"
- "Generate TypeScript types for my current database schema"
- "Show me slow queries and index usage statistics for the orders table"

Troubleshooting Self-Hosted Supabase

Connection refused when connecting to the Supabase HTTP endpoint

Verify your SUPABASE_URL points to the correct host and port for your self-hosted instance (typically port 8000 for the Kong API gateway). Ensure the Supabase Docker stack is running with `docker ps` and that the port is accessible from the machine running the MCP server.

Database operations fail with 'permission denied' errors

Ensure you are passing the service role key (--service-key), not just the anon key. The service role key bypasses Row Level Security and is required for privileged operations like user management and schema inspection. Never expose the service role key in public configurations.

HTTP transport mode fails with JWT validation errors

When running in HTTP transport mode, the SUPABASE_AUTH_JWT_SECRET environment variable must be set to the same JWT secret configured in your Supabase instance (found in supabase/config.toml as `jwt_secret`). Restart the server after setting the variable.

Frequently Asked Questions about Self-Hosted Supabase

What is Self-Hosted Supabase?

Self-Hosted Supabase is a Model Context Protocol (MCP) server that model context protocol server that enables interaction with self-hosted supabase instances, allowing developers to query database schemas, manage migrations, inspect statistics, and interact with supabase features directly from mcp-compatible devel It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Self-Hosted Supabase?

Follow the installation instructions on the Self-Hosted Supabase GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Self-Hosted Supabase?

Self-Hosted Supabase works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Self-Hosted Supabase free to use?

Yes, Self-Hosted Supabase is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "self-hosted-supabase-mcp-server": { "command": "npx", "args": ["-y", "self-hosted-supabase-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Self-Hosted Supabase?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides