Supabase Coolify MCP Server
Enables comprehensive management of self-hosted Supabase instances including database migrations, edge functions deployment, storage bucket management, authentication configuration, realtime settings, and health monitoring.
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 Coolify MCP Server deploy the latest database migration to production"
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 Coolify MCP Server
β‘ One-Click Install
Install directly in your favorite AI coding tool:
Claude Code:
claude mcp add supabase-coolify -- npx -y supabase-coolify-mcp-serverNote: After installation, you'll need to configure the required environment variables. See Configuration below.
A comprehensive TypeScript MCP (Model Context Protocol) server for managing self-hosted Supabase on Coolify. This server enables AI agents to fully deploy migrations, push edge functions, configure services, and manage Supabase deployments with ease.
π¦ NPM Package β’ π Documentation β’ π Quick Start
Related MCP server: Supabase MCP Server - Self-Hosted Edition
π Features
Supabase Management
Database Migrations: Deploy, track, rollback, and manage database migrations
Migration Rollback: Safely rollback migrations with down SQL support
Supabase CLI Integration: Full CLI integration for local development and deployment
Edge Functions: Deploy, invoke, monitor, and delete edge functions
Storage Management: Create and manage storage buckets
Auth Configuration: Configure authentication providers and settings
Realtime Configuration: Manage realtime service settings
Health Monitoring: Check status of all Supabase services
Type Generation: Generate TypeScript types from database schema
Production Features
Input Validation: Zod-based validation for all tool inputs
Health Checks: Automatic startup checks and verification tool
Error Handling: Comprehensive error messages with troubleshooting hints
Type Safety: Full TypeScript support throughout
Coolify Integration
Application Management: List, deploy, start, stop, and restart applications
Service Management: Control Coolify services
Database Management: Manage Coolify-hosted databases
Environment Variables: Update application configuration securely
Logs: Access application logs for debugging
Deployment Automation
One-Click Deployment: Deploy complete Supabase instances on Coolify
Configuration Management: Update deployment settings dynamically
Status Monitoring: Track deployment health and status
π Prerequisites
Node.js >= 18.0.0
A Coolify instance (self-hosted or cloud)
Coolify API token with appropriate permissions
A self-hosted Supabase instance (or ready to deploy one)
π§ Installation
Method 1: NPM (Recommended)
Install globally via NPM:
npm install -g supabase-coolify-mcp-serverOr use directly with npx (no installation needed):
npx supabase-coolify-mcp-serverPackage: https://www.npmjs.com/package/supabase-coolify-mcp-server
Method 2: From Source
Clone and build from GitHub:
git clone https://github.com/dj-pearson/supabase-coolify-mcp-server.git
cd supabase-coolify-mcp-server
npm install
npm run buildβοΈ Configuration
Environment Variables
Create a .env file or set the following environment variables:
# Required: Coolify Configuration
COOLIFY_API_URL=http://localhost:8000
COOLIFY_API_TOKEN=your-coolify-api-token-here
# Required: Supabase Configuration
SUPABASE_URL=https://your-supabase-instance.example.com
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key
# Optional: Coolify Team
COOLIFY_TEAM_ID=optional-team-id
# Optional: Supabase Additional Config
SUPABASE_ANON_KEY=your-supabase-anon-key
SUPABASE_PROJECT_ID=your-project-id
SUPABASE_PROJECT_REF=your-project-ref
SUPABASE_FUNCTIONS_URL=https://your-supabase-instance.example.com/functions/v1
# Optional: Direct Database Access
SUPABASE_DB_HOST=localhost
SUPABASE_DB_PORT=5432
SUPABASE_DB_NAME=postgres
SUPABASE_DB_USER=postgres
SUPABASE_DB_PASSWORD=your-db-passwordGetting API Tokens
Coolify API Token
Log into your Coolify instance
Navigate to "Keys & Tokens" > "API tokens"
Click "Create New Token"
Select permissions (recommended:
*for full access)Copy the generated token
Supabase Service Role Key
For self-hosted Supabase:
Log into your Supabase dashboard
Go to Settings > API
Copy the
service_rolekey (keep this secure!)
Or from your Supabase deployment environment variables:
echo $SERVICE_ROLE_KEYπ― Usage
β οΈ IMPORTANT: Environment Variables Required
The MCP server requires environment variables to connect to Coolify and Supabase.
Recommended Setup (Works for Everyone):
Add environment variables directly to your MCP configuration:
{
"mcpServers": {
"supabase-coolify": {
"command": "npx",
"args": ["-y", "supabase-coolify-mcp-server"],
"env": {
"COOLIFY_API_URL": "http://your-coolify-url:8000",
"COOLIFY_API_TOKEN": "your-actual-token",
"SUPABASE_URL": "https://your-supabase-url.com",
"SUPABASE_SERVICE_ROLE_KEY": "your-actual-service-role-key"
}
}
}
}Replace the placeholder values with your actual credentials!
π Configuration Options
The server supports three methods for providing environment variables (in priority order):
MCP Config
envsection β RECOMMENDED - Works for everyone, self-containedSystem environment variables - For advanced users who want credentials outside config
.envfile with wrapper script - For local development only (not scalable)
For detailed setup instructions for each method, see: MCP_CONFIGURATION.md
Common Mistake: β Leaving placeholder values like https://your-supabase-instance.example.com
Solution: β
Replace ALL placeholders with your actual URLs and credentials!
With Claude Desktop
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Using NPX (Recommended - Always Latest)
{
"mcpServers": {
"supabase-coolify": {
"command": "npx",
"args": ["-y", "supabase-coolify-mcp-server"],
"env": {
"COOLIFY_API_URL": "http://localhost:8000",
"COOLIFY_API_TOKEN": "your-coolify-api-token",
"SUPABASE_URL": "https://your-supabase-instance.example.com",
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
}
}
}
}Using Global Installation
First install globally:
npm install -g supabase-coolify-mcp-serverThen configure:
{
"mcpServers": {
"supabase-coolify": {
"command": "supabase-coolify-mcp",
"env": {
"COOLIFY_API_URL": "http://localhost:8000",
"COOLIFY_API_TOKEN": "your-coolify-api-token",
"SUPABASE_URL": "https://your-supabase-instance.example.com",
"SUPABASE_SERVICE_ROLE_KEY": "your-service-role-key"
}
}
}
}Development Mode
# Using environment variables
export COOLIFY_API_URL="http://localhost:8000"
export COOLIFY_API_TOKEN="your-token"
export SUPABASE_URL="https://your-instance.example.com"
export SUPABASE_SERVICE_ROLE_KEY="your-key"
npm run dev
# Or with .env file
npm run devRunning Built Version
npm run build
npm startπ οΈ Available Tools
Database Migration Tools
list_migrations
List all database migrations with their status.
// No parameters requireddeploy_migration
Deploy a new database migration.
{
"sql": "CREATE TABLE users (id SERIAL PRIMARY KEY, email TEXT);",
"name": "create_users_table"
}execute_sql
Execute raw SQL query on the Supabase database.
{
"sql": "SELECT * FROM users LIMIT 10;"
}get_migration_status
Get status of a specific migration.
{
"version": "20231201120000"
}Edge Functions Tools
list_edge_functions
List all deployed edge functions.
deploy_edge_function
Deploy a new edge function.
{
"name": "hello-world",
"code": "export default function handler(req) { return new Response('Hello World'); }",
"verify_jwt": true
}delete_edge_function
Delete an edge function.
{
"name": "hello-world"
}get_edge_function_logs
Get logs for an edge function.
{
"name": "hello-world",
"limit": 100
}invoke_edge_function
Invoke an edge function.
{
"name": "hello-world",
"payload": { "key": "value" }
}Storage Tools
list_storage_buckets
List all storage buckets.
create_storage_bucket
Create a new storage bucket.
{
"id": "avatars",
"public": true,
"file_size_limit": 5242880
}delete_storage_bucket
Delete a storage bucket.
{
"id": "avatars"
}Auth & Configuration Tools
get_auth_config
Get authentication configuration.
update_auth_config
Update authentication configuration.
{
"config": {
"site_url": "https://myapp.com",
"enable_signup": true
}
}check_supabase_health
Check health of all Supabase services.
get_supabase_version
Get Supabase version information.
verify_setup β
Verify system setup and check health of all services (Coolify, Supabase, CLI).
This comprehensive tool checks:
Coolify connection and authentication
Supabase connection and authentication
Database accessibility
CLI availability
Response times and service status
Returns: Detailed health report with recommendations for any issues found.
See docs/VERIFICATION.md for complete verification guide.
Coolify Management Tools
list_coolify_applications
List all Coolify applications.
get_coolify_application
Get details of a specific application.
{
"uuid": "app-uuid-here"
}update_coolify_application_env
Update application environment variables.
{
"uuid": "app-uuid-here",
"env": {
"NODE_ENV": "production",
"API_KEY": "secret"
}
}deploy_coolify_application
Deploy a Coolify application.
{
"uuid": "app-uuid-here"
}start_coolify_application / stop_coolify_application / restart_coolify_application
Control application lifecycle.
{
"uuid": "app-uuid-here"
}get_coolify_logs
Get application logs.
{
"uuid": "app-uuid-here",
"lines": 100
}Deployment Tools
deploy_supabase_to_coolify
Deploy a complete Supabase instance on Coolify.
{
"name": "my-supabase",
"config": {
"postgres_version": "15",
"enable_realtime": true,
"enable_storage": true,
"enable_auth": true,
"custom_domain": "https://supabase.myapp.com",
"environment_variables": {
"CUSTOM_VAR": "value"
}
}
}update_supabase_deployment
Update an existing Supabase deployment.
{
"uuid": "app-uuid-here",
"config": {
"enable_graphql": true
}
}get_deployment_status
Get status of a Supabase deployment.
{
"uuid": "app-uuid-here"
}π MCP Resources
The server exposes these resources for MCP clients:
supabase://migrations- All database migrationssupabase://edge-functions- All edge functionssupabase://storage-buckets- All storage bucketssupabase://auth-config- Authentication configurationsupabase://health- Service health statuscoolify://applications- All Coolify applicationscoolify://services- All Coolify servicescoolify://databases- All Coolify databases
π Security Best Practices
Never commit API tokens to version control
Use environment variables for sensitive data
Restrict API token permissions to minimum required
Rotate tokens regularly
Use service role key only on secure servers
Enable JWT verification for edge functions
Validate all inputs (automatic with Zod schemas)
Verify setup before production deployments
Set appropriate file permissions on configuration files:
chmod 600 ~/.env
chmod 600 ~/Library/Application\ Support/Claude/claude_desktop_config.jsonπ§ͺ Testing & Verification
Build and Type Check
# Run type checking
npm run typecheck
# Run linter
npm run lint
# Build project
npm run buildVerify Setup
After starting the server, verify everything is working:
# Start the server
npm start
# Then ask Claude:
"Run verify_setup to check if everything is configured correctly"See docs/VERIFICATION.md for complete verification guide.
π Diagnostics & Testing
Before reporting issues or if you're having connection problems, use the built-in diagnostic tool:
Quick Diagnosis
Run the automated diagnostic tool to check your setup:
# Using npm
npm run diagnose
# Or on Windows
.\diagnose.ps1
# Or on Linux/Mac
./diagnose.shThe diagnostic tool will automatically check:
β
.envfile existence and configurationβ Required environment variables
β Coolify API connection and authentication
β Supabase connection and authentication
β All Supabase services health
β Network connectivity
Expected Output (When Working)
π’ ALL CHECKS PASSED - MCP Server should work correctly
β
Passed: 10
β Failed: 0
β οΈ Warnings: 0Common Diagnostic Issues
Missing .env File
β .env file NOT found!Fix: cp env.example .env then edit with your credentials
Placeholder Values
β ENV: COOLIFY_API_TOKEN: Contains placeholder valueFix: Replace your-coolify-api-token-here with actual token from Coolify Dashboard β Keys & Tokens
Wrong Supabase Key
β Supabase Authentication: Invalid service role keyFix: Make sure you're using the service_role key, NOT the anon key!
Get it from: Supabase Dashboard β Settings β API β service_role key
Connection Failed
β Coolify Connection: ECONNREFUSEDFix: Verify Coolify is running and accessible at the configured URL
Getting Credentials
Coolify API Token:
Coolify Dashboard β Profile β Keys & Tokens β API Tokens
Click "Create New Token"
Copy the token (you won't see it again!)
Add to
.envasCOOLIFY_API_TOKEN
Supabase Service Role Key:
Supabase Cloud: Dashboard β Settings β API β Copy
service_rolekeySelf-hosted: Check Coolify deployment environment variables for
SERVICE_ROLE_KEY
Quick Start Guide
For detailed troubleshooting, see:
START_HERE.md - Quick start with diagnostics
DIAGNOSE_NOW.md - Step-by-step diagnosis
TROUBLESHOOTING.md - Comprehensive troubleshooting guide
π Troubleshooting
Common Issues
1. Missing Environment Variables
Error: Missing required environment variables: COOLIFY_API_URL, COOLIFY_API_TOKEN
Solution: Ensure all required environment variables are set. Check your .env file or Claude Desktop configuration.
2. Connection Failed
Error: Failed to connect to Coolify API
Solution:
Verify Coolify instance is running
Check API URL is correct (include
http://orhttps://)Ensure API token has proper permissions
Check network connectivity
3. Authentication Failed
Error: Unauthorized or 401
Solution:
Verify API tokens are correct
Check token hasn't expired
Ensure token has required permissions
4. MCP Server Not Appearing
Solution:
Restart Claude Desktop
Check configuration file path is correct for your OS
Verify JSON syntax in configuration
Check server logs for errors
Debug Mode
Run with debug output:
DEBUG=* npm startπ Example Use Cases
1. Deploy a New Supabase Instance
// Using the MCP tool
deploy_supabase_to_coolify({
name: "production-supabase",
config: {
postgres_version: "15",
enable_realtime: true,
enable_storage: true,
custom_domain: "https://api.myapp.com"
}
})2. Deploy Database Migration
deploy_migration({
name: "add_user_profiles",
sql: `
CREATE TABLE user_profiles (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
user_id UUID REFERENCES auth.users(id),
display_name TEXT,
avatar_url TEXT,
created_at TIMESTAMP DEFAULT NOW()
);
`
})3. Deploy Edge Function
deploy_edge_function({
name: "send-email",
code: `
import { serve } from 'https://deno.land/std@0.168.0/http/server.ts'
serve(async (req) => {
const { to, subject, body } = await req.json()
// Send email logic here
return new Response(JSON.stringify({ success: true }))
})
`,
verify_jwt: true
})4. Monitor Deployment Health
// Check overall health
check_supabase_health()
// Get specific deployment status
get_deployment_status({ uuid: "your-app-uuid" })
// View logs
get_coolify_logs({ uuid: "your-app-uuid", lines: 100 })π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π License
MIT
π Links
NPM Package: https://www.npmjs.com/package/supabase-coolify-mcp-server
GitHub Repository: https://github.com/dj-pearson/supabase-coolify-mcp-server
Coolify: https://coolify.io - Self-hostable Heroku/Netlify alternative
Supabase: https://supabase.com - Open source Firebase alternative
Model Context Protocol: https://modelcontextprotocol.io - MCP specification
π Support
For issues and questions:
Check the troubleshooting section
Note: This MCP server is designed for self-hosted Supabase instances on Coolify. It provides comprehensive management capabilities while maintaining security through environment variables and proper token handling.
Available Tools
56 toolscheck_cli_installedB
Check if Supabase CLI is installed and get version
Inputs: no named parameters.
check_supabase_healthC
Check health of all Supabase services
Inputs: no named parameters.
create_migration_with_rollbackB
Create a migration with both up and down SQL for safe rollbacks
Inputs: name (required), up_sql (required), down_sql (required).
create_storage_bucketC
Create a new storage bucket
Inputs: id (required), public, file_size_limit.
delete_edge_functionC
Delete an edge function
Inputs: name (required).
delete_storage_bucketB
Delete a storage bucket
Inputs: id (required).
deploy_coolify_applicationC
Deploy a Coolify application
Inputs: uuid (required).
deploy_edge_functionC
Deploy a new edge function
Inputs: name (required), code (required), verify_jwt.
deploy_migrationA
Deploy a new database migration. NOTE: For self-hosted Supabase, consider using supabase_migration_new + supabase_db_push instead for better reliability.
Inputs: sql (required), name (required).
deploy_supabase_to_coolifyC
Deploy a complete Supabase instance on Coolify
Inputs: name (required), config.
execute_sqlA
Execute raw SQL query on Supabase database. NOTE: For self-hosted Supabase, use supabase_cli_execute with "db execute" for better reliability.
Inputs: sql (required).
get_auth_configA
Get authentication configuration
Inputs: no named parameters.
get_coolify_applicationC
Get details of a specific Coolify application
Inputs: uuid (required).
get_coolify_databaseD
Execute get_coolify_database
Inputs: no named parameters.
get_coolify_logsB
Get application logs from Coolify
Inputs: uuid (required), lines.
get_coolify_serviceA
Get details of a specific Coolify service
Inputs: uuid (required).
get_deployment_statusB
Get status of Supabase deployment on Coolify
Inputs: uuid (required).
get_edge_function_logsB
Get logs for an edge function
Inputs: name (required), limit.
get_migration_statusB
Get status of a specific migration
Inputs: version (required).
get_realtime_configD
Execute get_realtime_config
Inputs: no named parameters.
get_supabase_versionB
Get Supabase version information
Inputs: no named parameters.
invoke_edge_functionC
Invoke an edge function
Inputs: name (required), payload.
list_coolify_applicationsB
List all Coolify applications
Inputs: no named parameters.
list_coolify_databasesC
Execute list_coolify_databases
Inputs: no named parameters.
list_coolify_servicesA
List all Coolify services
Inputs: no named parameters.
list_edge_functionsA
List all deployed edge functions
Inputs: no named parameters.
list_migrationsB
List all database migrations with their status
Inputs: no named parameters.
list_storage_bucketsA
List all storage buckets
Inputs: no named parameters.
restart_coolify_applicationB
Restart a Coolify application
Inputs: uuid (required).
rollback_last_migrationsC
Rollback the last N migrations
Inputs: count.
rollback_migrationB
Rollback a specific migration (optionally with down SQL)
Inputs: version (required), down_sql.
rollback_migration_with_down_sqlB
Rollback a migration using its stored down SQL
Inputs: version (required).
rollback_to_versionB
Rollback all migrations after a specific version
Inputs: version (required).
start_coolify_applicationC
Start a Coolify application
Inputs: uuid (required).
start_coolify_serviceC
Start a Coolify service
Inputs: uuid (required).
stop_coolify_applicationB
Stop a Coolify application
Inputs: uuid (required).
stop_coolify_serviceC
Stop a Coolify service
Inputs: uuid (required).
supabase_cli_executeC
Execute arbitrary Supabase CLI command
Inputs: command (required).
supabase_db_diffC
Generate migration from database schema changes
Inputs: name (required).
supabase_db_pushA
Push local migrations to remote database
Inputs: no named parameters.
supabase_db_resetB
Reset local database to initial state
Inputs: no named parameters.
supabase_functions_deployC
Deploy edge functions using Supabase CLI
Inputs: function_name.
supabase_functions_serveC
Serve edge functions locally
Inputs: function_name.
supabase_gen_typesC
Generate TypeScript types from database schema
Inputs: output.
supabase_initC
Initialize a new Supabase project
Inputs: path.
supabase_linkC
Link to a remote Supabase project
Inputs: project_ref (required), password.
supabase_migration_listC
List all migrations (CLI)
Inputs: no named parameters.
supabase_migration_newC
Create a new migration file
Inputs: name (required).
supabase_migration_repairC
Repair migration history
Inputs: no named parameters.
supabase_startB
Start local Supabase development environment
Inputs: no named parameters.
supabase_statusB
Get status of local Supabase services
Inputs: no named parameters.
supabase_stopA
Stop local Supabase development environment
Inputs: no named parameters.
update_auth_configC
Update authentication configuration
Inputs: config (required).
update_coolify_application_envC
Update application environment variables
Inputs: uuid (required), env (required).
update_supabase_deploymentB
Update an existing Supabase deployment
Inputs: uuid (required), config (required).
verify_setupA
Verify system setup and check health of all services (Coolify, Supabase, CLI)
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 56 tools
Tools are generally distinct by domain (Supabase vs Coolify), but overlaps exist: multiple rollback tools (rollback_last_migrations, rollback_migration, rollback_migration_with_down_sql, rollback_to_version) and edge function deployment (deploy_edge_function vs supabase_functions_deploy). Notes like execute_sql suggesting supabase_cli_execute add ambiguity.
Naming is inconsistent: some tools use verb_noun (create_migration_with_rollback), others use supabase_ prefix (supabase_db_diff), and Coolify tools mix verb_coolify_noun (deploy_coolify_application) and get/list variations (get_coolify_database vs list_coolify_databases). No consistent pattern.
56 tools is excessive for a server covering two platforms. Many tools are thin wrappers over CLI commands (supabase_*), leading to redundancy. A more focused set (20-30 tools) would be more manageable.
The tool set covers major workflows: migrations, edge functions, storage, auth, realtime for Supabase, and CRUD for Coolify applications/services. Minor gaps like database backup/restore are present, but overall lifecycle coverage is strong.
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.
Build and deploy backends: auth, Postgres/MySQL/vector databases, storage, functions, hosting, CDN
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.-
- FlicenseNot gradedqualityFmaintenanceEnables comprehensive management of self-hosted or cloud Supabase instances with 54+ tools for database operations, authentication, storage, real-time subscriptions, migrations, monitoring, and security auditing.7-
- AlicenseBqualityCmaintenanceEnables control and management of Coolify self-hosted PaaS instances, allowing you to deploy applications, manage databases, monitor servers, and execute operations directly from AI assistants.8916 npm28MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to access and manage Supabase projects through the Model Context Protocol, supporting database operations, edge functions, storage, and documentation search. It provides a complete toolset for SQL execution, migration management, and real-time project debugging.-