services:
supabase-mcp:
image: silverstar3o7/supabase-mcp-http-stream-n8n:latest
container_name: supabase-mcp-server
restart: unless-stopped
ports:
- "${MCP_PORT:-3333}:${MCP_PORT:-3333}"
environment:
# Required Supabase Configuration
- SUPABASE_ACCESS_TOKEN=${SUPABASE_ACCESS_TOKEN}
- SUPABASE_PROJECT_REF=${SUPABASE_PROJECT_REF}
# Optional: Feature groups to enable
- MCP_FEATURES=${MCP_FEATURES:-database,docs,development,functions,account,debug,branching,storage}
# Optional: Read-only mode (true/false)
- MCP_READ_ONLY=${MCP_READ_ONLY:-true}
# Optional: Port for HTTP server
- MCP_PORT=${MCP_PORT:-3333}
# Optional: Node environment
- NODE_ENV=${NODE_ENV:-production}
# Security: API Keys for authentication (highly recommended)
- MCP_API_KEYS=${MCP_API_KEYS}
# Security: Rate limiting
- MCP_RATE_LIMIT_REQUESTS=${MCP_RATE_LIMIT_REQUESTS:-100}
- MCP_RATE_LIMIT_GENERAL=${MCP_RATE_LIMIT_GENERAL:-60}
# Security: CORS allowed origins
- MCP_ALLOWED_ORIGINS=${MCP_ALLOWED_ORIGINS:-*}
# Enable experimental webcrypto for SSE
- NODE_OPTIONS=--experimental-global-webcrypto
- EXPRESS_TRUST_PROXY=1
# Start HTTP server with SSE support
command: ["node", "mcp-http-server.js"]
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:${MCP_PORT:-3333}/health", "||", "exit", "1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# Resource limits to prevent abuse
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
reservations:
memory: 256M
cpus: '0.25'
# Security: Run as non-root user
user: "1001:1001"
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"