Supabase Management MCP Server

Supabase Management MCP Server

MCP tools for managing your self-hosted Supabase instance. Combines Edge Function CRUD, migration management, log monitoring, and Studio MCP proxy into a single endpoint.

Category
访问服务器

README

Supabase Management MCP Server

Supabase MCP Server — MCP (Model Context Protocol) tools for managing your self-hosted Supabase instance.

Combines Edge Function CRUD, migration management, log monitoring, and Studio MCP proxy into a single endpoint. Vibe Coded.

License: MIT Node.js MCP SDK


🚀 Features

Category Tool Count Description
Edge Functions 6 CRUD + deploy (list, view, create, update, delete, restart)
Migrations 4 SQL migration management (list, view, apply, raw SQL execute)
Logs 2 Docker container logs (edge runtime + any container)
Studio Proxy ~11 Proxies Supabase Studio's built-in MCP tools

Total: 12 management + ~11 Studio = ~23 tools on a single MCP endpoint!


📦 Quick Start

1. Clone & Build

git clone https://github.com/ubeydtalha/supabase-mgmt-mcp.git
cd supabase-mgmt-mcp
cp .env.example .env
# Fill in your Supabase credentials in .env
npm install
npm run build

2. Run

# Directly with Node.js
npm start

# With Docker
docker compose up -d

3. Connect to VS Code

Add to ~/.vscode/mcp.json in VS Code:

{
  "servers": {
    "supabase-mgmt": {
      "type": "url",
      "url": "http://localhost:3200/mcp",
      "headers": {
        "apikey": "supabase_mgmt_api_key_here",
        "MCP-Protocol-Version": "2025-06-18"
      }
    }
  }
}

🛠️ Tool Reference

Edge Functions

Tool Description
supabase_mgmt_list_functions List all edge functions
supabase_mgmt_get_function Show function source code and details
supabase_mgmt_create_function Create a new edge function
supabase_mgmt_update_function Update function source code / JWT settings
supabase_mgmt_delete_function Delete a function (confirm: true required)
supabase_mgmt_deploy Restart edge runtime (activate changes)

Migrations & SQL

Tool Description
supabase_mgmt_list_migrations List migration files
supabase_mgmt_get_migration View migration SQL content
supabase_mgmt_apply_migration Apply a migration file
supabase_mgmt_run_sql Execute raw SQL

Logs

Tool Description
supabase_mgmt_get_logs Fetch edge runtime logs
supabase_mgmt_get_container_logs Fetch logs from any Docker container

Studio Proxy (optional, enabled when STUDIO_MCP_URL is set)

Tool Description
list_tables List database tables
list_extensions List extensions
execute_sql Execute SQL queries
apply_migration Apply a migration
get_logs Get Supabase service logs
search_docs Search Supabase documentation
get_advisors Get performance/security advice
get_project_url Show project URL
get_publishable_keys Show API keys
generate_typescript_types Generate TypeScript type definitions
list_migrations List migrations

🔧 Environment Variables

Variable Required Default Description
PORT No 3200 Server port
SUPABASE_URL Yes — Supabase project URL (e.g. https://supabase.example.com)
SUPABASE_SERVICE_ROLE_KEY Yes — Service role key (for admin operations)
SUPABASE_MGMT_API_KEY Yes — API key to connect to the MCP server
SUPABASE_MGMT_API_KEYS No — Additional API keys (comma-separated)
FUNCTIONS_PATH No /functions Path to edge function files
MIGRATIONS_PATH No /migrations Path to migration SQL files
EDGE_CONTAINER_NAME No supabase-functions Edge runtime Docker container name
STUDIO_MCP_URL No — Enables Studio MCP proxy

🐳 Docker Deployment

Integration with Self-hosted Supabase

# docker-compose.yml (add to your stack)
services:
  supabase-mgmt-mcp:
    image: ghcr.io/ubeydtalha/supabase-mgmt-mcp:latest
    container_name: supabase-mgmt-mcp
    restart: unless-stopped
    ports:
      - "3200:3200"
    env_file: .env
    volumes:
      - /path/to/functions:/functions
      - /path/to/migrations:/migrations
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - supabase

With Kong API Gateway

# Add to Kong declarative config
services:
  - name: supabase-mgmt-mcp
    url: http://supabase-mgmt-mcp:3200/mcp
    routes:
      - name: mcp
        strip_path: false
        paths:
          - /mcp

⚠️ Important Notes

  1. Session Management: MCP StreamableHTTP transport expects a new session for each tools/call. VS Code Copilot handles this automatically.

  2. exec_sql Prerequisite: The exec_sql function must exist in PostgreSQL for apply_migration and run_sql tools:

    CREATE OR REPLACE FUNCTION public.exec_sql(sql_text text)
    RETURNS void LANGUAGE plpgsql SECURITY DEFINER SET search_path = public AS $$
    BEGIN EXECUTE sql_text; END; $$;
    GRANT EXECUTE ON FUNCTION public.exec_sql(text) TO anon, authenticated, service_role;
    
  3. Docker Socket: /var/run/docker.sock must be mounted for container logs and edge runtime restart.

  4. Activating Changes: After creating/updating/deleting functions, run supabase_mgmt_deploy to apply changes.


📚 Documentation


📄 License

MIT License — see LICENSE.


🤝 Contributing

PRs and issues are welcome. Please open an issue first for major changes.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选