---
title: "DBHub MCP: Postgres, MySQL, SQL Server and SQLite in Two Tools"
url: "https://mcpshelf.co/servers/dbhub"
description: "Bytebase's DBHub connects an assistant to Postgres, MySQL, MariaDB, SQL Server, Oracle or SQLite with two tools and a read-only mode. DSN setup and limits."
updated: "2026-10-27"
site: "MCP Shelf"
---

# DBHub

> One small server for Postgres, MySQL, MariaDB, SQL Server, Oracle and SQLite.

## At a glance

DBHub is Bytebase's deliberately small database server. By default it shows the model just two tools, one to run SQL and one to search the schema, so it costs far less context than servers with dozens of tools. A single process can hold connections to several databases at once through a TOML file, and you can add your own named, parameterised queries as extra tools.

For safety its config file can make a tool read-only, cap the rows returned and time out slow queries, and it can reach databases through an SSH tunnel. It also has a small web workbench for trying queries by hand.

|  |  |
| --- | --- |
| Made by | Bytebase |
| GitHub | https://github.com/bytebase/dbhub |
| Licence | MIT |
| npm package | [@bytebase/dbhub](https://www.npmjs.com/package/@bytebase/dbhub) 1.5.0 (9 Oct 2026) |
| GitHub stars | 3.7K |
| Downloads | 17.1K a week |
| Last commit | 26 Oct 2026 |
| Tools | 2 |
| Runs on | Your computer |
| Install check | Needs your setup first |
| Category | [Databases and data](https://mcpshelf.co/categories/databases) |

**Our check:** It needs something our Linux test machine does not have (an account, a desktop app, a Mac or a running service), so on 27 Oct 2026 we listed its tools from its package instead of running this config.

## Tools

We listed 2 tools on 27 Oct 2026. 1 only read; the rest can change things or run commands.

| Tool | Kind | What it is for |
| --- | --- | --- |
| `execute_sql` | runs | Runs SQL against a connected database, with transactions, row limits and read-only checks applied. |
| `search_objects` | reads | Searches schemas, tables, columns, indexes and procedures, starting with names and going into detail only when asked. |

### How clearly it describes its tools

2 of 2 tools have a description and 2 of 2 say whether they change things. The tool list takes at least ~100 tokens of context. Every tool says whether it only reads or can change things, so a client can ask before the risky ones.

## Set it up

### Claude Desktop

Where: claude_desktop_config.json (Settings → Developer → Edit Config)

```json
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub@latest",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/dbname"
      ]
    }
  }
}
```

### Claude Code

Where: Your terminal, in the project folder

```bash
claude mcp add-json dbhub '{"command":"npx","args":["-y","@bytebase/dbhub@latest","--transport","stdio","--dsn","postgres://user:password@localhost:5432/dbname"]}'
```

### Cursor

Where: ~/.cursor/mcp.json, or .cursor/mcp.json in a project

```json
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub@latest",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/dbname"
      ]
    }
  }
}
```

### VS Code

Where: .vscode/mcp.json in your project

```json
{
  "servers": {
    "dbhub": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub@latest",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/dbname"
      ]
    }
  }
}
```

### Windsurf

Where: ~/.codeium/windsurf/mcp_config.json

```json
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub@latest",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/dbname"
      ]
    }
  }
}
```

### ChatGPT

Where: Not supported

ChatGPT only connects to remote servers by URL. This one runs on your computer, so use Claude, Cursor or VS Code.

Use "--demo" in place of --dsn to try it on a bundled sample database. Read-only mode, row limits and several databases are set in a dbhub.toml file passed with --config instead of --dsn.

## Settings

| Setting | Kind | Required | What it does |
| --- | --- | --- | --- |
| `--dsn` | flag | yes | The connection string, such as postgres://, mysql://, sqlserver://, oracle:// or sqlite:///path. Also read from DSN in env or a .env file. Example: `postgres://user:password@localhost:5432/dbname?sslmode=disable` |
| `readonly` | config | no | A per-tool option in dbhub.toml that only lets read statements through (SELECT, SHOW, DESCRIBE, EXPLAIN). It cannot be set on the command line. Example: `[[tools]] name = "execute_sql" source = "main" readonly = true` |
| `max_rows` | config | no | A per-tool option in dbhub.toml that caps how many rows a query returns. Example: `max_rows = 1000` |
| `query_timeout` | config | no | A per-source limit in dbhub.toml, in seconds, after which a query is stopped. Example: `query_timeout = 30` |
| `--config` | flag | no | A dbhub.toml file for several databases, per-source limits, SSH tunnels, the optional tools and your own named SQL tools. Example: `--config ./dbhub.toml` |
| `--demo` | flag | no | Starts with a bundled sample SQLite database instead of your own. |
| `--transport` | flag | no | stdio for clients that start it, or http with --port to serve it, together with the web workbench. Example: `--transport http --port 8080` |

## What it can touch

**It can read**

- Any table, view or object the database user can see

**It can change**

- Rows and schema, through execute_sql, unless readonly is set in dbhub.toml

**Safer setup:** Connect as a database user with read rights only, and set readonly and max_rows in dbhub.toml. The database's own permissions are the real boundary.

## Before you start

- Node.js 22.5 or newer
- A connection string (DSN) for your database

## Good for

- Schema questions and query writing in a coding agent
- One server for a project that uses more than one kind of database
- Read-only access for people who should look but not change

## If it does not work

**It exits as soon as the client starts it**
It could not reach the database in the DSN. Check the host, port and password, and add ?sslmode=disable for a local Postgres without TLS.

**A special character in the password breaks the DSN**
URL-encode it, for example @ as %40.

**It will not start on an older Node**
DBHub needs Node.js 22.5 or newer for its built-in SQLite support.

**explain_sql or health_check is missing**
They are off by default. Switch them on in dbhub.toml.

## Similar servers

| Server | Tools | Runs on | Stars |
| --- | --- | --- | --- |
| [Postgres MCP Pro](https://mcpshelf.co/servers/postgres-mcp-pro) | 9 | Your computer | 3.4K |
| [Supabase](https://mcpshelf.co/servers/supabase) | 29 | Hosted | 3K |
| [MCP Toolbox for Databases](https://mcpshelf.co/servers/mcp-toolbox-for-databases) | 29 | Your computer | 16.7K |
| [Qdrant](https://mcpshelf.co/servers/qdrant) | 2 | Your computer | 1.6K |

## Questions

### Which databases does it support?

PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite.

### Why only two tools?

To keep context small: Bytebase measures about 1,400 tokens for the default set. You add more when you need them.

### Can one server reach several databases?

Yes, through dbhub.toml. Each tool then takes the source you want.

### Is it free?

Yes, MIT licensed. Bytebase sells a separate product with approval flows and audit logs for larger teams.

Full docs on GitHub: https://github.com/bytebase/dbhub

---

From [MCP Shelf](https://mcpshelf.co/): A short shelf of MCP servers that are worth installing. Index for agents: https://mcpshelf.co/llms.txt

