Supabase
About
Integrates with Supabase to enable natural language-driven database schema exploration, management, and read-only SQL query execution.
Details
- Author
- alexander-zuev
- Repository
- alexander-zuev/supabase-mcp-server
- GitHub stars
- 661
- Downloads
- 604
- License
- Apache License 2.0
- Categories
- Database, Productivity, AI, Developer Tools, Search, Knowledge Base, Infrastructure, Cloud Service
- Tags
- #integration
Jump to
- 💻 Compatible with Cursor, Windsurf, Cline and other MCP clients supporting stdio protocol
- 🔐 Control read-only and read-write modes of SQL query execution
- 🔍 Runtime SQL query validation with risk level assessment
- 🛡️ Three-tier safety system for SQL operations: safe, write, and destructive
- 🔄 Robust transaction handling for both direct and pooled database connections
- 📝 Automatic versioning of database schema changes
- 💻 Manage your Supabase projects with Supabase Management API
- 🧑💻 Manage users with Supabase Auth Admin methods via Python SDK
- 🔨 Pre-built tools to help Cursor & Windsurf work with MCP more effectively
- 📦 Dead-simple install & setup via package manager (uv, pipx, etc.)
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
SupabaseCommand (node, npx, python, etc.)/Users/username/.local/bin/supabase-mcp-serverEnvironment-
QUERY_API_KEY
your-api-key -
SUPABASE_REGION
us-east-1 -
SUPABASE_DB_PASSWORD
your-db-password -
SUPABASE_PROJECT_REF
your-project-ref -
SUPABASE_ACCESS_TOKEN
your-access-token -
SUPABASE_SERVICE_ROLE_KEY
your-service-role-key
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
QUERY_API_KEY
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
PostgreSQL installation is no longer required for the MCP server itself, as it now uses asyncpg which doesn't depend on PostgreSQL development libraries.
However, you'll still need PostgreSQL if you're running a local Supabase instance:
MacOS
brew install postgresql@16
Windows
- Download and install PostgreSQL 16+ from https://www.postgresql.org/download/windows/
- Ensure "PostgreSQL Server" and "Command Line Tools" are selected during installation
Since v0.2.0 I introduced support for package installation. You can use your favorite Python package manager to install the server via:
pipx install supabase-mcp-server
uv pip install supabase-mcp-server
pipx is recommended because it creates isolated environments for each package.
You can also install the server manually by cloning the repository and running pipx install -e . from the root directory.
If you would like to install from source, for example for local development:
uv venv
uv pip install -e .
You can find the full instructions on how to use Smithery.ai to connect to this MCP server here.
The Supabase MCP server requires configuration to connect to your Supabase database, access the Management API, and use the Auth Admin SDK. This section explains all available configuration options and how to set them up.
> 🔑 Important: Since v0.4 MCP server requires an API key which you can get for free at thequery.dev to use this MCP server.
The server uses the following environment variables:
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| SUPABASE_PROJECT_REF | Yes | 127.0.0.1:54322 | Your Supabase project reference ID (or local host:port) |
| SUPABASE_DB_PASSWORD | Yes | postgres | Your database password |
| SUPABASE_REGION | Yes* | us-east-1 | AWS region where your Supabase project is hosted |
| SUPABASE_ACCESS_TOKEN | No | None | Personal access token for Supabase Management API |
| SUPABASE_SERVICE_ROLE_KEY | No | None | Service role key for Auth Admin SDK |
| QUERY_API_KEY | Yes | None | API key from thequery.dev (required for all operations) |
> Note: The default values are configured for local Supabase development. For remote Supabase projects, you must provide your own values for SUPABASE_PROJECT_REF and SUPABASE_DB_PASSWORD.
> 🚨 CRITICAL CONFIGURATION NOTE: For remote Supabase projects, you MUST specify the correct region where your project is hosted using SUPABASE_REGION. If you encounter a "Tenant or user not found" error, this is almost certainly because your region setting doesn't match your project's actual region. You can find your project's region in the Supabase dashboard under Project Settings.
The server looks for configuration in this order (highest to lowest priority):
1. Environment Variables: Values set directly in your environment
2. Local .env File: A .env file in your current working directory (only works when running from source)
3. Global Config File:
- Windows: %APPDATA%\supabase-mcp\.env
- macOS/Linux: ~/.config/supabase-mcp/.env
4. Default Settings: Local development defaults (if no other config is found)
> ⚠️ Important: When using the package installed via pipx or uv, local .env files in your project directory are not detected. You must use either environment variables or the global config file.
Set environment variables directly in your MCP client configuration (see client-specific setup instructions in Step 3). Most MCP clients support this approach, which keeps your configuration with your client settings.
Create a global .env configuration file that will be used for all MCP server instances:
``bash
If you're running the server from source (not via package), you can create a .env file in your project directory with the same format as above.
In general, any MCP client that supports stdio` protocol should work with this MCP server. This server was explicitly tested to work with:
- Cursor
- Windsurf
- Cline
- Claude Desktop
Additionally, you can also use smithery.ai to install this server a number of clients, including the ones above.
Follow the guides below to install this MCP server in your client.
get_schemas
Lists schemas with sizes and table counts.
get_tables
Lists tables, foreign tables, and views with metadata.
get_table_schema
Gets detailed table structure (columns, keys, relationships).
execute_postgresql
Executes SQL statements against your database.
confirm_destructive_operation
Executes high-risk operations after confirmation.
retrieve_migrations
Gets migrations with filtering and pagination options.
live_dangerously
Toggles between safe and unsafe modes.
send_management_api_request
Sends arbitrary requests to Supabase Management API with auto-injection of project ref.
get_management_api_spec
Gets the enriched API specification with safety information. Supports multiple query modes.
get_management_api_safety_rules
Gets all safety rules with human-readable explanations.
get_auth_admin_methods_spec
Retrieves documentation for all available Auth Admin methods.
call_auth_admin_method
Directly invokes Auth Admin methods with proper parameter handling.
get_user_by_id
Retrieve a user by their ID.
list_users
List all users with pagination.
create_user
Create a new user.
delete_user
Delete a user by their ID.
invite_user_by_email
Send an invite link to a user's email.
generate_link
Generate an email link for various authentication purposes.
update_user_by_id
Update user attributes by ID.
delete_factor
Delete a factor on a user (currently not implemented in SDK).
retrieve_logs
Access logs from any Supabase service.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"supabase": {
"env": {
"QUERY_API_KEY": "your-api-key",
"SUPABASE_REGION": "us-east-1",
"SUPABASE_DB_PASSWORD": "your-db-password",
"SUPABASE_PROJECT_REF": "your-project-ref",
"SUPABASE_ACCESS_TOKEN": "your-access-token",
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
},
"args": [],
"command": "/Users/username/.local/bin/supabase-mcp-server"
}
}
}
Linux
{
"env": {
"QUERY_API_KEY": "your-api-key",
"SUPABASE_REGION": "us-east-1",
"SUPABASE_DB_PASSWORD": "your-db-password",
"SUPABASE_PROJECT_REF": "your-project-ref",
"SUPABASE_ACCESS_TOKEN": "your-access-token",
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
},
"args": [],
"command": "/Users/username/.local/bin/supabase-mcp-server"
}
Macos
{
"env": {
"QUERY_API_KEY": "your-api-key",
"SUPABASE_REGION": "us-east-1",
"SUPABASE_DB_PASSWORD": "your-db-password",
"SUPABASE_PROJECT_REF": "your-project-ref",
"SUPABASE_ACCESS_TOKEN": "your-access-token",
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
},
"args": [],
"command": "/Users/username/.local/bin/supabase-mcp-server"
}
Windows
{
"env": {
"QUERY_API_KEY": "your-api-key",
"SUPABASE_REGION": "us-east-1",
"SUPABASE_DB_PASSWORD": "your-db-password",
"SUPABASE_PROJECT_REF": "your-project-ref",
"SUPABASE_ACCESS_TOKEN": "your-access-token",
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
},
"args": [],
"command": "C:\\Users\\username\\.local\\bin\\supabase-mcp-server.exe"
}
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





