What is DBHub?
DBHub is an open-source Model Context Protocol (MCP) server from Bytebase that sits between an MCP client — Claude Desktop, Claude Code, Cursor, VS Code, Copilot CLI and others — and your databases. It sits in the Workflow Automation category of the Agents & Automation tools and is open-source, written in TypeScript and licensed MIT.
Overview
DBHub is an open-source Model Context Protocol (MCP) server from Bytebase that sits between an MCP client — Claude Desktop, Claude Code, Cursor, VS Code, Copilot CLI and others — and your databases. One DBHub process speaks to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite, so an agent can browse schemas and run SQL through a single interface instead of a separate server per database. It is the example the Claude Code documentation uses for connecting to PostgreSQL over MCP.
The design goal is a small tool surface. By default DBHub loads only two tools — `execute_sql` and `search_objects`, which explores schemas, tables, columns, indexes and procedures with progressive disclosure — at about 1.4k tokens, which the project compares with 19k+ for some alternatives. `explain_sql` (a query plan without running the query) and `health_check` are opt-in, and you can define your own parameterized SQL tools in a `dbhub.toml` file. Guardrails include read-only mode, row limits and query timeouts, and connections can go through SSH tunnels and SSL/TLS.
Run with HTTP transport, DBHub also serves a built-in web Workbench: you can execute queries, run custom tools through a form, and read a trace of recent requests in the browser without any MCP client. It ships on npm as `@bytebase/dbhub` (Node.js 22.5.0 or later), as the `bytebase/dbhub` Docker image, as a read-only one-click MCP Bundle and as a Claude Code plugin. The project is written in TypeScript and MIT licensed; Bytebase points teams that need approval flows, access control, data masking and audit logging to its separate Bytebase product.

What it does
- One MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite
- Two default tools (`execute_sql`, `search_objects`) at about 1.4k tokens, plus opt-in `explain_sql` and `health_check`
- Custom tools: reusable, parameterized SQL statements defined in `dbhub.toml` and exposed as MCP tools
- Multiple databases at once through `[[sources]]` in a TOML config, with per-tool `readonly` and `max_rows` and hot reload on file changes
- Guardrails against runaway queries: read-only mode, row limits and server-side query timeouts
- SSH tunnelling and SSL/TLS for secure connections, and a built-in web Workbench with request traces
Getting started
Try the built-in demo database first, then point DBHub at your own database, register it with your MCP client, and move to a `dbhub.toml` file for multiple databases and guardrails. The npm package needs Node.js 22.5.0 or later; the Docker image bundles its own runtime.
Try demo mode and open the Workbench
Demo mode starts DBHub with a sample database. With HTTP transport, open http://localhost:8080 in your browser to use the Workbench.
npx @bytebase/dbhub@latest --transport http --port 8080 --demoConnect your own database
Pass a connection string with `--dsn`, via npx or the Docker image. From inside Docker, reach a database on your host with `host.docker.internal` instead of `localhost`.
npx @bytebase/dbhub@latest \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
# or with Docker
docker run --rm --init \
--name dbhub \
--publish 8080:8080 \
bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"Register it with your MCP client
In Claude Code, add DBHub over stdio for a local database, or point at a running HTTP server. Everything after `--` is the DBHub command. Codex works the same way with `codex mcp add`.
# stdio (local)
claude mcp add --transport stdio dbhub -- npx @bytebase/dbhub@latest --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"
# HTTP (a DBHub server already running on port 8080)
claude mcp add --transport http dbhub http://localhost:8080/mcpConfigure several databases with dbhub.toml
Define each database as a `[[sources]]` entry and set guardrails per tool, then start DBHub with `--config` (a `./dbhub.toml` in the working directory is loaded automatically). `--config` and `--dsn` cannot be combined.
[[sources]]
id = "production"
dsn = "postgres://user:pass@localhost:5432/mydb"
connection_timeout = 60
[[sources]]
id = "staging"
dsn = "mysql://root:pass@localhost:3306/myapp"
[[tools]]
name = "execute_sql"
source = "production"
readonly = true
max_rows = 1000
[[tools]]
name = "execute_sql"
source = "staging"
readonly = falseAdd a custom tool
A custom tool is a fixed SQL statement with typed parameters. Agents call it like any other MCP tool, and the Workbench renders it as a form with a read-only preview of the generated SQL.
[[tools]]
name = "delete_employee_salaries"
description = "Delete salary records for a specific employee"
source = "local_pg"
readonly = false # Explicitly allow DELETE operations
statement = "DELETE FROM salary WHERE emp_no = $1"
[[tools.parameters]]
name = "emp_no"
type = "integer"
description = "Employee number"
required = true
Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Exploring schemas, validating queries and debugging data from Claude Code, Cursor or VS Code during local development
- Giving non-technical colleagues curated, read-only database access through Claude Desktop or another MCP client
- Replacing a separate MCP server per database with a single DBHub process
- Read-only production troubleshooting, with row limits and query timeouts guarding against runaway queries

How DBHub compares
DBHub alongside other open-source workflow automation tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| n8n | ★ 213k | A self-hostable workflow automation tool with a visual node editor that connects 400+ apps and APIs and adds native AI steps, letting technical teams build automations without writing most of the glue code. |
| Huginn | ★ 50.7k | A self-hosted system of "agents" that watch websites, feeds, and events and take automated actions on your behalf, similar to a private IFTTT. |
| GitHub MCP Server | ★ 34.9k | GitHub's official MCP server, hosted or self-run, that gives an agent scoped toolsets for repositories, issues, pull requests, Actions runs and code-security alerts. |
| gws (Google Workspace CLI) | ★ 32.6k | A command-line tool for every Google Workspace API, built at runtime from Google’s Discovery Service, returning structured JSON and shipping 40+ agent skills. Not an officially supported Google product. |
| Kestra | ★ 30.4k | An event-driven orchestration platform that defines data, AI, and infrastructure pipelines as declarative YAML and runs them through a web UI. |
| Activepieces | ★ 25.8k | An open-source Zapier alternative where you build automations from reusable TypeScript "pieces", with support for AI agents and self-hosting. |
| n8n-MCP | ★ 23.3k | An MCP server that gives coding assistants structured access to n8n's node catalogue, schemas, docs and workflow templates so they can build and validate n8n workflows. |
| DBHub | ★ 4k | A token-efficient MCP server that lets AI agents explore and query your SQL databases |
