alexander-zuev/supabase-mcp-server

Query MCP enables end-to-end management of Supabase via chat interface: read & write query executions, management API support, automatic migration versioning, access to logs and much more.

830 ★105 forksPythonUpdated 3mo ago

What you need to know

Query MCP — an open-source MCP server that lets your IDE safely run SQL, manage schema changes, call the Supabase Management API, and use the Auth Admin SDK, all with built-in three-tier safety controls. Python 3.12+, Apache-2.0. No longer actively maintained — the author recommends Supabase's official MCP server instead.

Install

pipx install supabase-mcp-server   # recommended; or uv pip install supabase-mcp-server
Or install via Smithery.ai (smithery.ai/server/@alexander-zuev/supabase-mcp-server)

Usage

  • Set env vars: QUERY_API_KEY (required, free key from thequery.dev), SUPABASE_PROJECT_REF, SUPABASE_DB_PASSWORD, SUPABASE_REGION (optional, default us-east-1), plus SUPABASE_ACCESS_TOKEN / SUPABASE_SERVICE_ROLE_KEY for Management API / Auth Admin
  • Config precedence: env vars → local .env (source only) → global config file (~/.config/supabase-mcp/.env or %APPDATA%\supabase-mcp\.env)
  • Tested clients: Cursor (Settings → Features → MCP Servers), Windsurf (Cascade → hammer icon), Claude Desktop (Settings → Developer → Edit Config, full absolute path required), Cline (cline_mcp_settings.json)
  • Troubleshoot with `supabase-mcp-server` run directly; logs at ~/.local/share/supabase-mcp/mcp_server.log

Key features

  • SQL execution with three-tier safety (safe=read-only always allowed; write=INSERT/UPDATE/DELETE needs unsafe mode; destructive=DROP/CREATE needs unsafe mode + 2-step confirmation); pglast-based parsing and validation
  • Automatic versioning of database schema changes into migration scripts; tools: get_schemas, get_tables, get_table_schema, execute_postgresql, confirm_destructive_operation, retrieve_migrations, live_dangerously
  • Supabase Management API tools (send_management_api_request, get_management_api_spec, get_management_api_safety_rules) with risk-categorized safety rules (safe/unsafe/blocked)
  • Auth Admin SDK methods via Python SDK (get_user_by_id, list_users, create_user, delete_user, invite_user_by_email, generate_link, update_user_by_id, delete_factor)
  • retrieve_logs across 10 log collections (postgres, api_gateway, auth, postgrest, pooler, storage, realtime, edge_functions, cron, pgbouncer); universal safety manager across database/API/SDK

Best for

Giving AI IDEs (Cursor, Windsurf, Cline, Claude Desktop) safe, guard-railed access to query and manage a Supabase project.

Caveats

  • NO LONGER ACTIVELY MAINTAINED — README says since Supabase shipped its official MCP server, this one is no longer actively maintained and users are pointed to supabase-community/supabase-mcp
  • Since v0.4 requires a (free) QUERY_API_KEY from thequery.dev for all operations
  • No self-hosted Supabase support; no custom connection strings; only transaction pooling (session pooling unsupported); Management API and Auth Admin tools only work with remote (not local) projects
  • Local .env files in project dirs are NOT detected when installed via pipx/uv — use env vars or the global config file
  • Python 3.12+ required; supabase-mcp-inspector from package install doesn't work properly (noted in README)
Platforms: macOS · Linux · WindowsClients: Cursor · Windsurf · Cline · Claude Desktop

Reviewed 2026-08-07

Topics

cursormodel-context-protocolsupabasewindsurf
View on GitHub ↗
Stars
830★
Forks
105
Language
Python
License
Apache-2.0
Created
2025-02-15
Last push
2026-05-08