
henkdz/selfhosted-supabase-mcp
Database managementЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
henkdz/selfhosted-supabase-mcp — это кандидат-сервер MCP, импортированный из https://github.com/henkdz/selfhosted-supabase-mcp.
Обзор
henkdz/selfhosted-supabase-mcp — это кандидат-сервер MCP, импортированный из https://github.com/henkdz/selfhosted-supabase-mcp.
Обзор (машинный перевод)
Обзор
Этот проект предоставляет сервер Model Context Protocol (MCP), специально разработанный для взаимодействия с самостоятельно размещёнными экземплярами Supabase. Он соединяет MCP-клиенты (например, расширения IDE) и вашими локальными или частными проектами Supabase, обеспечивая интроспекцию, управление и взаимодействие с базами данных напрямую из вашей среды разработки.
Этот сервер был создан с нуля, извлекая уроки из адаптации официального облачного MCP-сервера Supabase, чтобы обеспечить минимальную, сфокусированную реализацию, адаптированную для самостоятельного размещения задач.
Цель
Основная цель этого сервера — дать разработчикам, использующим собственные установки Supabase, использовать инструменты на базе MCP для задач, таких как:
- Запрос схем и данных баз данных.
- Управление миграцией баз данных.
- Проверка статистики базы данных и соединений.
- Управление пользователями аутентификации.
- Взаимодействие с Supabase Storage.
- Генерация определений типов.
Он избегает сложностей официального облачного сервера, связанных с управлением несколькими проектами и облачными API, предлагая упрощённый опыт для однопроектных, самостоятельных хостинговых сред.
Функции (реализованные инструменты)
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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"
]
}
}
}