D

DBHub Official

MCP server · by bytebase

Databases npm v1.6.0

Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite

View source ↗ Generate config for multiple servers More servers

Install

registry version 1.6.0

npm
npx -y @bytebase/dbhub

Setup by client

Pick your client — the config below is generated for this server (local stdio). Copy respects the “Pin version” switch above.

claude_desktop_config.json

{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ],
      "env": {
        "DSN": "<YOUR_DSN>",
        "DB_PASSWORD": "<YOUR_DB_PASSWORD>"
      }
    }
  }
}

Format verified against the official Claude Desktop docs ↗.

Environment variables

Defined in the server's official registry manifest. Required secrets are shown as <YOUR_…> placeholders in the configs above.

  • 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

Official version check

Official · by Bytebase

Evidence ↗

Other community implementations

Independent, non-official implementations of the DBHub MCP server maintained by the community.

Last verified: 2026-10-15 | Sources: Verification basis ↗

GitHub

⭐ 3,652 stars · 最近更新于 29 天前 · MIT license

About this server

> [!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. > > > /> /> /> > > > > > > > > > > > > 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: execute sql : Execute SQL queries with transaction support and safety controls search objects : Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure explain sql (opt-in): Show a query's execution plan without running it health check (opt-in): Report connection pool state and buffer cache hit ratio Custom Tools : Define reusable, parameterized SQL operations in your dbhub.toml configuration file Workbench DBHub includes a built-in web interface for interacting with your database tools. It provides a visual way to execute queries, run custom tools, and view request traces without requiring an MCP client. Installation Also available as: Docker image MCP Bundle (one-click install, read-only) Claude Code plugin See the Installation Guide for all options, Command-Line Options for parameters, and Multi-Database Configuration for connecting several databases at once. Development Requires Node.js >= 22.5.0 (DBHub uses the built-in node:sqlite module). See Testing and Debug. Contributors > /> > Star History > > /> /> /> > >…

Summary from the project README — github.com/bytebase/dbhub

Distributed as npm, listed under Databases. Review our MCP security guide before granting access to real data.

Frequently asked questions

What does the DBHub MCP server do?

> [!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. > > > /> /> /> > > > > > > > > > > > > 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: execute sql : Execute SQL queries with transaction support and safety controls search objects : Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure explain sql (opt-in): Show a query's execution plan without running it health check (opt-in): Report connection pool state and buffer cache hit ratio Custom Tools : Define reusable, parameterized SQL operations in your dbhub.toml configuration file Workbench DBHub includes a built-in web interface for interacting with your database tools. It provides a visual way to execute queries, run custom tools, and view request traces without requiring an MCP client. Installation Also available as: Docker image MCP Bundle (one-click install, read-only) Claude Code plugin See the Installation Guide for all options, Command-Line Options for parameters, and Multi-Database Configuration for connecting several databases at once. Development Requires Node.js >= 22.5.0 (DBHub uses the built-in node:sqlite module). See Testing and Debug. Contributors > /> > Star History > > /> /> /> > >

How do I install DBHub?

Run the install command shown above, then paste the config for your client (Claude Desktop, Claude Code, Cursor, VS Code or Windsurf) into its MCP settings and restart the client.

Is DBHub free to use?

The MCP server itself is free to install. The source is public on https://github.com/bytebase/dbhub. Any third-party service it calls may require its own API key and account.

Which clients support DBHub?

Any MCP-compatible client can use it, including Claude Desktop, Claude Code, Cursor, VS Code, Windsurf and custom agents.

Add this badge

Publish this server? Link back with a badge on your README or site — copy either snippet.

Listed on MCPNav

Markdown

[![Listed on MCPNav](https://mcpnav.net/badge/dbhub.svg)](https://mcpnav.net/server/dbhub/)

HTML

<a href="https://mcpnav.net/server/dbhub/"><img src="https://mcpnav.net/badge/dbhub.svg" alt="Listed on MCPNav" height="20"></a>