DBHub is a minimal MCP server designed to provide database access to MCP-compatible clients in a token-efficient manner. It is zero-dependency, includes only two MCP tools by default, and can optionally enable additional tools through configuration, thereby maximizing the utilization efficiency of the context window.
Key capabilities:
- Multi-database support: Connect to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse, and SQLite through a single interface.
- Multiple connections: Connect to multiple databases simultaneously using a TOML configuration file.
- Safeguards: Provide read-only mode, row limits, and query timeouts to prevent runaway operations.
- Secure access: Support SSH tunneling and SSL/TLS encryption.
- Built-in tools: execute_sql (execute SQL queries, with transaction and safety controls), search_objects (search and explore database schemas, tables, columns, indexes, and stored procedures, with progressive disclosure support); optional tools include explain_sql (show the query execution plan without running the query) and health_check (report connection pool status and buffer cache hit ratio).
- Custom tools: Define reusable, parameterized SQL operations in the dbhub.toml configuration file.
- Built-in web interface: Provide a visual way to execute queries, run custom tools, and view request traces without an MCP client.
Usage: DBHub requires Node.js >= 22.5.0 (using the built-in node:sqlite module). It can be installed with one click via MCP Bundle (read-only), or refer to the installation guide for other installation methods. For Claude Code and Codex, plugins can be installed (Codex reads the connection string from DBHUB_DSN). The connection string is passed via the --dsn parameter, and existing postgresql:// URLs can be used directly. If read-only mode is needed, point --config to a TOML file with readonly = true set.
Applicable scenarios:
- Local development: Work with tools such as Claude Code, VS Code, and Cursor for schema exploration, query validation, and data debugging.
- Non-technical access: Expose to non-technical users through Claude Desktop, VS Code, Cursor, etc.A carefully curated read-only view.
- Multi-database consolidation: Replace separate MCP servers for each database with a single DBHub process.
- Production troubleshooting: Use read-only diagnostics and safeguards to prevent runaway queries.
Limitations: Read-only mode is a safeguard rather than a permission boundary; you should always connect using a least-privilege read-only database user. DBHub is the maintained replacement for @modelcontextprotocol/server-postgres, which has been archived and is no longer maintained.