Dbhub logo

Dbhub

Minimal MCP database gateway for querying and exploring PostgreSQL, MySQL, SQL Server, Oracle, ClickHouse, MariaDB, and SQLite.

Install Dbhub

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio dbhub -- npx -y @bytebase/dbhub

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y @bytebase/dbhub

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

dbhub connects MCP-compatible clients to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse, and SQLite through a single lightweight gateway. It provides SQL execution and schema search by default, with optional query-plan and health-check tools plus configurable custom SQL tools. TOML configuration supports multiple connections, while read-only mode, row limits, query timeouts, SSH tunneling, and SSL/TLS address common operational needs. Reach for it when an agent needs database exploration, diagnostics, validation, or controlled access across more than one database system.

Use cases

  • Explore database schemas during local development
  • Validate SQL and debug data with an MCP client
  • Consolidate connections to multiple database systems
  • Expose curated read-only views to non-technical users
  • Diagnose production databases with query guardrails

Key features

  • Supports seven database systems through one MCP gateway
  • Executes SQL with transactions and safety controls
  • Searches schemas, tables, columns, indexes, and procedures
  • Connects to multiple databases through TOML configuration
  • Provides read-only mode, row limits, and query timeouts
  • Supports optional custom tools, query plans, and health checks

Tools1

What Dbhub lets your agent do. Expand a tool for its parameters.

Self-reported~3 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

70/70 checks healthy over the last 85d

Supply-chain signal

2 high-severity advisories on record for this package. Most advisories affect transitive dependencies and may not be exploitable in this server's actual usage — this is a directional signal, not a security audit.

Critical 1High 1Medium 1Low 0

Scanned 10d ago via OSV.dev · @bytebase/dbhub (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars4kStargazers on the source repository.
npm downloads538kPackage downloads in the last 30 days.
Last commit11d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed1Callable tools this server registers over MCP.
Directory activity10 viewsConfig copies, upvotes, and views on AllMCPs.

How Dbhub works

What dbhub does

dbhub gives MCP clients a common interface for working with several relational and analytical database systems. Supported databases include PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse, and SQLite. A single DBHub process can connect to multiple databases through TOML configuration, which can replace separate MCP servers for individual database products.

The default interface is intentionally small: SQL execution and schema-object search. This keeps tool definitions compact for clients with limited context windows. Optional capabilities add query-plan inspection and connection health reporting, while custom tools let administrators expose reusable parameterized SQL operations from configuration.

Typical uses include exploring schemas during development, validating queries, debugging data, providing curated read-only views to non-technical users, and investigating production issues without allowing unrestricted write access.

How it works

DBHub runs as an MCP server between an MCP client and one or more databases. Clients such as Claude Desktop, Claude Code, Codex, Cursor, and VS Code can send database requests through the server. The server can run with a connection string supplied through the command line or with a TOML file describing multiple connections and additional settings.

The execute_sql tool runs SQL and supports transactions and safety controls. search_objects progressively explores database schemas, including tables, columns, indexes, and procedures. When enabled, explain_sql returns an execution plan without executing the query, and health_check reports connection-pool state and buffer-cache hit ratio.

An HTTP launch mode is available, and DBHub also includes a web Workbench for executing queries, running custom tools, and viewing request traces without an MCP client.

Setup and configuration

The package can be launched with npx and a database connection string:

Terminal
npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"

The --dsn option accepts a connection URL, including existing postgresql:// URLs. For several databases, use a dbhub.toml configuration file. That file can also enable custom tools and settings such as read-only operation.

DBHub is available through a Docker image and as a one-click MCP Bundle configured for read-only access. Claude Code and Codex have dedicated plugins; the Codex plugin reads its connection string from DBHUB_DSN.

Development requires Node.js 22.5.0 or newer. To configure a deployment safely, combine DBHub's read-only mode with a least-privilege, read-only database account. Read-only mode is a server guardrail rather than a database permission boundary.

Tools and capabilities

  • execute_sql: Runs SQL with transaction support and safety controls. With a DSN alone, it can perform writes; a TOML configuration can enable read-only mode.
  • search_objects: Finds and explores schemas, tables, columns, indexes, and procedures using progressive disclosure.
  • explain_sql: Optional tool that returns a query execution plan without running the query.
  • health_check: Optional tool that reports connection-pool state and buffer-cache hit ratio.
  • Custom tools: Defines reusable, parameterized SQL operations in dbhub.toml.
  • Guardrails: Supports read-only mode, row limits, and query timeouts.
  • Connectivity: Supports multiple simultaneous connections, SSH tunneling, and SSL/TLS encryption.
  • Workbench: Provides a browser-based interface for queries, custom tools, and request traces.

Limitations and notes

DBHub is designed as a minimal database gateway rather than an enterprise governance layer. Approval flows, access control, data masking, and audit logging are identified as capabilities available through Bytebase instead. Database credentials and permissions remain important: read-only mode alone should not be treated as an authorization boundary.

The server's default tool set is deliberately small. Query-plan inspection and health reporting require opt-in configuration, and custom operations must be defined explicitly in dbhub.toml. Applications replacing the archived PostgreSQL reference server should also account for the behavioral difference that DBHub can write when launched with only --dsn; read-only operation requires configuration and suitable database credentials.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Dbhub

dbhub is an MCP server that connects AI clients to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse, and SQLite. Its main tools execute SQL and search database objects; optional tools explain query plans and report connection health. It also supports multiple connections, custom SQL tools, read-only mode, row limits, and query timeouts.

Install it with `npx @bytebase/dbhub@latest`, then provide `--dsn` with a database connection string or use a TOML configuration file. Docker and an MCP Bundle are also available. Claude Code and Codex can use their dedicated plugins.

dbhub supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse, and SQLite. A single process can connect to multiple databases through TOML configuration.

Enable `readonly = true` in the TOML configuration and use a least-privilege, read-only database user. Launching DBHub with only `--dsn` allows `execute_sql` to write, so read-only mode must be configured explicitly.

Yes. Cursor is listed as an MCP client that can connect to DBHub. The server can expose database operations through its default MCP tools, including SQL execution and schema-object search.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewDbhub AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/dbhub?style=directory)](https://allmcps.com/mcp/dbhub)
HTML Embed
<a href="https://allmcps.com/mcp/dbhub"><img src="https://allmcps.com/api/badge/dbhub?style=directory" alt="Dbhub on AllMCPs" /></a>