---
title: "DBHub MCP server: Postgres, MySQL, SQL Server and SQLite for AI agents"
canonical_url: https://cookiesforai.app/mcp/dbhub
last_updated: 2026-10-03T10:04:47+02:00
type: mcp
summary: "DBHub is an open-source MCP server by Bytebase that gives AI agents SQL access to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite through one server with two default tools."
install: "/plugin marketplace add bytebase/dbhub"
related:
  - "https://cookiesforai.app/mcp/mongodb"
  - "https://cookiesforai.app/mcp/neon"
  - "https://cookiesforai.app/mcp/postgres-mcp-pro"
  - "https://cookiesforai.app/mcp/redis"
---

# DBHub MCP server

DBHub is an open-source MCP server by Bytebase that gives AI agents SQL access to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite through one server with two default tools.

| Fact | Value |
|---|---|
| Publisher | Bytebase |
| Source | https://github.com/bytebase/dbhub |
| License | MIT |
| GitHub stars | 3,593 on 2026-10-02 |
| Last code push | 2026-10-01 |
| Page updated | 2026-10-03 |
| Official MCP Registry | io.github.bytebase/dbhub |
| Documented clients | Claude Code, Claude Desktop, Cursor, VS Code, GitHub Copilot CLI, Codex, Dify, LibreChat |
| Category | Databases |
| Free tier | Free |
| Cost | Free and open source under MIT and run on your own machine, with no paid tier; Bytebase's enterprise product is separate. |
| Current prices | https://github.com/bytebase/dbhub |
| Facts checked | 2026-10-02 |

## Connect

Claude Code, as a plugin (prompts for the connection string and stores it securely):

```
/plugin marketplace add bytebase/dbhub
```

Then install the plugin:

```
/plugin install dbhub@dbhub
```

Codex, trying the built-in demo database first:

```
codex mcp add dbhub -- npx @bytebase/dbhub@latest --transport stdio --demo
```

Run as an HTTP server for any client (add your own --dsn instead of --demo):

```
npx @bytebase/dbhub@latest --transport http --port 8080 --demo
```

Pass your database with --dsn, for example a postgres:// URI with user and password, or keep several connections in a dbhub.toml file and use --config. From Docker, use host.docker.internal instead of localhost to reach a database on your machine.

## Ask your coding agent

```text
Connect the DBHub MCP server to my coding agent using its documented setup: https://github.com/bytebase/dbhub.
```

## What it does

DBHub is a database MCP server from Bytebase, the company behind a database DevOps platform. One DBHub process connects an AI agent to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle or SQLite, and a TOML file lets it hold several connections at once, for example a local dev database and a read-only replica. It supports SSH tunnels and SSL for databases behind a bastion host.

DBHub keeps its default tool list to two: execute_sql runs queries with transaction support, and search_objects explores schemas, tables, columns, indexes and procedures a step at a time. Bytebase measures this at about 1,400 tokens of context, against roughly 19,000 for some alternatives. Two opt-in tools show a query plan and report connection pool health, and you can define your own parameterized SQL tools in the config file. A built-in web workbench runs the same tools without an MCP client.

Guardrails include a read-only mode, a row limit and a query timeout. DBHub runs through npx (Node.js 22.5 or newer), Docker, an MCP Bundle file or a Claude Code plugin; the bundle and plugin are read-only by design. Claude Code's own docs use DBHub as the example for querying PostgreSQL. The repo had 3,589 GitHub stars on 2026-10-01.

Tools it gives your agent: `execute_sql`, `search_objects`, `explain_sql`, `health_check`

## When to use it

- You work with more than one database engine and want a single MCP server for all of them.
- You want the agent to explore an unfamiliar schema without filling its context with tool definitions.
- You want to give non-technical teammates read-only views of data through Claude Desktop or VS Code.
- You need to reach a database behind an SSH bastion host.

## When to pick something else

- Deep Postgres tuning such as index recommendations and health reports; Postgres MCP Pro specializes in that.
- Write access on production without care: unless read-only mode is on, execute_sql can change data.

## What it needs

- Node.js 22.5 or newer, or Docker
- A database connection string (DSN)

## Questions people ask

### Is DBHub free?

Yes. DBHub is open source under MIT and runs on your own machine with no paid tier.

### Which databases does DBHub support?

PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite (README read 2026-10-01). SQLite needs no extra driver because DBHub uses Node's built-in module.

## Related

### Other MCP servers for databases

- [MongoDB](https://cookiesforai.app/mcp/mongodb): The MongoDB MCP server gives AI agents access to MongoDB databases and MongoDB Atlas: run find and aggregate queries, inspect schemas and indexes, and create or manage Atlas clusters and users.
- [Neon](https://cookiesforai.app/mcp/neon): The Neon MCP server gives AI agents control of Neon serverless Postgres: create projects and branches, run SQL, inspect schemas, find slow queries and run migrations on a branch before applying them.
- [Postgres MCP Pro](https://cookiesforai.app/mcp/postgres-mcp-pro): Postgres MCP Pro is an open-source MCP server that gives AI agents access to a PostgreSQL database, with schema browsing, safe SQL execution, EXPLAIN plans, index recommendations and database health checks.
- [Redis](https://cookiesforai.app/mcp/redis): The Redis MCP server gives AI agents natural-language access to a Redis database: strings, hashes, lists, sets, sorted sets, streams, JSON documents, pub/sub and vector search indexes.

