Supabase MCP Server

$git clone https://github.com/dedalus-labs/supabase-mcp.git && cd supabase-mcp && uv sync
README.md

Enables secure interaction with Supabase databases via the PostgREST API

Supabase MCP Server

A Supabase MCP server built with the Dedalus MCP framework. Provides secure access to Supabase databases via the PostgREST API with credential encryption and JIT token exchange.

Features

Available Tools

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

Prerequisites

  • Python 3.10+
  • uv package manager
  • Supabase project URL and API key
  • Dedalus API Key

Setup

  1. Clone the repository
git clone https://github.com/dedalus-labs/supabase-mcp.git
cd supabase-mcp
  1. Install dependencies
uv sync
  1. 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()

SUPABASE_URL = os.getenv("SUPABASE_URL")

# Define the Supabase connection
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}",
)

# Bind credentials (encrypted client-side, decrypted at dispatch time)
supabase_secrets = SecretValues(supabase, key=os.getenv("SUPABASE_SECRET_KEY", ""))

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="openai/gpt-5",
        mcp_servers=["issac/supabase-mcp"],
        credentials=[supabase_secrets],
    )

    print(result.output)

if __name__ == "__main__":
    asyncio.run(main())

License

MIT License - see LICENSE for details.

Tools (7)

db_selectSelect rows from a table with optional filters, ordering, and pagination
db_get_by_idGet a single row by primary key
db_insertInsert one or more rows into a table
db_updateUpdate rows matching specified filters
db_deleteDelete rows matching specified filters
db_upsertInsert or update rows on conflict
db_rpcCall a Supabase stored procedure/function

Environment Variables

SUPABASE_URLrequiredSupabase project URL
SUPABASE_SECRET_KEYrequiredSupabase API key
DEDALUS_API_KEYrequiredDedalus API Key for encrypted credential handling

Configuration

claude_desktop_config.json
{
  "mcpServers": {
    "supabase-mcp": {
      "command": "uv",
      "args": ["run", "supabase-mcp"],
      "env": {
        "SUPABASE_URL": "your-project-url",
        "SUPABASE_SECRET_KEY": "your-api-key",
        "DEDALUS_API_KEY": "your-dedalus-key"
      }
    }
  }
}

Try it

Select all rows from the users table, limit to 5.
Get the user details from the profiles table where the id is 123.
Insert a new record into the orders table with the status 'pending'.
Update the inventory table to set stock to 50 where item_id is 'A1'.
Call the stored procedure 'calculate_revenue' with the year 2023.

Frequently Asked Questions

What are the key features of Supabase MCP Server?

Full CRUD operations (Select, Insert, Update, Delete, Upsert) via PostgREST API.. Support for calling Supabase stored procedures and functions via RPC.. Encrypted credential handling and just-in-time token exchange using Dedalus framework.. Advanced data retrieval with support for filters, ordering, and pagination..

What can I use Supabase MCP Server for?

Managing Supabase database records directly through an AI chat interface.. Executing complex database logic by triggering remote stored procedures.. Securely accessing production databases without exposing raw credentials to the LLM.. Building automated workflows that sync data between external tools and Supabase..

How do I install Supabase MCP Server?

Install Supabase MCP Server by running: git clone https://github.com/dedalus-labs/supabase-mcp.git && cd supabase-mcp && uv sync

What MCP clients work with Supabase MCP Server?

Supabase MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Use Supabase MCP Server with Conare

Manage MCP servers visually, upload persistent context, and never start from zero with Claude Code & Codex.

Try Free