
DBHub
io.github.bytebasePublished by GitHub account bytebasev1.6.0Updated Nov 7, 2026
Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite
Overview
Lightweight MCP server that lets an assistant run SQL and explore schemas across PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite.
- What you can do
- Run SQL queries with transaction support and safety controls
- Search and explore schemas, tables, columns, indexes and procedures
- Show a query's execution plan without running it (opt-in)
- Report connection pool state and cache hit ratio (opt-in)
- Run reusable parameterized SQL operations defined in a TOML config
- Use a built-in web workbench to run queries and view request traces
- When to use it
- Useful when an assistant should inspect or query one or more relational databases during development, validate SQL, debug data, or offer curated read-only access to non-technical users. A single process can replace separate servers for each database.
- Requirements
- Runs locally as an npm package (Node.js 22.5.0 or newer) or via Docker. Needs connection details for the target database, given as a DSN or as DB_TYPE, DB_HOST, DB_PORT, DB_NAME, DB_USER and DB_PASSWORD. Optional SSH tunneling uses SSH_HOST, SSH_USER, SSH_PORT and a key, password or agent socket. Default transport is stdio; an HTTP mode uses PORT.
Installation
In SourceWeft
- Open DBHub in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
[!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.
[GitHub Trending Repository of the Day]
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.
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
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).
Contributors
[Image]Star History
[Star History Chart]Source: README.md at commit 8c09c86
Tools
0Version history
7- v1.6.0LatestNov 7, 2026
- v1.5.1Nov 3, 2026
- v1.5.0Oct 9, 2026
- v1.4.0Sep 29, 2026
- v1.3.1Sep 21, 2026
- v1.3.0Sep 19, 2026
- v1.2.3Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts