DBHub

io.github.bytebasePublished by GitHub account bytebasev1.6.0Updated Nov 7, 2026

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

VerifiedSTDIODesktop onlyDatabasesDeveloper Tools

Overview

AI-generated overview

Lightweight MCP server that lets an assistant run SQL and explore schemas across PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite.

What you can do
  • Run SQL queries with transaction support and safety controls
  • Search and explore schemas, tables, columns, indexes and procedures
  • Show a query's execution plan without running it (opt-in)
  • Report connection pool state and cache hit ratio (opt-in)
  • Run reusable parameterized SQL operations defined in a TOML config
  • Use a built-in web workbench to run queries and view request traces
When to use it
Useful when an assistant should inspect or query one or more relational databases during development, validate SQL, debug data, or offer curated read-only access to non-technical users. A single process can replace separate servers for each database.
Requirements
Runs locally as an npm package (Node.js 22.5.0 or newer) or via Docker. Needs connection details for the target database, given as a DSN or as DB_TYPE, DB_HOST, DB_PORT, DB_NAME, DB_USER and DB_PASSWORD. Optional SSH tunneling uses SSH_HOST, SSH_USER, SSH_PORT and a key, password or agent socket. Default transport is stdio; an HTTP mode uses PORT.
Before you install
The server holds database credentials (DSN, DB_PASSWORD, SSH_PASSWORD, SSH_PASSPHRASE, SSH_KEY) and can execute arbitrary SQL, including writes and deletes unless read-only mode is enabled. Enable read-only mode, row limits and query timeouts before pointing it at production data, and be aware that query results are sent to the MCP client.

Installation

In SourceWeft

  1. Open DBHub in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

[!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.

[GitHub Trending Repository of the Day]

[DBHub Logo]

bash
            +------------------+    +--------------+    +------------------+            |                  |    |              |    |                  |            |  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 ServerDefault ConfigDefault Tools
DBHub1.4k2 (execute_sql, search_objects)
MCP Toolbox19.0k28
Supabase MCP19.3kall

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.

[workbench]

Installation

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

Also available as:

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).

bash
# Install dependenciespnpm install
# Run in development modepnpm dev
# Build and run for productionpnpm build && pnpm start --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"

See Testing and Debug.

Contributors

[Image]

Star History

[Star History Chart]

Source: README.md at commit 8c09c86

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

7
  1. v1.6.0LatestNov 7, 2026
  2. v1.5.1Nov 3, 2026
  3. v1.5.0Oct 9, 2026
  4. v1.4.0Sep 29, 2026
  5. v1.3.1Sep 21, 2026
  6. v1.3.0Sep 19, 2026
  7. v1.2.3Sep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts