- Home
- MCP servers
- Supabase
Supabase
- javascript
7
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"mistersandfr-supabase-mcp-selfhosted": {
"command": "python",
"args": [
"src/supabase_server.py"
],
"env": {
"SUPABASE_URL": "https://your-project.supabase.co",
"SUPABASE_ANON_KEY": "eyJ...",
"SUPABASE_SERVICE_KEY": "eyJ..."
}
}
}
}You run a self-hosted Supabase MCP Server to manage and automate administration tasks for your private Supabase instance. It exposes a rich set of MCP tools for database, auth, storage, real-time, migrations, monitoring, and more, enabling you to perform maintenance, monitoring, and governance directly against your Supabase deployment from a single, centralized endpoint.
How to use
Use an MCP client to connect to the server via either the HTTP self-hosted endpoint or the local stdio process you run on your machine or CI environment. The server exposes a main JSON-RPC endpoint for tool execution and a discovery endpoint that lists available tools. You can perform administrative actions, run migrations, query database stats, manage users and roles, handle storage, and monitor health and performance. Start by configuring your client with your server endpoint and the required Supabase credentials, then select the tool you want to run from the available tools list and execute it through the client. All actions are secured with input validation, rate limiting, and audit logging.
How to install
Prerequisites: you need Python 3.11+ and a Supabase instance (self-hosted or cloud). You will also set environment variables for the Supabase project.
Option A — SDK Smithery (recommended) follow these steps to install and run the MCP server via Smithery dev flow.
# Clone the repository
git clone https://github.com/MisterSandFR/Supabase-MCP-SelfHosted.git
cd Supabase-MCP-SelfHosted
# Install dependencies
pip install -r requirements.txt
# (Optional) Install the Smithery CLI if needed
npm i -g @smithery/cli
# Run the dev SDK (choose the environment you have)
smithery dev # or: smithery playground
Option B — HTTP self-hosted (compat) follow these steps to run the HTTP interface directly against your Supabase instance.
# Clone the repository
git clone https://github.com/MisterSandFR/Supabase-MCP-SelfHosted.git
cd Supabase-MCP-SelfHosted
# Install Python dependencies
pip install -r requirements.txt
# Configure environment variables
export SUPABASE_URL="https://your-project.supabase.co"
export SUPABASE_ANON_KEY="your-anon-key"
export SUPABASE_SERVICE_KEY="your-service-key" # Optional
# Start the external HTTP server
python src/supabase_server.py
With Docker (Railway / self-hosted) you can build and run a container that hosts the MCP server.
# Build and run (use the Railway-specific Dockerfile if needed)
docker build -f Dockerfile.railway -t supabase-mcp-server .
docker run -p 8000:8000 \
-e SUPABASE_URL="https://your-project.supabase.co" \
-e SUPABASE_ANON_KEY="your-anon-key" \
supabase-mcp-server
Additional configuration and credentials
Environment variables you will configure to connect to your Supabase project.
# Supabase Configuration
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=eyJ... (your anon key)
SUPABASE_SERVICE_KEY=eyJ... (optional)
# Server configuration
PORT=8000
PYTHONUNBUFFERED=1
Security and monitoring notes
The server validates inputs to prevent SQL injections, applies rate limiting by IP and user, keeps audit logs of all operations, requires HTTPS in production, securely handles secrets, and enforces Row Level Security policies for data protection. Real-time metrics, logs, health checks, and performance analysis help you maintain visibility into your MCP-enabled Supabase instance.
Deployment and workflow notes
You can deploy using Smithery, Railway, or Docker. Smithery is the recommended path for Python-based MCP servers. Railways provides a quick self-hosted path, and Docker offers containerized deployment for reproducible environments.
Troubleshooting and tips
If you encounter issues, verify that your Supabase URL and keys are correct, ensure the server port 8000 is reachable, and check the audit logs for failed operations. For cached or stale profiles in Smithery, re-save the profile and rerun the Scan.
Notes on integration
This MCP server is designed to work smoothly with the MCP Hub Central integration, enabling centralized discovery and orchestration of MCP servers within your environment.
Available tools
execute_sql
Execution of SQL queries against the database
list_tables
List database tables
inspect_schema
Inspect database schema
apply_migration
Apply migrations to the database
backup_database
Backup database content
restore_database
Restore database from a backup
vacuum_analyze
Vacuum and analyze database for maintenance
get_database_stats
Query database statistics
create_index
Create database index
drop_index
Drop database index
list_extensions
List database extensions
manage_extensions
Manage database extensions
execute_psql
Run psql commands
check_health
Check database health
get_database_connections
List active database connections
list_auth_users
List authentication users
create_auth_user
Create an authentication user
update_auth_user
Update an authentication user
delete_auth_user
Delete an authentication user
get_auth_user
Get authentication user details
verify_jwt_secret
Verify JWT secret
manage_roles
Manage authentication roles
manage_rls_policies
Manage Row Level Security policies
list_storage_buckets
List storage buckets
list_storage_objects
List storage objects
manage_storage_policies
Manage storage policies
upload_file
Upload a storage file
download_file
Download a storage file
delete_file
Delete a storage file
list_realtime_publications
List real-time publications
manage_realtime
Manage real-time settings
create_subscription
Create a real-time subscription
delete_subscription
Delete a real-time subscription
create_migration
Create a migration
list_migrations
List migrations
push_migrations
Push migrations to the server
validate_migration
Validate a migration
smart_migration
Smart migration tooling
auto_migrate
Automatic migrations
sync_schema
Synchronize database schema
import_schema
Import a database schema
get_logs
Retrieve server logs
metrics_dashboard
View metrics dashboard
analyze_performance
Analyze performance across operations
analyze_rls_coverage
Analyze RLS coverage
audit_security
Audit server security
generate_typescript_types
Generate TypeScript types from schemas
generate_crud_api
Generate CRUD API from database schemas
cache_management
Manage cache behavior and invalidation
environment_management
Manage environment variables and configurations
manage_secrets
Manage secret values securely
manage_functions
Manage server-side functions
manage_triggers
Manage database triggers
manage_webhooks
Manage webhooks