DBHub MCP
A token-lean MCP server for PostgreSQL, MySQL, MariaDB, SQL Server and SQLite with a read-only mode
- 3,752 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- Runs SQL against the connected database, including writes unless read-only
- Handles a connection string containing a password
Install
- Works in
Manual install
claude mcp add --transport stdio dbhub -- npx @bytebase/dbhub@latest --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Runs SQL against the connected database, including writes unless read-only
- Handles a connection string containing a password
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 weekMCP
- Transport
- stdio, http
- Authentication
- not required
Limitations
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.
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}.
Discussion
No questions or reviews yet.
Related
MCP serversA lightweight database workspace with an MCP server: the agent reads the schema, runs queries and explores data in PostgreSQL, MySQL and more
MCP server that gives an agent access to MySQL: schema inspection and queries, read-only by default, writes behind flags
A Python MCP server for MySQL: listing tables, reading data, running SQL and inspecting schema through a controlled interface
A desktop SQL workspace with a built-in MCP server: the agent reads the schema and runs queries in the same client you already use
DB MCP Server
db-mcp-server
An MCP server for several databases with protection: a read-only mode per database and a row limit. Written in Go, launched in Docker
Official ClickHouse MCP server: the agent lists databases and tables and runs SQL, read-only by default
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| DBHub (this entry) | no | not required | 3,752 | |
| Anyquery | no | key is optional | 1,787 | a SQLite-based SQL engine with plugins for apps |
| CentralMind Gateway | no | key is optional | 549 | a Go MCP server and REST API for databases |
| PG-MCP Server | no | not required | 540 | an MCP server for PostgreSQL with several databases at once |
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.