DBHub
A token-lean MCP server for PostgreSQL, MySQL, MariaDB, SQL Server and SQLite with a read-only mode
Install
claude mcp add --transport stdio dbhub -- npx @bytebase/dbhub@latest --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"This is third-party code. Review the repository files before installing.
What it does
DBHub connects the agent to databases through one server. By default it exposes just two tools, SQL execution and schema object search, so it takes little context. Query plans and pool health checks are opt-in, and dbhub.toml can define custom parameterized SQL tools and multiple connections. It offers read-only mode, row limits, query timeouts, SSH tunneling and TLS, plus a built-in web workbench for manual queries.
Who it is for. For developers and analysts who want the agent to explore schemas and query databases.
Good fit when
- You need to understand the schema of an unfamiliar database
- You need to check a query or find data while debugging
- You need to give colleagues safe read-only database access through an agent
Not a fit when
- Your database is not supported, for example ClickHouse
- The agent must not reach the production database even read-only
Example request
Find the order-related tables and show how many orders came in last weekLimitations
Only PostgreSQL, MySQL, MariaDB, SQL Server and SQLite are supported. Development needs Node 22.5 or newer. The connection string with its password lands in config, so pass it via an environment variable. Without read-only mode the agent can modify data.
How to disable. Run claude mcp remove dbhub or delete the dbhub block from .mcp.json.
MCP
- Transport
- stdio, http
- Authentication
- not required
Security check
- Runs SQL against the connected database, including writes unless read-only
- Handles a connection string containing a password
README in short
The README explains the minimal-toolset approach and compares token use with other servers. It lists use cases, supported databases, tools, the workbench and guardrails. Install is one npx command, with other options in the docs: Docker, MCP Bundle and a Claude Code plugin. MIT licensed.
FAQ
Can I connect several databases?
Yes, connections are defined in the TOML config.
How do I keep the password out of .mcp.json?
Pass the connection string via an environment variable such as ${DATABASE_URL}.
Related
166 skills for scientific work: bioinformatics, cheminformatics, clinical data, geospatial analysis and 100+ databases
Google's open-source MCP server for databases: ready tools for Postgres, MySQL, BigQuery, Spanner and more, plus custom tools in tools.yaml
Official Hugging Face skills: Hub operations via the hf CLI, datasets, model training, Spaces, evals and deployment
An MCP server and skills from TigerData that help agents write PostgreSQL schemas and queries from current docs and practices