
DBHub
- 3.2k repo stars
- Updated July 27, 2026
- bytebase/dbhub
DBHub is a MCP server that gives agents token-efficient access to PostgreSQL, MySQL, SQL Server, SQLite, and MariaDB.
About
DBHub is Bytebase’s minimal Model Context Protocol server for developers who need their agent to work against real databases without bloating every turn with huge schema dumps. You point it at a connection string or classic host credentials for Postgres, MySQL, MariaDB, SQL Server, or SQLite, then register the stdio npm package in Claude Code, Cursor, or similar hosts. It fits SaaS and API projects when you are debugging queries, validating migrations, or exploring production-like data during backend and integration work. The emphasis on token efficiency matters when you pay per request or hit context limits mid-session. It is a focused datastore bridge, not a full admin UI or migration runner, so pair it with your ORM and migration workflow. Treat DSN and passwords as secrets and scope access to dev or read-only roles when possible.
- Token-efficient MCP design aimed at smaller model context use per query
- Supports five engines: PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite
- Configure via DSN or discrete DB_TYPE, host, port, user, password, and DB_NAME variables
- stdio npm package @bytebase/dbhub at version 0.22.2
- Published server schema 2025-12-11 for Model Context Protocol clients
DBHub by the numbers
- Data as of Jul 28, 2026 (Skillselion catalog sync)
claude mcp add --env DSN=YOUR_DSN --env DB_TYPE=YOUR_DB_TYPE --env DB_HOST=YOUR_DB_HOST --env DB_PORT=YOUR_DB_PORT --env DB_USER=YOUR_DB_USER --env DB_PASSWORD=YOUR_DB_PASSWORD --env DB_NAME=YOUR_DB_NAME --env TRANSPORT=YOUR_TRANSPORT --env PORT=YOUR_PORT --env ID=YOUR_ID --env SSH_HOST=YOUR_SSH_HOST --env SSH_PORT=YOUR_SSH_PORT --env SSH_USER=YOUR_SSH_USER --env SSH_PASSWORD=YOUR_SSH_PASSWORD --env SSH_KEY=YOUR_SSH_KEY --env SSH_PASSPHRASE=YOUR_SSH_PASSPHRASE dbhub -- npx -y @bytebase/dbhubAdd your badge
Show developers this MCP server is listed on Skillselion. Paste this into your README.
| repo stars | ★ 3.2k |
|---|---|
| Package | @bytebase/dbhub |
| Transport | STDIO |
| Auth | Required |
| Last updated | July 27, 2026 |
| Repository | bytebase/dbhub ↗ |
What it does
Let your coding agent query and inspect PostgreSQL, MySQL, SQL Server, SQLite, and MariaDB with minimal token-heavy context.
Who is it for?
Best when you're wiring backends and want one MCP server covering multiple SQL engines during integration and debugging sessions.
Skip if: Skip if you need governed change management, visual schema design, or production write access without strict connection scoping.
What you get
After you register DBHub with a DSN or host credentials, the agent can run database-aware tasks through MCP with a smaller, purpose-built tool surface.
- Live MCP connection from the agent to one configured SQL database
- Cross-engine support path for Postgres, MySQL, MariaDB, SQL Server, and SQLite
- Reduced reliance on pasting full schemas into chat for routine data tasks
By the numbers
- Server version 0.22.2
- npm package @bytebase/dbhub
- 5 supported DB types: postgres, mysql, mariadb, sqlserver, sqlite
README.md
[!NOTE]
Brought to you by Bytebase, open-source database DevSecOps platform.
+------------------+ +--------------+ +------------------+
| | | | | |
| | | | | |
| Claude Desktop +--->+ +--->+ PostgreSQL |
| | | | | |
| Claude Code +--->+ +--->+ SQL Server |
| | | | | |
| Cursor +--->+ DBHub +--->+ SQLite |
| | | | | |
| VS Code +--->+ +--->+ MySQL |
| | | | | |
| Copilot CLI +--->+ +--->+ MariaDB |
| | | | | |
| | | | | |
+------------------+ +--------------+ +------------------+
MCP Clients MCP Server Databases
DBHub is a zero-dependency, token efficient MCP server implementing the Model Context Protocol (MCP) server interface. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases:
- Local Development First: Zero dependency, token efficient with just two MCP tools to maximize context window
- Multi-Database: PostgreSQL, MySQL, MariaDB, SQL Server, 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
Supported Databases
PostgreSQL, MySQL, SQL Server, MariaDB, 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
- 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
See the full Installation Guide for detailed instructions.
Quick Start
Docker:
docker run --rm --init \
--name dbhub \
--publish 8080:8080 \
bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
NPM: (requires Node.js >= 22.5.0)
npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
Demo Mode:
npx @bytebase/dbhub@latest --transport http --port 8080 --demo
Restrict to loopback (recommended for production):
npx @bytebase/dbhub@latest --transport http --host 127.0.0.1 --port 8080 --demo
The HTTP transport defaults to
--host 0.0.0.0, exposing DBHub on every network interface. For production, bind to127.0.0.1and front DBHub with a reverse proxy (nginx/Caddy) or firewall — DBHub does not authenticate HTTP clients.The HTTP transport also has built-in DNS-rebinding protection: it only accepts requests whose
Hostis loopback, this machine's own hostname/IPs, or a name you allow via--allowed-hosts. If a client behind a reverse proxy or custom DNS name gets a403, add that hostname with--allowed-hosts.
See Command-Line Options for all available parameters.
Multi-Database Setup
Connect to multiple databases simultaneously using TOML configuration files. Perfect for managing production, staging, and development databases from a single DBHub instance.
See Multi-Database Configuration for complete setup instructions.
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
Recommended MCP Servers
How it compares
MCP database bridge, not a hosted database console or migration skill.
FAQ
Who is io.github.bytebase/dbhub for?
Developers using Claude Code, Cursor, or Codex who need MCP-backed SQL access across common relational engines while building APIs and SaaS backends.
When should I use io.github.bytebase/dbhub?
Use it during Build when you are integrating data layers, verifying queries, or exploring schemas instead of copying DDL into the chat.
How do I add io.github.bytebase/dbhub to my agent?
Install @bytebase/dbhub via npm, set DSN or DB_TYPE plus host credentials in your MCP config, and connect the server over stdio in your agent’s MCP settings.