MCP Directory

DBHub

Zero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, and SQLite.

Unverified
stdio (local)
No auth
TypeScript

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
npx @bytebase/dbhub@latest --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "@bytebase/dbhub@latest",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/dbname"
      ]
    }
  }
}

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • Node.js >= 22.5.0 (for the NPM/npx install; DBHub uses the built-in node:sqlite module)
  • Docker (optional, for the container-based install)
  • A reachable database (PostgreSQL, MySQL, MariaDB, SQL Server, or SQLite) and its DSN connection string

About DBHub

DBHub is a lightweight MCP gateway from Bytebase that connects MCP-compatible clients to PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite databases. It is designed to be zero-dependency and token efficient, exposing a small set of MCP tools so agents can execute SQL and explore schemas while preserving context window. It supports stdio and HTTP transports, multiple simultaneous database connections via TOML config, and guardrails like read-only mode, row limiting, and query timeouts. A built-in web Workbench provides a visual way to run queries and inspect request traces.

Tools & capabilities (3)

execute_sql

Execute SQL queries with transaction support and safety controls (read-only mode, row limiting, query timeout).

search_objects

Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure.

Custom Tools

Define reusable, parameterized SQL operations in your dbhub.toml configuration file.

What this server can do

DBHub provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Let an AI agent query and explore a development database directly from Claude Desktop, Cursor, or VS Code
  • Inspect schemas, tables, columns, and indexes across PostgreSQL, MySQL, SQL Server, MariaDB, or SQLite through one interface
  • Run parameterized, reusable SQL operations as custom tools defined in TOML
  • Manage production, staging, and development databases from a single DBHub instance via multi-database TOML configuration
  • Provide read-only, rate-limited database access to LLMs with guardrails to prevent runaway queries

Security notes

The HTTP transport defaults to --host 0.0.0.0, exposing DBHub on every network interface, and DBHub does not authenticate HTTP clients. For production, bind to 127.0.0.1 and front it with a reverse proxy (nginx/Caddy) or a firewall. The HTTP transport has built-in DNS-rebinding protection, accepting only requests whose Host is loopback, this machine's own hostname/IPs, or a name allowed via --allowed-hosts. Use read-only mode, row limiting, and query timeouts as guardrails against runaway operations. Credentials are passed via the DSN connection string.

DBHub FAQ

Which databases does DBHub support?

PostgreSQL, MySQL, MariaDB, SQL Server (MSSQL), and SQLite, all through a single MCP interface.

How do I connect to multiple databases at once?

Use TOML configuration files to define multiple connections, letting one DBHub instance manage production, staging, and development databases simultaneously. See the Multi-Database Configuration docs at dbhub.ai/config/toml.

Does DBHub authenticate HTTP clients?

No. The HTTP transport does not authenticate clients and defaults to host 0.0.0.0. For production, bind to 127.0.0.1 and front it with a reverse proxy or firewall. It does include built-in DNS-rebinding protection via Host header checks and --allowed-hosts.

How does DBHub keep token usage low?

It is designed to be token efficient by exposing just two core MCP tools (execute_sql and search_objects), with search_objects using progressive disclosure to maximize the available context window.

Alternatives to DBHub

Compare all alternatives →

Google's official MCP server with prebuilt BigQuery tools, querying datasets via Application Default Credentials.

Verified
stdio (local)
OAuth
Go
10 tools
Updated 23 days agoRepo

Create, manage, and query your InstantDB apps, schemas, permissions, and data from your AI editor.

Unverified
HTTP (remote)
OAuth
TypeScript
7 tools
Updated 1 day agoRepo

Read/write Postgres access plus index tuning, EXPLAIN plans, and database health analysis for AI agents.

Verified
stdio (local)
API key
Python
9 tools
Updated 3 months agoRepo