What is Self-Hosted Supabase MCP Server?
A Model Context Protocol (MCP) server for interacting with self-hosted Supabase instances. It enables MCP clients (like IDE extensions) to introspect, manage, and interact with local or privately hosted Supabase projects through database schema queries, migrations, statistics, authentication, storage, and edge functions.
How to use Self-Hosted Supabase MCP Server?
Install via Smithery (npx -y @smithery/cli install @HenkDz/selfhosted-supabase-mcp --client claude) or clone the repository, install dependencies with bun install, build with bun run build, then configure with required arguments --url and --anon-key (or environment variables). Optionally provide --service-key, --db-url, --jwt-secret for privileged tools and HTTP transport.
Key features of Self-Hosted Supabase MCP Server
- 40+ tools covering schema, migrations, database stats, RLS, auth, storage, functions, and edge functions.
- Tool privilege levels: regular (any authenticated JWT) and privileged (requires
service_role JWT or direct DB access).
- Supports both stdio and HTTP transports (HTTP enforces JWT authentication and RBAC).
- Relies on
supabase_migrations.schema_migrations table (created by Supabase CLI).
- Optional whitelist of enabled tools via
--tools-config JSON file.
- Automatic
execute_sql helper function creation on startup if service key and DB URL are provided.
Use cases of Self-Hosted Supabase MCP Server
- Querying database schemas and data from an MCP-enabled editor.
- Managing database migrations without leaving the development environment.
- Inspecting database statistics, connections, and index usage.
- Managing authentication users and storage buckets programmatically.
- Generating TypeScript types from the database schema.
评论