DBHub MCP sunucusu
Commit 12 Kas 2026Connects AI clients to PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, and SQLite to explore schemas and execute SQL queries.
Ayrıca bilinen adı bytebase/dbhub, @bytebase/dbhub
- Yıldızlar
- 3.843
- Araçlar
- —
- İndirmeler, 30 gün
- 176.231
- En son sürüm
- 1.6.1
- Son commit
- 12 Kas 2026
- Lisans
- MIT
DBHub MCP nedir?
DBHub bir MCP sunucusudur. Connects AI clients to PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, and SQLite to explore schemas and execute SQL queries.
Özet, projenin README dosyasından oluşturuldu
DBHub MCP sunucusu hakkında
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.
Neler yapabilirsiniz
- 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.
Projenin README dosyasından alınmıştır. Her kullanım durumu, oradaki bir alıntı ile kontrol edilir.
DBHub MCP nasıl yüklenir
Biçimler 10 Kas 2026 tarihinde doğrulandıDBHub MCP'yi Claude Code içine yükleyin
$ 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/dbhubDBHub MCP'yi Cursor içine yükleyin
~/.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'yi VS Code içine yükleyin
.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'yi Claude Desktop içine yükleyin
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'yi Codex içine yükleyin
~/.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'yi Gemini CLI içine yükleyin
~/.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>"
}
}
}
}Yapılandırma
DB_PASSWORDGizliDatabase password
DSNGizliDatabase connection string (e.g., postgres://user:pass@host:5432/db)
SSH_PASSPHRASEGizliSSH key passphrase
SSH_PASSWORDGizliSSH 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
| Ad | Açıklama | Sunucu |
|---|---|---|
| DB_PASSWORD | Database password | Gizli |
| DSN | Database connection string (e.g., postgres://user:pass@host:5432/db) | Gizli |
| SSH_PASSPHRASE | SSH key passphrase | Gizli |
| SSH_PASSWORD | SSH password | Gizli |
| 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 |
Otomatik kontroller
Çalıştırıldı 12 Kas 2026Tam rapor →Henüz doğrulanmadı. Bir sunucunun 80 puana, ciddi bir bulgu olmamasına ve kontrol edebilmemiz için yeterli veriye ihtiyacı vardır. Kontroller nasıl çalışır
- Kaynak deposu bağlantılı ve erişilebilirGeçti
- Açık kaynak lisansı (OSI)Geçti
- Son bir yıl içinde commit veya sürüm mevcutGeçti
- Paket adı popüler bir pakete yakın değil@bytebase/dbhub looks like dchub-mcp-serverBulgu
- Uzak uç nokta HTTPS kullanıyorKontrol edilmedi
- Yıkıcı araçlar etiketlenmişKontrol edilmedi
- Modele yönelik gizli talimat yokGeçti
- Pakette ve bağımlılıklarında kritik uyarı yokGeçti
[!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 soruları
DBHub MCP'yi Claude Code'a nasıl eklerim?
Terminalinizde 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 komutunu çalıştırın. Her projede kullanılabilir olması için --scope user ekleyin.
DBHub MCP'yi Cursor'a nasıl eklerim?
~/.cursor/mcp.json dosyasını açın ve yukarıdaki yükleme bölümünde gösterilen Cursor yapılandırmasını kullanarak sunucuyu mcpServers altına ekleyin.
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.