What it does
DBHub is a lightweight MCP server that connects MCP-compatible clients (Claude Desktop, Claude Code, Cursor, VS Code, Copilot CLI) to PostgreSQL, MySQL, SQL Server, SQLite, and MariaDB databases. It exposes two core tools—execute_sql and search_objects—optimized for token efficiency, plus custom SQL operations defined via TOML configuration. The server enforces safety guardrails including read-only mode, row limits, and query timeouts to prevent runaway operations. It supports SSH tunneling and TLS encryption for secure remote access and includes a web workbench interface for manual query execution and debugging.
Who it's for
Backend engineers who want Claude to query and explore database schemas during development and debugging. Database administrators managing multiple environments (dev, staging, prod) through a single query gateway. Development teams integrating AI-assisted SQL generation into their workflows while maintaining safety constraints.
Common use cases
- Query a PostgreSQL database from Claude Code while designing or validating schema migrations
- Explore database schemas from Claude to generate accurate, context-aware SQL without manual introspection
- Define custom parameterized SQL operations in TOML and invoke them as reusable tools without writing raw SQL
- Connect to multiple databases simultaneously (dev, staging, production) and run read-only diagnostic queries
- Debug production issues by letting Claude inspect schemas and suggest fixes based on live data
Setup pitfalls
- Requires Node.js ≥ 22.5.0 for NPM installation; Docker is recommended if your environment is older
- The HTTP transport defaults to
--host 0.0.0.0, exposing the server on all interfaces; production deployments must bind to127.0.0.1and front with a reverse proxy, as DBHub does not authenticate HTTP clients - Database credentials in
.envor TOML config must be excluded from version control—two secrets were found in the codebase during scanning - CI is not passing; verify the latest release is stable in your environment before deploying to production