DBHub MCP server
Commit 12 Nov 2026Connects AI clients to PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, and SQLite to explore schemas and execute SQL queries.
Juga dikenal sebagai bytebase/dbhub, @bytebase/dbhub
- Stars
- 3.843
- Tools
- —
- Unduhan, 30 hari
- 176.231
- Versi terbaru
- 1.6.1
- Commit terakhir
- 12 Nov 2026
- Lisensi
- MIT
Apa itu DBHub MCP?
DBHub adalah MCP server. Connects AI clients to PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, and SQLite to explore schemas and execute SQL queries.
Ringkasan dibuat dari README proyek
Tentang 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.
Apa yang bisa Anda lakukan dengannya
- 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.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Cara menginstal DBHub MCP
Format diverifikasi 10 Nov 2026Instal DBHub MCP di 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/dbhubInstal DBHub MCP di 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>"
}
}
}
}Instal DBHub MCP di 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>"
}
}
}
}Instal DBHub MCP di 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>"
}
}
}
}Instal DBHub MCP di 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>"
Instal DBHub MCP di 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>"
}
}
}
}Konfigurasi
DB_PASSWORDRahasiaDatabase password
DSNRahasiaDatabase connection string (e.g., postgres://user:pass@host:5432/db)
SSH_PASSPHRASERahasiaSSH key passphrase
SSH_PASSWORDRahasiaSSH 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
| Nama | Deskripsi | Tipe |
|---|---|---|
| DB_PASSWORD | Database password | Rahasia |
| DSN | Database connection string (e.g., postgres://user:pass@host:5432/db) | Rahasia |
| SSH_PASSPHRASE | SSH key passphrase | Rahasia |
| SSH_PASSWORD | SSH password | Rahasia |
| 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 |
Pengecekan otomatis
Berjalan 12 Nov 2026Laporan lengkap →Belum diverifikasi. Sebuah server memerlukan skor 80, tidak ada temuan serius, dan data yang cukup untuk kami periksa. Cara kerja checks
- Source repository terhubung dan dapat dijangkauLolos
- Lisensi open source (OSI)Lolos
- Ada commit atau release dalam satu tahun terakhirLolos
- Nama package tidak mirip dengan package populer@bytebase/dbhub looks like dchub-mcp-serverTemuan
- Remote endpoint menggunakan HTTPSTidak diperiksa
- Tools yang bersifat destruktif telah diberi labelTidak diperiksa
- Tidak ada instruksi tersembunyi untuk modelLolos
- Tidak ada advisory kritis di paket maupun dependensinyaLolos
README
Lihat di 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
Pertanyaan tentang DBHub MCP
Bagaimana cara menambahkan DBHub MCP ke Claude Code?
Jalankan 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 di terminal Anda. Tambahkan --scope user agar tersedia di semua proyek.
Bagaimana cara menambahkan DBHub MCP ke Cursor?
Buka ~/.cursor/mcp.json dan tambahkan server di bawah mcpServers, menggunakan config Cursor yang ditunjukkan di bagian instalasi di atas.
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.