kcar 95af17c02d feat: migrate to docker-compose with selfhosted-supabase-mcp
- Replace legacy directory structure (api/, db/, functions/, logs/, pooler/) with
  single docker-compose.yml based self-hosted setup
- Add selfhosted-supabase-mcp TypeScript MCP server for database management
- Add .dockerignore for Docker build context
- Update .gitignore to exclude .env files, volumes/, backups, logs
2026-02-21 19:32:57 +00:00

3.0 KiB

Self-Hosted Supabase MCP Server - Implementation Plan

This plan outlines the steps to build the minimal self-hosted Supabase MCP server based on migration_notes.md.

Progress Tracking

  • Project Setup (package.json, tsconfig.json, dependencies, directories)
  • Bun Migration (replaced Node.js/npm with Bun runtime)
  • Define Core Types (src/types/)
  • Implement SelfhostedSupabaseClient (src/client/)
    • Basic connection (@supabase/supabase-js)
    • RPC execute_sql function call logic
    • RPC function existence check and creation logic (using service key)
    • Direct DB connection fallback/transactional method (pg)
    • Async initialization logic (client.initialize())
  • Implement Server Entry Point (src/index.ts)
    • commander setup for args/env vars
    • createSelfhostedSupabaseClient factory usage
    • MCP SDK initialization (stdio: true)
    • Tool registration
    • Error handling
  • Implement Tools (src/tools/)
    • Schema & Migrations
      • list_tables
      • list_extensions
      • list_migrations
      • apply_migration
    • Database Operations & Stats
      • execute_sql
      • get_database_connections
      • get_database_stats
    • Project Configuration
      • get_project_url
      • verify_jwt_secret
      • [-] get_anon_key (Removed - security risk)
      • [-] get_service_key (Removed - security risk)
    • Development & Extension Tools
      • generate_typescript_types
      • rebuild_hooks
    • get_logs (Added - tries analytics stack, falls back to CSV logs)
    • Auth User Management
      • list_auth_users
      • get_auth_user
      • create_auth_user
      • delete_auth_user
      • update_auth_user
    • Storage Insights
      • list_storage_buckets
      • list_storage_objects
    • Realtime Inspection
      • list_realtime_publications
    • Extension-Specific Tools
      • list_cron_jobs (for pg_cron)
      • list_vector_indexes (for pgvector)
    • Edge Function Management
      • list_edge_functions
      • get_edge_function_details
      • [-] deploy_edge_function (Skipped - requires filesystem access outside MCP scope)
    • Additional Tools (from Official Supabase MCP)
      • get_advisors (security/performance advisory notices via Splinter)
      • get_storage_config (storage bucket configuration)
      • update_storage_config (update storage bucket settings)
  • Add Basic README.md
  • Test Infrastructure
    • Bun test runner setup
    • Utils tests
    • Type definition tests