What it does
DBHub is a lightweight MCP gateway connecting Claude and other MCP clients to multiple databases—PostgreSQL, MySQL, SQL Server, SQLite, and MariaDB—through a single interface. Built for zero dependencies and token efficiency, it exposes two core tools: execute_sql for querying with transaction support, and search_objects for exploring schemas, tables, columns, and indexes. Custom SQL operations can be defined as reusable tools via TOML configuration. The server includes safety guardrails (read-only mode, row limits, query timeouts) and network security (SSH tunneling, SSL/TLS). It also ships with a built-in web workbench for visual query execution and debugging outside an MCP client.
Who it's for
Backend engineers and database administrators who need Claude or other MCP clients to query development, staging, or production databases for analysis, schema exploration, and troubleshooting. Teams managing multiple databases across environments that want a unified gateway rather than database-specific connectors.
Common use cases
- Execute ad-hoc SQL queries on a local PostgreSQL replica from Claude Code to inspect data and schema
- Search and visualize database schemas to understand table relationships before designing migrations
- Connect Claude to production databases in read-only mode to generate reports or debug data anomalies
- Manage connections to multiple databases (dev, staging, prod) from a single DBHub instance
- Define parameterized SQL operations as custom tools in TOML configuration for reusable database tasks
Setup pitfalls
- Two secrets found in the codebase—ensure database credentials and connection strings are stored in environment variables or
.envfiles, never committed to version control - HTTP transport defaults to
0.0.0.0(all network interfaces); for production, bind to127.0.0.1and front with a reverse proxy or firewall, as DBHub does not authenticate HTTP clients - Requires Node.js ≥ 22.5.0 for NPM installation due to the use of
node:sqlite; older versions will fail - Multi-database TOML configuration requires careful DSN syntax and path setup; refer to the installation guide to avoid connection failures