Enables comprehensive management of self-hosted Supabase instances including database migrations, edge functions deployment, storage bucket management, authentication configuration, realtime settings, and health monitoring.
Supabase Coolify MCP Server
ā” One-Click Install
Install directly in your favorite AI coding tool:
Claude Code:
Note: 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
š 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:
Or use directly with npx (no installation needed):
Package: https://www.npmjs.com/package/supabase-coolify-mcp-server
Method 2: From Source
Clone and build from GitHub:
āļø Configuration
Environment Variables
Create a .env file or set the following environment variables:
Getting 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:
šÆ 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:
Replace the placeholder values with your actual credentials!
š Configuration Options
The server supports three methods for providing environment variables (in priority order):
MCP Config ā RECOMMENDED - Works for everyone, self-contained
System environment variables - For advanced users who want credentials outside config
.env- 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)
Using Global Installation
First install globally:
Then configure:
Development Mode
Running Built Version
š ļø Available Tools
Database Migration Tools
list_migrations
List all database migrations with their status.
deploy_migration
Deploy a new database migration.
execute_sql
Execute raw SQL query on the Supabase database.
get_migration_status
Get status of a specific migration.
Edge Functions Tools
list_edge_functions
List all deployed edge functions.
deploy_edge_function
Deploy a new edge function.
delete_edge_function
Delete an edge function.
get_edge_function_logs
Get logs for an edge function.
invoke_edge_function
Invoke an edge function.
Storage Tools
list_storage_buckets
List all storage buckets.
create_storage_bucket
Create a new storage bucket.
delete_storage_bucket
Delete a storage bucket.
Auth & Configuration Tools
get_auth_config
Get authentication configuration.
update_auth_config
Update authentication configuration.
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.
update_coolify_application_env
Update application environment variables.
deploy_coolify_application
Deploy a Coolify application.
start_coolify_application / stop_coolify_application / restart_coolify_application
Control application lifecycle.
get_coolify_logs
Get application logs.
Deployment Tools
deploy_supabase_to_coolify
Deploy a complete Supabase instance on Coolify.
update_supabase_deployment
Update an existing Supabase deployment.
get_deployment_status
Get status of a Supabase deployment.
š 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:
š§Ŗ Testing & Verification
Build and Type Check
Verify Setup
After starting the server, verify everything is working:
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:
The 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)
Common Diagnostic Issues
Missing .env File
Fix: cp env.example .env then edit with your credentials
Placeholder Values
Fix: Replace your-coolify-api-token-here with actual token from Coolify Dashboard ā Keys & Tokens
Wrong Supabase Key
Fix: 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
Fix: 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:
š Example Use Cases
1. Deploy a New Supabase Instance
2. Deploy Database Migration
3. Deploy Edge Function
4. Monitor Deployment Health
š¤ 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.