Self-Hosted Supabase
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
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
Maintainer
Works with
Installation
Manual Installation
npx self-hosted-supabase-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 claudeAlternative: 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 buildGather 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.
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"
]
}
}
}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.
Self-Hosted Supabase Alternatives — Similar Databases Servers
Looking for alternatives to Self-Hosted Supabase? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
DBHub
★ 2.8kA universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
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.
Set Up Self-Hosted Supabase in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.