Supabase MCP Server
Provides comprehensive tools for managing self-hosted Supabase instances, including authentication, database operations, storage, edge functions, realtime, schema exploration, SQL queries, and security policies.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Supabase MCP Server show me the users table schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Supabase MCP Server
A comprehensive Model Context Protocol server for self-hosted Supabase instances
I built this MCP server for my own needs when working with self-hosted Supabase instances and Claude. Figured it might be useful for others, so here it is! π
This server provides 42 tools covering everything from database operations to edge functions - basically everything you can do in the Supabase dashboard, but through Claude.
What's This About?
When you're running your own Supabase instance and want Claude to help you manage it, the existing tools are pretty limited. So I built this comprehensive MCP server that gives Claude full access to:
π Authentication - User signup, login, session management
π Database - Full CRUD operations with smart query building
π Realtime - Subscribe to changes, create channels, broadcast messages
π Storage - File upload, download, bucket management
π‘οΈ Security - Row Level Security (RLS) policies and permissions
β‘ Edge Functions - Deploy, invoke, and manage serverless functions
ποΈ Schema - Explore tables, columns, and relationships
π SQL - Raw SQL execution with smart fallbacks
Related MCP server: Supabase MCP Server
Features
Complete Dashboard Parity - Pretty much everything you can do in Supabase Studio
Smart Error Handling - Helpful troubleshooting tips when things go wrong
Multiple Fallbacks - If one approach fails, it tries others automatically
Built-in Edge Functions - Local Node.js serverless handler for testing
Enhanced SQL - Client-side aggregation when raw SQL isn't available
TypeScript - Fully typed for better development experience
Quick Start
1. Install Dependencies
npm install2. Build the Project
npm run build3. Configure Claude Desktop
Copy mcp.json.example to your Claude Desktop config and update it:
{
"mcpServers": {
"supabase": {
"command": "node",
"args": ["/path/to/self-hosted-supabase-mcp/dist/index.js"],
"env": {
"SUPABASE_URL": "http://localhost:54321",
"SUPABASE_ANON_KEY": "your_anon_key_here",
"SUPABASE_SERVICE_ROLE_KEY": "your_service_role_key_here"
}
}
}
}4. Restart Claude Desktop
And you're good to go! Claude will now have access to all 42 Supabase tools.
Available Tools
Connection & Auth (5 tools)
connection_test- Test your Supabase connectionauth_signup- Register new usersauth_login- Authenticate usersauth_get_user- Get current user infoauth_logout- Sign out users
Database Operations (6 tools)
db_select- Query data with filters and sortingdb_insert- Insert new recordsdb_update- Update existing recordsdb_delete- Delete recordsdb_upsert- Insert or update (with conflict handling)db_count- Count records with filters
Schema Exploration (3 tools)
schema_get_tables- List all tablesschema_get_columns- Get column informationschema_get_relations- Explore foreign key relationships
Storage Management (6 tools)
storage_list_buckets- List storage bucketsstorage_create_bucket- Create new bucketsstorage_delete_bucket- Remove bucketsstorage_list_files- Browse filesstorage_upload_file- Upload files (base64)storage_download_file- Download filesstorage_delete_file- Remove filesstorage_get_public_url- Get public file URLs
Edge Functions (4 tools)
edge_list_functions- List deployed functionsedge_deploy_function- Deploy new functionsedge_invoke_function- Execute functionsedge_remove_function- Clean up functions
Realtime (3 tools)
realtime_subscribe- Listen to database changesrealtime_channel_create- Set up broadcast channelsrealtime_broadcast- Send messages to channels
SQL & Advanced Queries (6 tools)
sql_execute- Run SQL queries with smart parsingsql_call_rpc- Execute stored proceduressql_aggregate- COUNT, SUM, AVG, MIN, MAX operationssql_execute_raw- Raw SQL with multiple fallback methodssql_aggregate_enhanced- Advanced aggregation with client-side processingsql_analyze_table- Get detailed table statistics
Security & RLS (6 tools)
security_check_rls_status- Check Row Level Security statussecurity_enable_rls- Enable RLS on tablessecurity_disable_rls- Disable RLSsecurity_create_policy- Create RLS policiessecurity_list_policies- List existing policiessecurity_drop_policy- Remove policiessecurity_test_policy- Test policy effectiveness
What Makes This Different?
Most MCP servers for databases are pretty basic. This one is different because:
It actually works with self-hosted Supabase - Many tools assume cloud Supabase
Comprehensive coverage - 42 tools covering every major Supabase feature
Smart fallbacks - If the direct approach fails, it tries other methods
Built-in edge functions - Local Node.js serverless handler for testing
Real troubleshooting help - When something breaks, it tells you how to fix it
Configuration Options
You can customize the server through environment variables:
SUPABASE_URL- Your Supabase instance URLSUPABASE_ANON_KEY- Anonymous/public keySUPABASE_SERVICE_ROLE_KEY- Service role key (for admin operations)MCP_SERVER_NAME- Custom server name (default: "supabase-mcp-server")MCP_SERVER_VERSION- Custom version (default: "1.0.0")
Development
# Install dependencies
npm install
# Build for production
npm run build
# Development mode (watch for changes)
npm run dev
# Clean build artifacts
npm run cleanTroubleshooting
Connection Issues
Make sure your Supabase instance is running
Check if the URL and keys are correct
Verify network connectivity to your Supabase instance
Authentication Problems
Email confirmation might be enabled but SMTP not configured
Try disabling email confirmation in Supabase Dashboard
Check if the user already exists
SQL/Database Issues
Some advanced SQL features require service role key
RLS policies might be blocking access
Use
db_selectinstead of raw SQL for better compatibility
Contributing
Found a bug or want to add a feature? Feel free to open an issue or PR! This started as a personal project, but I'm happy to collaborate.
License
MIT - Use it however you want!
Why I Built This
I was getting frustrated with the limited Supabase integrations available for Claude, especially for self-hosted instances. Wanted something comprehensive that could handle everything I throw at it. Hope it helps you too!
Available Tools
42 toolsauth_get_userA
Get current authenticated user information
Inputs: no named parameters.
auth_loginC
Login user with email and password
Inputs: email (required), password (required).
auth_logoutA
Logout current user
Inputs: no named parameters.
auth_signupB
Register a new user with email and password
Inputs: email (required), password (required), options.
connection_testB
Test connection to Supabase database and get basic info
Inputs: no named parameters.
db_countA
Count rows in a table with optional filters
Inputs: table (required), filters.
db_deleteB
Delete rows from a table
Inputs: table (required), filters (required), returning.
db_insertB
Insert new row(s) into a table
Inputs: data (required), table (required), returning.
db_selectA
Select data from a table with optional filters and sorting
Inputs: table (required), limit, order, offset, +3 more.
db_updateB
Update existing rows in a table
Inputs: data (required), table (required), filters (required), returning.
db_upsertB
Insert or update rows (upsert) in a table
Inputs: data (required), table (required), returning, on_conflict.
edge_deploy_functionC
Deploy an Edge Function to Supabase
Inputs: function_code (required), function_name (required), import_map.
edge_invoke_functionC
Invoke a Supabase Edge Function
Inputs: function_name (required), headers, payload.
edge_list_functionsA
List available Edge Functions
Inputs: no named parameters.
edge_remove_functionA
Remove an Edge Function from local serverless handler
Inputs: function_name (required).
realtime_broadcastB
Broadcast a message to a channel
Inputs: event (required), payload (required), channel_name (required).
realtime_channel_createC
Create a real-time channel for broadcasting
Inputs: channel_name (required).
realtime_subscribeC
Subscribe to real-time changes on a table
Inputs: table (required), event, filter.
schema_get_columnsB
Get columns information for a specific table
Inputs: table_name (required), schema.
schema_get_relationsA
Get foreign key relationships for a table
Inputs: table_name (required), schema.
schema_get_tablesB
Get list of all tables in the database schema
Inputs: schema.
security_check_rls_statusC
Check RLS status for tables
Inputs: table_name.
security_create_policyB
Create a Row Level Security policy
Inputs: command (required), table_name (required), policy_name (required), roles, +2 more.
security_disable_rlsB
Disable Row Level Security (RLS) on a table
Inputs: table_name (required).
security_drop_policyB
Drop a Row Level Security policy
Inputs: table_name (required), policy_name (required).
security_enable_rlsB
Enable Row Level Security (RLS) on a table
Inputs: table_name (required).
security_list_policiesB
List all policies for a table
Inputs: table_name (required).
security_test_policyB
Test a policy by simulating different user contexts
Inputs: table_name (required), test_query (required), user_context.
sql_aggregateC
Execute SQL aggregate functions (COUNT, SUM, AVG, MIN, MAX)
Inputs: table (required), function (required), column, filters, +1 more.
sql_aggregate_enhancedB
Execute aggregate functions using raw SQL (bypasses Supabase client limitations)
Inputs: table (required), function (required), column, filters, +1 more.
sql_analyze_tableC
Get detailed table analysis including statistics
Inputs: table_name (required).
sql_call_rpcC
Call a stored procedure/function
Inputs: function_name (required), params.
sql_executeC
Execute raw SQL query (use with caution)
Inputs: query (required), params.
sql_execute_rawC
Execute raw SQL with enhanced error handling and result formatting
Inputs: query (required), params.
storage_create_bucketB
Create a new storage bucket
Inputs: name (required), public.
storage_delete_bucketB
Delete a storage bucket
Inputs: name (required).
storage_delete_fileB
Delete a file from storage
Inputs: paths (required), bucket (required).
storage_download_fileB
Download a file from storage
Inputs: path (required), bucket (required).
storage_get_public_urlB
Get public URL for a file
Inputs: path (required), bucket (required).
storage_list_bucketsA
List all storage buckets
Inputs: no named parameters.
storage_list_filesC
List files in a storage bucket
Inputs: bucket (required), path, limit.
storage_upload_fileB
Upload a file to storage (base64 encoded)
Inputs: path (required), bucket (required), file_base64 (required), content_type.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 42 tools
Several SQL tools have overlapping purposes: sql_execute, sql_execute_raw, and sql_aggregate_enhanced all essentially execute raw SQL with minor differences, making it unclear when to choose one over the other. The descriptions attempt to differentiate them but the boundaries are still fuzzy.
Most tools follow a domain_prefix_verb_noun pattern (e.g., db_select, storage_upload_file, edge_invoke_function), which is consistent. Minor deviations exist such as sql_aggregate_enhanced and sql_execute_raw, where suffixes break the standard verb_noun order, but the overall naming is clear.
With 42 tools, the server feels bloated, particularly due to redundant SQL tools (sql_execute, sql_execute_raw, sql_aggregate, sql_aggregate_enhanced) that inflate the count. While Supabase has a broad feature set, this could be consolidated to around 25-30 tools without losing functionality.
The tool set covers major Supabase areas: database CRUD, auth basics, realtime, storage, edge functions, and security. However, notable gaps exist in auth user management (e.g., listing users, updating user metadata) and schema modification (no create/alter table tools, rely on raw SQL). These are workable via sql_execute, so the impact is moderate.
Maintenance
Related MCP Connectors
Manage Supabase projects end to end across database, auth, storage, realtime, and migrations. Moniβ¦
Your Supabase account in natural language: run SQL, apply migrations, manage tables, storage, edge f
Supabase-compatible Postgres for agents: projects, branches, SQL, auth, storage, email.
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables comprehensive management of self-hosted or cloud Supabase instances with 54+ tools for database operations, authentication, storage, real-time subscriptions, migrations, and monitoring through MCP protocol.-
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Supabase projects, enabling them to manage tables, query data, deploy Edge Functions, handle migrations, and access project resources through natural language commands.Apache 2.0
- AlicenseCqualityDmaintenanceEnables comprehensive management of self-hosted Supabase instances on Coolify, including database migrations, edge functions deployment, storage management, auth configuration, and full application lifecycle control through AI agents.5612 npm3MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Supabase projects to manage databases, execute SQL queries, and handle project configurations. It enables tasks like table management, edge function deployment, and log retrieval through the Model Context Protocol.Apache 2.0