Skip to content

Dbhub

Token conscious database MCP server for Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite.

Install

$npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
Claude Code
claude mcp add dbhub -- npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
Cursor / Claude Desktop (mcp.json)
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "@bytebase/dbhub@latest",
        "--transport",
        "http",
        "--port",
        "8080",
        "--dsn",
        "\"postgres://user:password@localhost:5432/dbname?sslmode=disable\""
      ]
    }
  }
}

Install command taken from the project's README or registry entry. Always review code before running it.

[!NOTE]
If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase.

            +------------------+    +--------------+    +------------------+
            |                  |    |              |    |                  |
            |  Claude Desktop  +--->+              +--->+    PostgreSQL    |
            |                  |    |              |    |                  |
            |  Claude Code     +--->+              +--->+    SQL Server    |
            |                  |    |              |    |                  |
            |  Cursor          +--->+    DBHub     +--->+    Oracle        |
            |                  |    |              |    |                  |
            |  VS Code         +--->+              +--->+    SQLite        |
            |                  |    |              |    |                  |
            |  Copilot CLI     +--->+              +--->+    MySQL         |
            |                  |    |              |    |                  |
            |                  |    |              +--->+    MariaDB       |
            |                  |    |              |    |                  |
            +------------------+    +--------------+    +------------------+
                 MCP Clients           MCP Server             Databases

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:

  • Minimal: Zero dependency, token efficient with a minimal set of MCP tools to maximize context window
  • Multi-Database: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, and SQLite through a single interface
  • Multi-Connection: Connect to multiple databases simultaneously with TOML configuration
  • Guardrails: Read-only mode, row limiting, and query timeout to prevent runaway operations
  • Secure Access: SSH tunneling and SSL/TLS encryption

DBHub is the official example in the Claude Code docs for connecting to PostgreSQL via MCP.

Token Efficiency

DBHub loads just 2 tools by default at 1.4k tokens — 13-14x fewer than alternatives — keeping the context window open for your actual work.

MCP Server Default Config Default Tools
DBHub 1.4k 2 (execute_sql, search_objects)
MCP Toolbox 19.0k 28
Supabase MCP 19.3k all

Use Cases

  • Local Development: Schema exploration, query validation, and data debugging with Claude Code, VS Code, Cursor, etc.
  • Non-Technical Access: Expose curated, read-only views to non-technical staff via Claude Desktop, VS Code, Cursor, etc.
  • Multi-Database Consolidation: Replace separate MCP servers for each database with a single DBHub process
  • Production Troubleshooting: Read-only diagnostics with guardrails against runaway queries

Supported Databases

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

MCP Tools

DBHub implements MCP tools for database operations:

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io