Skip to main content

clr-supabase-mcp

MCP server for self-hosted Supabase instances with multi-instance support.

Features

  • Schema introspection, SQL execution, migrations
  • Auth user management (GoTrue)
  • Storage bucket/object management
  • Edge function management
  • Multi-instance support via credentials.json
  • Module-based tool loading (--modules flag)
  • Read-only mode

Installation

pip install clr-supabase-mcp

Configuration

Step 1: Create the credentials directory

mkdir -p ~/.config/supabase

Step 2: Find your Supabase credentials

You need three values from your self-hosted Supabase deployment:

1. Supabase URL — The public Kong gateway URL for your instance. This is the URL you use to access the Supabase API (e.g. https://supabase.example.com). If you're running Supabase locally via Docker, this is typically http://localhost:8000.

2. Service Role Key — The service_role JWT key that grants admin access. Find it in your Supabase .env file:

# In your Supabase deployment directory:
grep SERVICE_ROLE_KEY .env
# or look for the value of SUPABASE_SERVICE_ROLE_KEY

This key looks like eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... (a long JWT token).

3. Database URL — Direct PostgreSQL connection string. Build it from values in your Supabase .env file:

postgresql://postgres:YOUR_POSTGRES_PASSWORD@YOUR_DB_HOST:5432/postgres

Find the password:

grep POSTGRES_PASSWORD .env

The DB host depends on your setup:

  • Docker on same machine: localhost (or the mapped port, check docker compose ps)
  • Remote server: The hostname/IP of your database server
  • Docker network name: db (if connecting from within the same Docker network)

Step 3: Create credentials.json

Single instance:

cat > ~/.config/supabase/credentials.json << 'EOF'
{
  "url": "https://supabase.example.com",
  "service_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "db_url": "postgresql://postgres:your-db-password@db-host:5432/postgres"
}
EOF
chmod 600 ~/.config/supabase/credentials.json

Multiple instances:

cat > ~/.config/supabase/credentials.json << 'EOF'
{
  "instances": {
    "prod": {
      "url": "https://supabase-prod.example.com",
      "service_key": "eyJ...-prod-key",
      "db_url": "postgresql://postgres:prodpass@prod-db:5432/postgres"
    },
    "dev": {
      "url": "https://supabase-dev.example.com",
      "service_key": "eyJ...-dev-key",
      "db_url": "postgresql://postgres:devpass@dev-db:5432/postgres"
    }
  },
  "default": "prod"
}
EOF
chmod 600 ~/.config/supabase/credentials.json

Credential fields

Field Required Description
url Yes Supabase Kong gateway URL
service_key Yes Service role JWT (admin access for auth/storage/edge tools)
db_url For SQL/schema tools Direct PostgreSQL connection URL
anon_key No Anon key (not needed when service_key is set)

Note: db_url is only required for schema introspection and SQL tools (core and sql modules). Auth, storage, and edge modules only need url and service_key.

Environment variable fallback

If no credentials file exists, the server falls back to environment variables:

export SUPABASE_URL="https://supabase.example.com"
export SUPABASE_SERVICE_KEY="eyJ..."
export SUPABASE_DB_URL="postgresql://postgres:pass@db-host:5432/postgres"

Usage

All modules (default)

clr-supabase-mcp

Specific modules

# Schema introspection only
clr-supabase-mcp --modules core

# SQL + auth
clr-supabase-mcp --modules sql,auth

Available modules: core, sql, auth, storage, edge

Read-only mode

Disable write operations (SQL execution, migrations, user creation, etc.):

export SUPABASE_READ_ONLY=true
clr-supabase-mcp

Modules

Module Tools API Requires
core 19 Direct Postgres db_url
sql 13 Direct Postgres db_url
auth 5 GoTrue REST /auth/v1/ url + service_key
storage 4 Storage REST /storage/v1/ url + service_key
edge 5 Functions REST /functions/v1/ url + service_key

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clr_supabase_mcp-1.0.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clr_supabase_mcp-1.0.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file clr_supabase_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: clr_supabase_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for clr_supabase_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 05b465a8a3e565211cc61e050f4a3a18625c1a330653dea2c6961856e63037b2
MD5 5cfee0e7784f3bdbd1c8ca1d281140a7
BLAKE2b-256 fca05b1bdac8c19ddeeb4ff78fa2989e3d4d8826a52e34e6272e659aa0e75f80

See more details on using hashes here.

Provenance

The following attestation bundles were made for clr_supabase_mcp-1.0.0.tar.gz:

Publisher: publish.yml on clearminds/clr-supabase-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clr_supabase_mcp-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for clr_supabase_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aed90e8d4a9a746df159989b6a326c78024fef5ef2e3d334db96a8cb5b1d59d6
MD5 6a5cd02938a1ee50585b03f12c73ec54
BLAKE2b-256 b56c56fbe3714e09b7a9c1ff202b84dca31d5bc821e41a254f662f33864524eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for clr_supabase_mcp-1.0.0-py3-none-any.whl:

Publisher: publish.yml on clearminds/clr-supabase-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page