MCPSERV.CLUB
HenkDz

Self‑Hosted Supabase MCP Server

MCP Server

Local Supabase integration via Model Context Protocol

Stale(55)
85stars
2views
Updated 14 days ago

About

A lightweight MCP server that connects IDEs and tools directly to self‑hosted Supabase projects, enabling schema introspection, migrations, auth management, storage queries, and type generation from your local environment.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Self‑Hosted Supabase MCP Server

The Self‑Hosted Supabase MCP Server is a lightweight, purpose‑built bridge that lets AI assistants—such as Claude or other Model Context Protocol (MCP) clients—talk directly to a locally running Supabase instance. Instead of routing every request through the public Supabase cloud, this server exposes a curated set of database and project management tools that mirror the official cloud MCP endpoints but are tailored for single‑project, self‑hosted deployments. By doing so, it eliminates the overhead of multi‑tenant authentication, cloud‑specific APIs, and service‑level abstractions that are irrelevant in a private environment.

Why It Matters

Developers often run Supabase on Docker or within their own Kubernetes clusters to maintain control over data, comply with privacy regulations, or reduce latency. When working with AI‑augmented IDEs or chat‑based assistants, the ability to introspect schemas, run queries, and manage users without leaving the editor becomes invaluable. The Self‑Hosted Supabase MCP Server fills this gap by providing a consistent, secure interface that AI tools can call into, enabling features like code completion based on real database types, instant schema updates in documentation, or automated migration scripts—all while keeping credentials and data strictly local.

Core Features

  • Schema & Migration Management – List tables, extensions, and applied migrations; apply new SQL scripts with a single tool call.
  • Database Operations & Statistics – Execute arbitrary SQL, view active connections, and pull PostgreSQL statistics () to monitor performance.
  • Project Configuration Exposure – Retrieve the Supabase URL, anon key, service role key, and verify JWT secrets for quick debugging.
  • Development Utilities – Generate TypeScript type definitions from the live schema and attempt to restart workers for local development.
  • Auth User Handling – CRUD operations on the table, including creating users with direct database access (not recommended for production).
  • Storage Interaction – Enumerate buckets and objects, providing insight into media or file storage directly from the assistant.
  • Realtime Publication Insight – List PostgreSQL publications, usually , to understand real‑time channel configuration.

These tools are intentionally limited to the most common tasks developers need when working locally, ensuring a minimal attack surface and straightforward configuration.

Real‑World Use Cases

  • Rapid Prototyping: A developer can ask the AI to suggest a new table schema, have the assistant generate TypeScript types, and apply the migration—all without leaving the editor.
  • On‑the‑Fly Documentation: The AI can pull current table definitions and user counts to update README files or internal wikis automatically.
  • Security Audits: By exposing key retrieval and JWT verification, the assistant can flag missing secrets or misconfigured keys during code reviews.
  • Testing and CI: Continuous integration pipelines can query the MCP server to assert that migrations have run correctly or that certain storage buckets exist before deploying.

In each scenario, the server acts as a single, authoritative source of truth for the local Supabase instance, allowing AI assistants to perform complex operations with confidence.

Unique Advantages

Unlike the official cloud MCP server, this implementation removes multi‑project routing logic and cloud‑specific endpoints that would otherwise add unnecessary complexity. It is built from scratch, focusing on a streamlined API surface that aligns closely with the typical needs of a self‑hosted Supabase deployment. The result is faster startup times, lower resource consumption, and a clearer security posture—making it an ideal companion for developers who value control over their data while still enjoying the productivity gains of AI‑powered tooling.