Supabase MCP Server
Provides secure access to Supabase databases via PostgREST API and management tools for projects, schemas, branches, logs, and code generation.
README
Supabase MCP Server
A Supabase MCP server built with the Dedalus MCP framework. Provides secure access to Supabase databases via the PostgREST API and management APIs with credential encryption and JIT token exchange.
Features
Database Tools (PostgREST)
Read Operations
| Tool | Description |
|---|---|
db_select |
Select rows from a table with optional filters, ordering, and pagination |
db_get_by_id |
Get a single row by primary key |
Write Operations
| Tool | Description |
|---|---|
db_insert |
Insert one or more rows into a table |
db_update |
Update rows matching specified filters |
db_delete |
Delete rows matching specified filters |
db_upsert |
Insert or update rows on conflict |
RPC
| Tool | Description |
|---|---|
db_rpc |
Call a Supabase stored procedure/function |
Management Tools (Management API)
Projects & Organizations
| Tool | Description |
|---|---|
list_projects |
List all Supabase projects |
get_project |
Get details of a specific project |
list_organizations |
List all organizations |
Schema & Migrations
| Tool | Description |
|---|---|
list_tables |
List database schemas |
list_extensions |
List installed database extensions |
list_migrations |
List database migrations |
apply_migration |
Apply a DDL migration |
execute_sql |
Execute raw SQL with safety checks |
Branches
| Tool | Description |
|---|---|
list_branches |
List preview branches |
create_branch |
Create a preview branch |
Logs & Advisors
| Tool | Description |
|---|---|
get_logs |
Get project logs (database, api, auth) |
get_advisors |
Get security and performance advisors |
Codegen
| Tool | Description |
|---|---|
generate_typescript_types |
Generate TypeScript types for database schema |
Prerequisites
- Python 3.10+
- uv package manager
- Supabase project URL and API keys
- Dedalus API Key
Setup
- Clone the repository
git clone https://github.com/dedalus-labs/supabase-mcp.git
cd supabase-mcp
- Install dependencies
uv sync
- Configure environment variables
Create a .env file based on .env.example.
Client Usage
import asyncio
import os
from dotenv import load_dotenv
from dedalus_labs import AsyncDedalus, DedalusRunner
from dedalus_mcp.auth import Connection, SecretKeys, SecretValues
load_dotenv()
# Database connection (PostgREST)
supabase = Connection(
name="supabase-mcp",
secrets=SecretKeys(key="SUPABASE_SECRET_KEY"),
base_url=f"{SUPABASE_URL}/rest/v1",
auth_header_name="apikey",
auth_header_format="{api_key}",
)
# Management API connection
supabase_mgmt = Connection(
name="supabase-mcp-mgmt",
secrets=SecretKeys(access_token="SUPABASE_ACCESS_TOKEN"),
base_url="https://api.supabase.com/v1",
auth_header_format="Bearer {api_key}",
)
# Bind credentials (encrypted client-side, decrypted at dispatch time)
db_secrets = SecretValues(supabase, key=os.getenv("SUPABASE_SECRET_KEY", ""))
mgmt_secrets = SecretValues(supabase_mgmt, access_token=os.getenv("SUPABASE_ACCESS_TOKEN", ""))
async def main():
client = AsyncDedalus(
api_key=os.getenv("DEDALUS_API_KEY"),
base_url=os.getenv("DEDALUS_API_URL"),
as_base_url=os.getenv("DEDALUS_AS_URL"),
)
runner = DedalusRunner(client)
result = await runner.run(
input="Select all rows from the users table, limit to 5.",
model="anthropic/claude-sonnet-4-5",
mcp_servers=["dedalus-labs/supabase-mcp"],
credentials=[db_secrets, mgmt_secrets],
)
print(result.output)
if __name__ == "__main__":
asyncio.run(main())
Security
DAuth ensures that your Supabase credentials are encrypted client-side and only decrypted inside a sealed execution boundary. Your server code, logs, and error traces never contain raw credentials.
License
MIT License - see LICENSE for details.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.