MCP server DBHub
Коммит 12 нояб. 2026 г.Connects AI clients to PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, and SQLite to explore schemas and execute SQL queries.
Также известен как bytebase/dbhub, @bytebase/dbhub
- Звёзды
- 3 843
- Инструменты
- —
- Загрузки, 30 дней
- 176 231
- Последняя версия
- 1.6.1
- Последний коммит
- 12 нояб. 2026 г.
- Лицензия
- MIT
Что такое DBHub MCP?
DBHub — это MCP server. Connects AI clients to PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, and SQLite to explore schemas and execute SQL queries.
Сводка сгенерирована из README проекта
О DBHub MCP server
Connecting AI clients to diverse database systems is what DBHub enables for developers using tools like Claude Desktop, Cursor, or VS Code. This lightweight gateway provides a single interface to interact with PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, and SQLite. By using a minimal set of tools, it preserves the context window of your AI client, consuming only 1.4k tokens by default.
Users can configure multiple simultaneous connections through a TOML file and manage access via SSH tunneling or SSL/TLS encryption. The server includes safety features such as read-only mode, row limiting, and query timeouts to prevent accidental or runaway operations. Beyond the standard execute_sql and search_objects tools, users can opt-in to explain_sql and health_check or define their own parameterized operations. It is designed to be a zero-dependency solution that works locally via npx or through Docker containers.
Что вы можете с ним делать
- 1Local Schema ExplorationA developer can use an AI client to navigate and understand complex database structures.
- 2Consolidating Database ConnectionsTeams can replace multiple specialized MCP servers with one single process to manage various database types.
- 3Safe Production DiagnosticsEngineers can perform troubleshooting on live data using built-in protections against heavy queries.
- 4Providing Data Access to Non-Technical StaffOrganizations can grant limited, read-only visibility into specific data views for employees who do not write code.
Взято из README проекта. Каждый вариант использования проверен на соответствие цитате из него.
Как установить DBHub MCP
Форматы проверены 10 ноя 2026Установка DBHub MCP в Claude Code
$ claude mcp add --env DB_PASSWORD=<YOUR_DB_PASSWORD> --env DSN=<YOUR_DSN> --env SSH_PASSPHRASE=<YOUR_SSH_PASSPHRASE> --env SSH_PASSWORD=<YOUR_SSH_PASSWORD> dbhub -- npx -y @bytebase/dbhubУстановка DBHub MCP в Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DB_PASSWORD": "<YOUR_DB_PASSWORD>",
"DSN": "<YOUR_DSN>",
"SSH_PASSPHRASE": "<YOUR_SSH_PASSPHRASE>",
"SSH_PASSWORD": "<YOUR_SSH_PASSWORD>"
}
}
}
}Установка DBHub MCP в VS Code
.vscode/mcp.json
{
"servers": {
"dbhub": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DB_PASSWORD": "<YOUR_DB_PASSWORD>",
"DSN": "<YOUR_DSN>",
"SSH_PASSPHRASE": "<YOUR_SSH_PASSPHRASE>",
"SSH_PASSWORD": "<YOUR_SSH_PASSWORD>"
}
}
}
}Установка DBHub MCP в Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DB_PASSWORD": "<YOUR_DB_PASSWORD>",
"DSN": "<YOUR_DSN>",
"SSH_PASSPHRASE": "<YOUR_SSH_PASSPHRASE>",
"SSH_PASSWORD": "<YOUR_SSH_PASSWORD>"
}
}
}
}Установка DBHub MCP в Codex
~/.codex/config.toml
[mcp_servers.dbhub] command = "npx" args = ["-y", "@bytebase/dbhub"] [mcp_servers.dbhub.env] DB_PASSWORD = "<YOUR_DB_PASSWORD>" DSN = "<YOUR_DSN>" SSH_PASSPHRASE = "<YOUR_SSH_PASSPHRASE>" SSH_PASSWORD = "<YOUR_SSH_PASSWORD>"
Установка DBHub MCP в Gemini CLI
~/.gemini/settings.json
{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DB_PASSWORD": "<YOUR_DB_PASSWORD>",
"DSN": "<YOUR_DSN>",
"SSH_PASSPHRASE": "<YOUR_SSH_PASSPHRASE>",
"SSH_PASSWORD": "<YOUR_SSH_PASSWORD>"
}
}
}
}Конфигурация
DB_PASSWORDСекретDatabase password
DSNСекретDatabase connection string (e.g., postgres://user:pass@host:5432/db)
SSH_PASSPHRASEСекретSSH key passphrase
SSH_PASSWORDСекретSSH password
DB_HOSTDatabase hostname
DB_NAMEDatabase name or SQLite file path
DB_PORTDatabase port
DB_TYPEDatabase type: postgres, mysql, mariadb, sqlserver, oracle, sqlite
DB_USERDatabase username
IDInstance identifier for tool names
PORTHTTP server port (default: 8080)
SSH_AUTH_SOCKPath to SSH agent socket
SSH_HOSTSSH server hostname
SSH_KEYPath to SSH private key
SSH_PORTSSH server port (default: 22)
SSH_USERSSH username
TRANSPORTTransport mode: stdio or http
| Название | Описание | Тип |
|---|---|---|
| DB_PASSWORD | Database password | Секрет |
| DSN | Database connection string (e.g., postgres://user:pass@host:5432/db) | Секрет |
| SSH_PASSPHRASE | SSH key passphrase | Секрет |
| SSH_PASSWORD | SSH password | Секрет |
| DB_HOST | Database hostname | |
| DB_NAME | Database name or SQLite file path | |
| DB_PORT | Database port | |
| DB_TYPE | Database type: postgres, mysql, mariadb, sqlserver, oracle, sqlite | |
| DB_USER | Database username | |
| ID | Instance identifier for tool names | |
| PORT | HTTP server port (default: 8080) | |
| SSH_AUTH_SOCK | Path to SSH agent socket | |
| SSH_HOST | SSH server hostname | |
| SSH_KEY | Path to SSH private key | |
| SSH_PORT | SSH server port (default: 22) | |
| SSH_USER | SSH username | |
| TRANSPORT | Transport mode: stdio or http |
Автоматические проверки
Запущено 12 нояб. 2026 г.Полный отчёт →Еще не проверено. Для сервера требуется оценка 80, отсутствие серьезных проблем и достаточно данных для нашей проверки. Как работают проверки
- Связанный и доступный исходный репозиторийПройдено
- Open source лицензия (OSI)Пройдено
- Коммит или релиз за последний годПройдено
- Имя пакета не похоже на популярный пакет@bytebase/dbhub looks like dchub-mcp-serverПроблема
- Удаленная конечная точка использует HTTPSНе проверялось
- Деструктивные инструменты помеченыНе проверялось
- Нет скрытых инструкций для моделиПройдено
- Нет критических уязвимостей в пакете и зависимостяхПройдено
README
Открыть на GitHub[!NOTE]
If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase.
+------------------+ +--------------+ +------------------+
| | | | | |
| Claude Desktop +--->+ +--->+ PostgreSQL |
| | | | | |
| Claude Code +--->+ +--->+ SQL Server |
| | | | | |
| Cursor +--->+ DBHub +--->+ Oracle |
| | | | | |
| VS Code +--->+ +--->+ SQLite |
| | | | | |
| Copilot CLI +--->+ +--->+ MySQL |
| | | | | |
| | | +--->+ MariaDB |
| | | | | |
+------------------+ +--------------+ +------------------+
MCP Clients MCP Server Databases
DBHub is a minimal MCP server: token-efficient, zero-dependency, and just two tools by default with opt-in extras. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases:
- Minimal: Zero dependency, token efficient with a minimal set of MCP tools to maximize context window
- Multi-Database: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, and SQLite through a single interface
- Multi-Connection: Connect to multiple databases simultaneously with TOML configuration
- Guardrails: Read-only mode, row limiting, and query timeout to prevent runaway operations
- Secure Access: SSH tunneling and SSL/TLS encryption
DBHub is the official example in the Claude Code docs for connecting to PostgreSQL via MCP.
Token Efficiency
DBHub loads just 2 tools by default at 1.4k tokens — 13-14x fewer than alternatives — keeping the context window open for your actual work.
| MCP Server | Default Config | Default Tools |
|---|---|---|
| DBHub | 1.4k | 2 (execute_sql, search_objects) |
| MCP Toolbox | 19.0k | 28 |
| Supabase MCP | 19.3k | all |
Use Cases
- Local Development: Schema exploration, query validation, and data debugging with Claude Code, VS Code, Cursor, etc.
- Non-Technical Access: Expose curated, read-only views to non-technical staff via Claude Desktop, VS Code, Cursor, etc.
- Multi-Database Consolidation: Replace separate MCP servers for each database with a single DBHub process
- Production Troubleshooting: Read-only diagnostics with guardrails against runaway queries
Supported Databases
PostgreSQL, MySQL, SQL Server, MariaDB, Oracle, and SQLite.
MCP Tools
DBHub implements MCP tools for database operations:
- execute_sql: Execute SQL queries with transaction support and safety controls
- search_objects: Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure
- explain_sql (opt-in): Show a query's execution plan without running it
- health_check (opt-in): Report connection pool state and buffer cache hit ratio
- Custom Tools: Define reusable, parameterized SQL operations in your
dbhub.tomlconfiguration file
Workbench
DBHub includes a built-in web interface for interacting with your database tools. It provides a visual way to execute queries, run custom tools, and view request traces without requiring an MCP client.

Installation
npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
Also available as:
- Docker image
- MCP Bundle (one-click install, read-only)
- Claude Code plugin
See the Installation Guide for all options, Command-Line Options for parameters, and Multi-Database Configuration for connecting several databases at once.
Development
Requires Node.js >= 22.5.0 (DBHub uses the built-in node:sqlite module).
# Install dependencies
pnpm install
# Run in development mode
pnpm dev
# Build and run for production
pnpm build && pnpm start --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"
Contributors
Star History
Вопросы о DBHub MCP
Как добавить DBHub MCP в Claude Code?
Выполните claude mcp add --env DB_PASSWORD=<YOUR_DB_PASSWORD> --env DSN=<YOUR_DSN> --env SSH_PASSPHRASE=<YOUR_SSH_PASSPHRASE> --env SSH_PASSWORD=<YOUR_SSH_PASSWORD> dbhub -- npx -y @bytebase/dbhub в терминале. Добавьте --scope user, чтобы сервер был доступен во всех проектах.
Как добавить DBHub MCP в Cursor?
Откройте ~/.cursor/mcp.json и добавьте сервер в mcpServers, используя конфигурацию Cursor из раздела установки выше.
Which databases can DBHub connect to?
DBHub connects to PostgreSQL, MySQL, SQL Server, MariaDB, Oracle, and SQLite through a single interface.
What MCP tools does DBHub provide?
By default it loads two tools, execute_sql and search_objects, with opt-in explain_sql, health_check, and custom tools.
Can DBHub connect to multiple databases at once?
Yes, multi-connection is supported through TOML configuration.
Does DBHub have read-only safety controls?
Yes, it offers read-only mode, row limiting, and query timeouts to prevent runaway operations.
How do I run DBHub?
You can start it with npx using the HTTP transport, and it is also available as a Docker image, MCP Bundle, and Claude Code plugin.