# DBHub (MCP server)

> DBHub is an MCP server that adds database tools to AI assistants such as Claude Desktop, Claude Code and Cursor. Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite. It has 3,610 GitHub stars, is released under the MIT license and runs locally with npx -y @bytebase/dbhub.

DBHub is a minimal MCP server: token-efficient, zero-dependency, and just two tools by default with opt-in extras. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases:

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/bytebase/dbhub |
| GitHub stars | 3,610 |
| License | MIT |
| Language | TypeScript |
| Transport | stdio |
| Packages | npm: @bytebase/dbhub |
| Remote URL | none |
| Needs API key | yes |
| Official | no |
| Works with | Claude Desktop, Claude Code, Cursor, VS Code |
| Category | Databases |
| Latest release | v1.4.0 (Sep 28, 2026) |
| Last commit | Oct 2, 2026 |
| MCP registry name | io.github.bytebase/dbhub |

## Install

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ],
      "env": {
        "DSN": "your-value",
        "DB_PASSWORD": "your-value",
        "SSH_PASSWORD": "your-value",
        "SSH_PASSPHRASE": "your-value"
      }
    }
  }
}
```

Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.

### Claude Code

```sh
claude mcp add --env DSN=your-value --env DB_PASSWORD=your-value --env SSH_PASSWORD=your-value --env SSH_PASSPHRASE=your-value --transport stdio dbhub -- npx -y @bytebase/dbhub
```

### Cursor (.cursor/mcp.json)

```json
{
  "mcpServers": {
    "dbhub": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ],
      "env": {
        "DSN": "your-value",
        "DB_PASSWORD": "your-value",
        "SSH_PASSWORD": "your-value",
        "SSH_PASSPHRASE": "your-value"
      }
    }
  }
}
```

Project file; use ~/.cursor/mcp.json to enable it in every project.

### VS Code (.vscode/mcp.json)

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "dsn",
      "description": "DSN",
      "password": true
    },
    {
      "type": "promptString",
      "id": "db_password",
      "description": "DB_PASSWORD",
      "password": true
    },
    {
      "type": "promptString",
      "id": "ssh_password",
      "description": "SSH_PASSWORD",
      "password": true
    },
    {
      "type": "promptString",
      "id": "ssh_passphrase",
      "description": "SSH_PASSPHRASE",
      "password": true
    }
  ],
  "servers": {
    "dbhub": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ],
      "env": {
        "DSN": "${input:dsn}",
        "DB_PASSWORD": "${input:db_password}",
        "SSH_PASSWORD": "${input:ssh_password}",
        "SSH_PASSPHRASE": "${input:ssh_passphrase}"
      }
    }
  }
}
```

Config formats checked against the official docs on 2026-10-07.

## Environment variables

- `DSN` (secret): Database connection string (e.g., postgres://user:pass@host:5432/db)
- `DB_TYPE`: Database type: postgres, mysql, mariadb, sqlserver, oracle, sqlite
- `DB_HOST`: Database hostname
- `DB_PORT`: Database port
- `DB_USER`: Database username
- `DB_PASSWORD` (secret): Database password
- `DB_NAME`: Database name or SQLite file path
- `TRANSPORT`: Transport mode: stdio or http
- `PORT`: HTTP server port (default: 8080)
- `ID`: Instance identifier for tool names
- `SSH_HOST`: SSH server hostname
- `SSH_PORT`: SSH server port (default: 22)
- `SSH_USER`: SSH username
- `SSH_PASSWORD` (secret): SSH password
- `SSH_KEY`: Path to SSH private key
- `SSH_PASSPHRASE` (secret): SSH key passphrase

## Similar MCP servers

- [Dbx](https://appsgit.com/mcp-servers/dbx): Query databases from AI agents using connections configured in DBX. (24,945 stars, Apache-2.0)
- [Butterbase AI MCP Server](https://appsgit.com/mcp-servers/butterbase-ai-mcp-server): Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys. (3,686 stars, Apache-2.0, needs API key)
- [LINQ to DB](https://appsgit.com/mcp-servers/linq-to-db): Inspect database schemas and execute SQL queries across multiple database providers with LINQ to DB. (3,332 stars, MIT)
- [Mindwtr](https://appsgit.com/mcp-servers/mindwtr): Task automation via SQLite, desktop Local API, or Mindwtr Cloud; read-only by default. (2,211 stars, AGPL-3.0, needs API key)
- [MCP Memory Service](https://appsgit.com/mcp-servers/mcp-memory-service): Open-source persistent memory for AI agent pipelines (LangGraph, CrewAI, AutoGen) and Claude. (1,988 stars, Apache-2.0)
- [Pg Aiguide](https://appsgit.com/mcp-servers/pg-aiguide): Comprehensive PostgreSQL documentation and best practices, including ecosystem tools. (1,857 stars, Apache-2.0, needs API key)

---

Canonical page: https://appsgit.com/mcp-servers/dbhub
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed nightly.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
