DBHub
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.
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
Maintainer
Works with
Installation
NPM
npx -y @bytebase/dbhubManual Installation
npx -y @bytebase/dbhubConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 --demoConnect 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"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"
]
}
}
}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"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"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.
DBHub Alternatives — Similar Databases Servers
Looking for alternatives to DBHub? Here are other popular databases servers you can use with Claude, Cursor, and VS Code.
Excelize
★ 20.6kGo language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
MCP Toolbox for Databases
★ 15.3kOpen source MCP server specializing in easy, fast, and secure tools for Databases.
Tabularis
★ 2.1kA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
Postgres AI Guide
★ 1.7kMCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
Anyquery
★ 1.7k🏎️ 🏠 ☁️ - Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by design.
MySQL
★ 1.7kProvides access to MySQL databases with fine-grained access control, supporting multiple databases simultaneously with configurable access modes (readonly, readwrite, full) and table-level permissions using whitelists, blacklists, wildcards, and rege
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.
Set Up DBHub in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.