Enable your favorite IDE to safely execute SQL queries, manage your database end-to-end, access Management API, and handle user authentication with built-in safety controls.
A feature-rich MCP server that enables any MCP clients (Cursor, Windsurf, Claude Desktop, Cline and others) to safely interact with Supabase databases. It provides tools for database management, SQL query execution, and Supabase Management API access with built-in safety controls.
Getting started • Feature overview • Troubleshooting • Changelog
stdio
protocolInstalling the server requires the following on your system:
If you plan to install via uv
, ensure it's installed.
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
Since v0.2.0 I introduced support for package installation. You can use your favorite Python package manager to install the server via:
# if pipx is installed (recommended)
pipx install supabase-mcp-server
# if uv is installed
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
# On Mac
source .venv/bin/activate
# On Windows
.venv\Scripts\activate
# Install package in editable mode
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.
The server uses the following environment variables:
Variable | Required | Default | Description |
---|---|---|---|
SUPABASE_PROJECT_REF | No | 127.0.0.1:54322 | Your Supabase project reference ID (or local host:port) |
SUPABASE_DB_PASSWORD | No | postgres | Your database password |
SUPABASE_REGION | No | 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 |
Note: The default values are configured for local Supabase development. For remote Supabase projects, you must provide your own values for
SUPABASE_PROJECT_REF
andSUPABASE_DB_PASSWORD
.
127.0.0.1:54322
postgresql://postgres.[project_ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres
⚠️ Important: Session pooling connections are not supported. The server exclusively uses transaction pooling for better compatibility with the MCP server architecture.
SUPABASE_ACCESS_TOKEN
to be sethttps://api.supabase.com
SUPABASE_SERVICE_ROLE_KEY
to be sethttp://127.0.0.1:54321
https://[project_ref].supabase.co
The server looks for configuration in this order (highest to lowest priority):
.env
File: A .env
file in your current working directory (only works when running from source)%APPDATA%\supabase-mcp\.env
~/.config/supabase-mcp/.env
⚠️ 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:
# Create config directory
# On macOS/Linux
mkdir -p ~/.config/supabase-mcp
# On Windows (PowerShell)
mkdir -Force "$env:APPDATA\supabase-mcp"
# Create and edit .env file
# On macOS/Linux
nano ~/.config/supabase-mcp/.env
# On Windows (PowerShell)
notepad "$env:APPDATA\supabase-mcp\.env"
Add your configuration values to the file:
SUPABASE_PROJECT_REF=your-project-ref
SUPABASE_DB_PASSWORD=your-db-password
SUPABASE_REGION=us-east-1
SUPABASE_ACCESS_TOKEN=your-access-token
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
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.
https://supabase.com/dashboard/project/<project-ref>
The server supports all Supabase regions:
us-west-1
- West US (North California)us-east-1
- East US (North Virginia) - defaultus-east-2
- East US (Ohio)ca-central-1
- Canada (Central)eu-west-1
- West EU (Ireland)eu-west-2
- West Europe (London)eu-west-3
- West EU (Paris)eu-central-1
- Central EU (Frankfurt)eu-central-2
- Central Europe (Zurich)eu-north-1
- North EU (Stockholm)ap-south-1
- South Asia (Mumbai)ap-southeast-1
- Southeast Asia (Singapore)ap-northeast-1
- Northeast Asia (Tokyo)ap-northeast-2
- Northeast Asia (Seoul)ap-southeast-2
- Oceania (Sydney)sa-east-1
- South America (São Paulo)In general, any MCP client that supports stdio
protocol should work with this MCP server. This server was explicitly tested to work with:
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.
Go to Settings -> Features -> MCP Servers and add a new server with this configuration:
# can be set to any name
name: supabase
type: command
# if you installed with pipx
command: supabase-mcp-server
# if you installed with uv
command: uv run supabase-mcp-server
# if the above doesn't work, use the full path (recommended)
command: /full/path/to/supabase-mcp-server # Find with 'which supabase-mcp-server' (macOS/Linux) or 'where supabase-mcp-server' (Windows)
If configuration is correct, you should see a green dot indicator and the number of tools exposed by the server.
Go to Cascade -> Click on the hammer icon -> Configure -> Fill in the configuration:
{
"mcpServers": {
"supabase": {
"command": "/Users/username/.local/bin/supabase-mcp-server", // update path
"env": {
"SUPABASE_PROJECT_REF": "your-project-ref",
"SUPABASE_DB_PASSWORD": "your-db-password",
"SUPABASE_REGION": "us-east-1", // optional, defaults to us-east-1
"SUPABASE_ACCESS_TOKEN": "your-access-token", // optional, for management API
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key" // optional, for Auth Admin SDK
}
}
}
}
If configuration is correct, you should see green dot indicator and clickable supabase server in the list of available servers.
Claude Desktop also supports MCP servers through a JSON configuration. Follow these steps to set up the Supabase MCP server:
Find the full path to the executable (this step is critical):
# On macOS/Linux
which supabase-mcp-server
# On Windows
where supabase-mcp-server
Copy the full path that is returned (e.g., /Users/username/.local/bin/supabase-mcp-server
).
Configure the MCP server in Claude Desktop:
{
"mcpServers": {
"supabase": {
"command": "/full/path/to/supabase-mcp-server", // Replace with the actual path from step 1
"env": {
"SUPABASE_PROJECT_REF": "your-project-ref",
"SUPABASE_DB_PASSWORD": "your-db-password",
"SUPABASE_REGION": "us-east-1", // optional, defaults to us-east-1
"SUPABASE_ACCESS_TOKEN": "your-access-token", // optional, for management API
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key" // optional, for Auth Admin SDK
}
}
}
}
⚠️ Important: Unlike Windsurf and Cursor, Claude Desktop requires the full absolute path to the executable. Using just the command name (
supabase-mcp-server
) will result in a "spawn ENOENT" error.
If configuration is correct, you should see the Supabase MCP server listed as available in Claude Desktop.
Cline also supports MCP servers through a similar JSON configuration. Follow these steps to set up the Supabase MCP server:
Find the full path to the executable (this step is critical):
# On macOS/Linux
which supabase-mcp-server
# On Windows
where supabase-mcp-server
Copy the full path that is returned (e.g., /Users/username/.local/bin/supabase-mcp-server
).
Configure the MCP server in Cline:
cline_mcp_settings.json
file{
"mcpServers": {
"supabase": {
"command": "/full/path/to/supabase-mcp-server", // Replace with the actual path from step 1
"env": {
"SUPABASE_PROJECT_REF": "your-project-ref",
"SUPABASE_DB_PASSWORD": "your-db-password",
"SUPABASE_REGION": "us-east-1", // optional, defaults to us-east-1
"SUPABASE_ACCESS_TOKEN": "your-access-token", // optional, for management API
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key" // optional, for Auth Admin SDK
}
}
}
}
If configuration is correct, you should see a green indicator next to the Supabase MCP server in the Cline MCP Servers list, and a message confirming "supabase MCP server connected" at the bottom of the panel.
Here are some tips & tricks that might help you:
supabase-mcp-server
directly from the terminal to see if it works. If it doesn't, there might be an issue with the installation.which supabase-mcp-server
(macOS/Linux) or where supabase-mcp-server
(Windows)supabase-mcp-server
/Users/username/.local/bin/supabase-mcp-server
or C:\Users\username\.local\bin\supabase-mcp-server.exe
mcp_config.json
or in .env
file placed in a global config directory (~/.config/supabase-mcp/.env
on macOS/Linux or %APPDATA%\supabase-mcp\.env
on Windows).~/.local/share/supabase-mcp/mcp_server.log
%USERPROFILE%\.local\share\supabase-mcp\mcp_server.log
# On macOS/Linux
cat ~/.local/share/supabase-mcp/mcp_server.log
# On Windows (PowerShell)
Get-Content "$env:USERPROFILE\.local\share\supabase-mcp\mcp_server.log"
If you are stuck or any of the instructions above are incorrect, please raise an issue.
A super useful tool to help debug MCP server issues is MCP Inspector. If you installed from source, you can run supabase-mcp-inspector
from the project repo and it will run the inspector instance. Coupled with logs this will give you complete overview over what's happening in the server.
📝 Running
supabase-mcp-inspector
, if installed from package, doesn't work properly - I will validate and fix in the coming release.
Since v0.3+ server provides comprehensive database management capabilities with built-in safety controls:
SQL Query Execution: Execute PostgreSQL queries with risk assessment
safe
: Read-only operations (SELECT) - always allowedwrite
: Data modifications (INSERT, UPDATE, DELETE) - require unsafe modedestructive
: Schema changes (DROP, CREATE) - require unsafe mode + confirmationSQL Parsing and Validation:
Automatic Migration Versioning:
Safety Controls:
asyncpg
Available Tools:
get_schemas
: Lists schemas with sizes and table countsget_tables
: Lists tables, foreign tables, and views with metadataget_table_schema
: Gets detailed table structure (columns, keys, relationships)execute_postgresql
: Executes SQL statements against your databaseconfirm_destructive_operation
: Executes high-risk operations after confirmationretrieve_migrations
: Gets migrations with filtering and pagination optionslive_dangerously
: Toggles between safe and unsafe modesSince v0.3.0 server provides secure access to the Supabase Management API with built-in safety controls:
Available Tools:
send_management_api_request
: Sends arbitrary requests to Supabase Management API with auto-injection of project refget_management_api_spec
: Gets the enriched API specification with safety information
get_management_api_safety_rules
: Gets all safety rules with human-readable explanationslive_dangerously
: Toggles between safe and unsafe operation modesSafety Controls:
safe
: Read-only operations (GET) - always allowedunsafe
: State-changing operations (POST, PUT, PATCH, DELETE) - require unsafe modeblocked
: Destructive operations (delete project, etc.) - never allowedNote: Management API tools only work with remote Supabase instances and are not compatible with local Supabase development setups.
I was planning to add support for Python SDK methods to the MCP server. Upon consideration I decided to only add support for Auth admin methods as I often found myself manually creating test users which was prone to errors and time consuming. Now I can just ask Cursor to create a test user and it will be done seamlessly. Check out the full Auth Admin SDK method docs to know what it can do.
Since v0.3.6 server supports direct access to Supabase Auth Admin methods via Python SDK:
get_auth_admin_methods_spec
to retrieve documentation for all available Auth Admin methodscall_auth_admin_method
to directly invoke Auth Admin methods with proper parameter handlingget_user_by_id
: Retrieve a user by their IDlist_users
: List all users with paginationcreate_user
: Create a new userdelete_user
: Delete a user by their IDinvite_user_by_email
: Send an invite link to a user's emailgenerate_link
: Generate an email link for various authentication purposesupdate_user_by_id
: Update user attributes by IDdelete_factor
: Delete a factor on a user (currently not implemented in SDK)The Auth Admin SDK provides several key advantages over direct SQL manipulation:
Functionality: Enables operations not possible with SQL alone (invites, magic links, MFA)
Accuracy: More reliable then creating and executing raw SQL queries on auth schemas
Simplicity: Offers clear methods with proper validation and error handling
user.id
instead of user["id"]
)invite_user_by_email
and generate_link
require email sending to be configured in your Supabase projectsignup
links don't require the user to existmagiclink
and recovery
links require the user to already exist in the systemdelete_factor
are exposed in the API but not fully implemented in the SDK"With great power comes great responsibility." While execute_postgresql
tool coupled with aptly named live_dangerously
tool provide a powerful and simple way to manage your Supabase database, it also means that dropping a table or modifying one is one chat message away. In order to reduce the risk of irreversible changes, since v0.3.8 the server supports:
safe
type: always allowed. Includes all read-only ops.write
type: requires write
mode to be enabled by the user.destructive
type: requires write
mode to be enabled by the user AND a 2-step confirmation of query execution for clients that do not execute tools automatically.Since v0.3.8 Safety Mode has been standardized across all services (database, API, SDK) using a universal safety manager. This provides consistent risk management and a unified interface for controlling safety settings across the entire MCP server.
All operations (SQL queries, API requests, SDK methods) are categorized into risk levels:
Low
risk: Read-only operations that don't modify data or structure (SELECT queries, GET API requests)Medium
risk: Write operations that modify data but not structure (INSERT/UPDATE/DELETE, most POST/PUT API requests)High
risk: Destructive operations that modify database structure or could cause data loss (DROP/TRUNCATE, DELETE API endpoints)Extreme
risk: Operations with severe consequences that are blocked entirely (deleting projects)Safety controls are applied based on risk level:
Any high-risk operations (be it a postgresql or api request) will be blocked even in unsafe
mode.
You will have to confirm and approve every high-risk operation explicitly in order for it to be executed.
For a more detailed roadmap, please see this discussion on GitHub.
I'm planning to research, if it's possible to connect to Supabase db logs which might be useful for debugging (if not already supported.)
Enjoy! ☺️
Seamless access to top MCP servers powering the future of AI integration.