
henkdz/selfhosted-supabase-mcp 是从 https://github.com/henkdz/selfhosted-supabase-mcp. 导入的 MCP 候选服务器。
概览
henkdz/selfhosted-supabase-mcp 是从 https://github.com/henkdz/selfhosted-supabase-mcp. 导入的 MCP 候选服务器。
概述(AI 翻译)
概述
该项目提供了一个专门设计用于与自托管Supabase实例交互的模型上下文协议(MCP)服务器。它弥合了MCP客户端(如IDE扩展)与本地或私有托管Supabase项目之间的桥梁,使数据库能够直接从开发环境中进行内省、管理和交互。
该服务器从零开始构建,借鉴了官方 Supabase 云 MCP 服务器的改进经验,提供一个最小化、聚焦于自托管用例的实现。
目的
该服务器的主要目标是使使用自托管 Supabase 安装的开发者能够利用基于 MCP 的工具完成以下任务:
- 查询数据库模式和数据。
- 管理数据库迁移。
- 检查数据库统计和连接。
- 管理认证用户。
- 与超核储存互动。
- 生成类型定义。
它避免了官方云服务器中多项目管理和云特定API的复杂性,为单项目自托管环境提供了更流畅的体验。
功能(实现工具)
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Self-Hosted Supabase MCP Server
Overview
This project provides a Model Context Protocol (MCP) server designed specifically for interacting with self-hosted Supabase instances. It bridges the gap between MCP clients (like IDE extensions) and your local or privately hosted Supabase projects, enabling database introspection, management, and interaction directly from your development environment.
This server was built from scratch, drawing lessons from adapting the official Supabase cloud MCP server, to provide a minimal, focused implementation tailored for the self-hosted use case.
Purpose
The primary goal of this server is to enable developers using self-hosted Supabase installations to leverage MCP-based tools for tasks such as:
- Querying database schemas and data.
- Managing database migrations.
- Inspecting database statistics and connections.
- Managing authentication users.
- Interacting with Supabase Storage.
- Generating type definitions.
It avoids the complexities of the official cloud server related to multi-project management and cloud-specific APIs, offering a streamlined experience for single-project, self-hosted environments.
Features (Implemented Tools)
Tools are categorized by privilege level:
- Regular tools are accessible by any authenticated Supabase JWT (
authenticatedorservice_rolerole). - Privileged tools require a
service_roleJWT (HTTP mode) or direct database/service-key access (stdio mode).
Schema & Migrations
| Tool | Description | Privilege |
|---|---|---|
list_tables |
Lists tables in the database schemas | Regular |
list_extensions |
Lists installed PostgreSQL extensions | Regular |
list_available_extensions |
Lists all available (installable) extensions | Regular |
list_migrations |
Lists applied migrations from supabase_migrations.schema_migrations |
Regular |
apply_migration |
Applies a SQL migration and records it in supabase_migrations.schema_migrations |
Privileged |
list_table_columns |
Lists columns for a specific table | Regular |
list_indexes |
Lists indexes for a specific table | Regular |
list_constraints |
Lists constraints for a specific table | Regular |
list_foreign_keys |
Lists foreign keys for a specific table | Regular |
list_triggers |
Lists triggers for a specific table | Regular |
list_database_functions |
Lists user-defined database functions | Regular |
get_function_definition |
Gets the source definition of a function | Regular |
get_trigger_definition |
Gets the source definition of a trigger | Regular |
安装
npx -y @smithery/cli install @HenkDz/selfhosted-supabase-mcp --client claude配置
{
"mcpServers": {
"selfhosted-supabase": {
"command": "bun",
"args": [
"run",
"<path-to-dist/index.js>", // e.g., "/home/user/selfhosted-supabase-mcp/dist/index.js"
"--url",
"<your-supabase-url>", // e.g., "http://localhost:8000"
"--anon-key",
"<your-anon-key>",
// Optional - Add these if needed by the tools you use
"--service-key",
"<your-service-key>",
"--db-url",
"<your-db-url>", // e.g., "postgresql://postgres:password@host:port/postgres"
"--jwt-secret",
"<your-jwt-secret>",
// Optional - Whitelist specific tools
"--tools-config",
"<path-to-your-mcp-tools.json>" // e.g., "./mcp-tools.json"
]
}
}
}