- 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
3.0 KiB
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_sqlfunction call logic - RPC function existence check and creation logic (using service key)
- Direct DB connection fallback/transactional method (
pg) - Async initialization logic (
client.initialize())
- Basic connection (
- Implement Server Entry Point (
src/index.ts)commandersetup for args/env varscreateSelfhostedSupabaseClientfactory usage- MCP SDK initialization (
stdio: true) - Tool registration
- Error handling
- Implement Tools (
src/tools/)- Schema & Migrations
list_tableslist_extensionslist_migrationsapply_migration
- Database Operations & Stats
execute_sqlget_database_connectionsget_database_stats
- Project Configuration
get_project_urlverify_jwt_secret- [-]
get_anon_key(Removed - security risk) - [-]
get_service_key(Removed - security risk)
- Development & Extension Tools
generate_typescript_typesrebuild_hooks
get_logs(Added - tries analytics stack, falls back to CSV logs)- Auth User Management
list_auth_usersget_auth_usercreate_auth_userdelete_auth_userupdate_auth_user
- Storage Insights
list_storage_bucketslist_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_functionsget_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)
- Schema & Migrations
- Add Basic README.md
- Test Infrastructure
- Bun test runner setup
- Utils tests
- Type definition tests