DBHub

v0.21.1Databasesstable

A universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.

agentsaianthropicclaudeclaude-ai
Share:
2,810
Stars
0
Downloads
0
Weekly
0/5

What is DBHub?

DBHub is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to universal database gateway mcp server that enables ai assistants to connect to and query multiple databases (postgresql, mysql, mariadb, sql server, sqlite) with support for schema exploration, sql ex...

A universal database gateway MCP server that enables AI assistants to connect to and query multiple databases (PostgreSQL, MySQL, MariaDB, SQL Server, SQLite) with support for schema exploration, SQL execution, and secure connections via SSH tunnels.

This server falls under the Databases category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A universal database gateway MCP server that enables AI assi

Use Cases

Universal database gateway for multiple SQL systems
Schema exploration and secure SSH tunneling
bytebase

Maintainer

LicenseMIT License
Languagetypescript
Versionv0.21.1
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @bytebase/dbhub

Manual Installation

npx -y @bytebase/dbhub

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use DBHub

DBHub is a universal database gateway MCP server by Bytebase that lets AI assistants connect to and query PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite databases through a single, consistent interface. It exposes three core tools — execute_sql, search_objects, and user-defined custom SQL tools — and supports secure connections via SSH tunneling, read-only mode, row limiting, and query timeouts to prevent accidental data changes or runaway queries. Data teams and developers use it to give AI coding assistants safe, read-optimized access to production or staging database schemas without exposing credentials directly.

Prerequisites

  • Node.js 22.5.0 or newer (required for the npx-based launcher), or Docker for the container image
  • A running database instance: PostgreSQL, MySQL, MariaDB, SQL Server, or SQLite
  • A valid DSN (connection string) for your database
  • An MCP client such as Claude Desktop, Claude Code, or Cursor
  • Optional: SSH access credentials if connecting through an SSH tunnel
1

Run DBHub in demo mode to verify setup

Start DBHub in demo mode first — it spins up an in-memory SQLite database with sample data so you can verify the MCP integration works before pointing it at a real database.

npx @bytebase/dbhub@latest --transport stdio --demo
2

Connect to a real database

Pass your database connection string via the --dsn flag. DBHub auto-detects the database type from the DSN scheme (postgres://, mysql://, sqlserver://, etc.).

npx @bytebase/dbhub@latest --transport stdio \
  --dsn "postgres://user:password@localhost:5432/mydb?sslmode=disable"
3

Configure Claude Desktop to use DBHub

Add DBHub to your Claude Desktop MCP configuration. Use stdio transport for local databases, replacing the DSN with your actual connection string.

{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/mydb?sslmode=disable"
      ]
    }
  }
}
4

Run DBHub as an HTTP server for shared team access

For shared team use, run DBHub as an HTTP MCP server. Bind to 127.0.0.1 in production to avoid exposing the server externally.

npx @bytebase/dbhub@latest --transport http --port 8080 --host 127.0.0.1 \
  --dsn "mysql://user:password@localhost:3306/mydb"
5

Connect via Docker

Use the official Docker image to run DBHub without installing Node.js. Mount config files if needed.

docker run --rm --init --name dbhub \
  --publish 8080:8080 bytebase/dbhub \
  --transport http --port 8080 \
  --dsn "postgres://user:[email protected]:5432/mydb?sslmode=disable"
6

Set up a multi-database TOML configuration

Create a TOML config file to expose multiple databases to the same MCP session — useful for cross-database queries or connecting to several projects simultaneously.

# dbhub.toml
[[databases]]
name = "production"
dsn = "postgres://user:pass@prod-host:5432/myapp"

[[databases]]
name = "analytics"
dsn = "mysql://user:pass@analytics-host:3306/metrics"

DBHub Examples

Client configuration

Claude Desktop MCP configuration using DBHub with stdio transport and a PostgreSQL DSN. Replace the DSN with your actual database credentials.

{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/mydb?sslmode=disable"
      ]
    }
  }
}

Prompts to try

Prompts that exercise DBHub's execute_sql and search_objects tools against a connected database.

- "List all tables in the public schema and describe their columns"
- "Show me the 10 most recently created users from the users table"
- "Find all indexes on the orders table"
- "Write and run a query to count orders grouped by status for the last 30 days"
- "Search for all stored procedures that reference the payments table"

Troubleshooting DBHub

Connection refused or 'can't reach host' error with the DSN

When running DBHub via Docker, use host.docker.internal instead of localhost in the DSN to reach services on the host machine. For remote databases, ensure the host's firewall allows connections from DBHub's IP.

npx @bytebase/dbhub fails with 'engine unsupported' or version error

DBHub requires Node.js 22.5.0 or later. Run `node --version` to check. If you're on an older Node.js, upgrade via nvm: `nvm install 22 && nvm use 22`.

SQL queries succeed but return truncated results

DBHub applies row limits by default to prevent runaway queries from sending huge payloads to the LLM context window. Add a LIMIT clause to your query for precise control, or check the DBHub config for the row-limit setting.

Frequently Asked Questions about DBHub

What is DBHub?

DBHub is a Model Context Protocol (MCP) server that universal database gateway mcp server that enables ai assistants to connect to and query multiple databases (postgresql, mysql, mariadb, sql server, sqlite) with support for schema exploration, sql execution, and secure connections via ssh tunnels. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install DBHub?

Install via npm with the command: npx -y @bytebase/dbhub. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with DBHub?

DBHub works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is DBHub free to use?

Yes, DBHub is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Databases MCP Servers

Explore all databases servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "dbhub": { "command": "npx", "args": ["-y", "@bytebase/dbhub"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use DBHub?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides