# dbhub [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/bytebase/dbhub  
**GitHub Stars:** 3963  
**npm Downloads (last month):** 424815  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/dbhub

## Description
Minimal Database MCP Server for PostgreSQL, MySQL, SQL Server, SQLite, MariaDB

## Tools
Capabilities this server exposes over MCP:

- **dbhub.toml**

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "dbhub": {
    "command": "npx",
    "args": ["-y","@bytebase/dbhub@latest"]
  }
}
```

## Documentation

## What dbhub does

dbhub provides an MCP gateway between compatible clients and relational databases. It supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, and SQLite through a common interface, allowing an agent to inspect schemas and run SQL without a separate MCP process for each database.

The default configuration exposes two tools: `execute_sql` for running queries and `search_objects` for finding database objects such as schemas, tables, columns, indexes, and procedures. The server is designed to keep its default tool surface small; the two default tools use about 1.4k tokens. Additional capabilities can be enabled when needed.

A built-in web Workbench provides another way to use the database tools. It can execute queries, run custom tools, and display request traces without an MCP client.

## How it works

Clients connect to dbhub over MCP, and dbhub forwards database operations to the configured data sources. It can operate over stdio or HTTP. A TOML configuration file can describe multiple connections, making one dbhub process suitable for environments that use several databases.

Database access can be constrained with read-only mode, row limits, and query timeouts. SSH tunneling and SSL/TLS encryption are available for connections that require protected transport. `execute_sql` also supports transactions and safety controls.

Optional tools include `explain_sql`, which returns a query execution plan without executing the query, and `health_check`, which reports connection-pool state and buffer-cache hit ratio. Custom tools let operators define reusable, parameterized SQL operations in `dbhub.toml`.

## Setup and configuration

The package can be started with `npx`, for example:

```bash
npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
```

Docker, an MCP Bundle with read-only setup, and a Claude Code plugin are also available. Command-line options control runtime settings, while TOML configuration is the option for multiple database connections and custom tools.

For local development, dbhub requires Node.js 22.5.0 or newer because it uses Node's built-in `node:sqlite` module. The source project uses pnpm for dependency installation and provides development and production build commands.

## Tools and capabilities

- `execute_sql`: runs SQL with transaction support and safety controls.
- `search_objects`: progressively explores schemas, tables, columns, indexes, and procedures.
- `explain_sql`: optionally returns an execution plan without running the query.
- `health_check`: optionally reports connection-pool and buffer-cache metrics.
- Custom tools: exposes parameterized SQL operations declared in `dbhub.toml`.
- Workbench: executes queries, runs custom tools, and shows request traces through a web interface.

## Limitations and notes

dbhub focuses on a minimal database tool surface and does not provide the enterprise guardrails associated with Bytebase, such as approval flows, access control, data masking, or audit logging. Optional tools and custom operations must be enabled or configured when the default pair is insufficient. Read-only mode and other safety settings should be selected according to the risks of the target database.

_Full upstream README: https://allmcps.com/mcp/dbhub/readme_

