Connect to Databases Universally
Zero-dependency MCP server letting AI assistants query and explore Postgres, MySQL, MariaDB, SQL Server, or SQLite.
Why it matters
Unify access to diverse databases like PostgreSQL, MySQL, and SQL Server through a single, secure MCP interface. Streamline database operations and AI-driven insights.
Outcomes
What it gets done
Provide a universal gateway for multiple database types.
Enable secure database access with features like SSH tunneling and SSL/TLS.
Facilitate direct SQL execution and schema exploration.
Support AI-powered SQL generation and database explanations.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-dbhub | bash Capabilities
Tools your agent gets
Execute SQL queries against connected databases with transaction support and row limits.
Overview
DBHub MCP Server
A zero-dependency MCP server (Bytebase) letting AI assistants query and explore PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite databases with built-in safety guardrails. Use when an AI assistant needs to execute SQL or explore database schemas across one of the supported engines, including multiple databases at once.
What it does
DBHub is a zero-dependency, token-efficient MCP server (built by Bytebase) that lets MCP clients (Claude Desktop, Claude Code, Cursor, VS Code, Copilot CLI) connect to and explore PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite databases through a single interface, exposing just two core MCP tools to keep context-window usage low.
When to use - and when NOT to
Use it when an AI assistant needs to query or explore a relational database - executing SQL, browsing schemas/tables/columns/indexes/procedures - across one of the five supported database engines, including connecting to multiple databases (e.g. production, staging, dev) simultaneously via TOML config. Guardrails include read-only mode, row limiting, and query timeouts to prevent runaway operations; the HTTP transport does not authenticate clients itself, so for production it should be bound to 127.0.0.1 and fronted by a reverse proxy or firewall rather than exposed on 0.0.0.0.
Capabilities
Two core MCP tools: execute_sql (execute SQL queries with transaction support and safety controls) and search_objects (search and explore schemas, tables, columns, indexes, and procedures via progressive disclosure), plus support for defining reusable, parameterized Custom Tools in a dbhub.toml configuration file. A built-in web Workbench provides a visual interface for running queries, running custom tools, and viewing request traces without an MCP client. Secure access is supported via SSH tunneling and SSL/TLS encryption, and the HTTP transport has built-in DNS-rebinding protection (only accepting requests whose Host is loopback, the machine's own hostname/IPs, or an explicitly allowed host via --allowed-hosts).
How to install
Via Docker:
docker run --rm --init \
--name dbhub \
--publish 8080:8080 \
bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
Or via npm (requires Node.js >= 22.5.0):
npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
A quick demo mode skips the DSN entirely:
npx @bytebase/dbhub@latest --transport http --port 8080 --demo
and the recommended production variant restricts the listener to loopback:
npx @bytebase/dbhub@latest --transport http --host 127.0.0.1 --port 8080 --demo
For local development (requires Node.js >= 22.5.0, since DBHub uses Node's built-in node:sqlite module): pnpm install, pnpm dev to run in dev mode, or pnpm build && pnpm start --transport stdio --dsn ... to build and run for production.
Who it's for
Developers and DBAs who want an AI assistant to query and explore PostgreSQL, MySQL, MariaDB, SQL Server, or SQLite databases directly - across multiple environments at once - with built-in safety guardrails and a visual workbench, without wiring up a separate MCP server per database engine.
Source README
+------------------+ +--------------+ +------------------+
| | | | | |
| | | | | |
| Claude Desktop +--->+ +--->+ PostgreSQL |
| | | | | |
| Claude Code +--->+ +--->+ SQL Server |
| | | | | |
| Cursor +--->+ DBHub +--->+ SQLite |
| | | | | |
| VS Code +--->+ +--->+ MySQL |
| | | | | |
| Copilot CLI +--->+ +--->+ MariaDB |
| | | | | |
| | | | | |
+------------------+ +--------------+ +------------------+
MCP Clients MCP Server Databases
DBHub is a zero-dependency, token efficient MCP server implementing the Model Context Protocol (MCP) server interface. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases:
- Local Development First: Zero dependency, token efficient with just two MCP tools to maximize context window
- Multi-Database: PostgreSQL, MySQL, MariaDB, SQL Server, 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
Supported Databases
PostgreSQL, MySQL, SQL Server, MariaDB, 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
- Custom Tools: Define reusable, parameterized SQL operations in your
dbhub.tomlconfiguration 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.

Installation
See the full Installation Guide for detailed instructions.
Quick Start
Docker:
docker run --rm --init \
--name dbhub \
--publish 8080:8080 \
bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
NPM: (requires Node.js >= 22.5.0)
npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
Demo Mode:
npx @bytebase/dbhub@latest --transport http --port 8080 --demo
Restrict to loopback (recommended for production):
npx @bytebase/dbhub@latest --transport http --host 127.0.0.1 --port 8080 --demo
The HTTP transport defaults to
--host 0.0.0.0, exposing DBHub on every network interface. For production, bind to127.0.0.1and front DBHub with a reverse proxy (nginx/Caddy) or firewall - DBHub does not authenticate HTTP clients.The HTTP transport also has built-in DNS-rebinding protection: it only accepts requests whose
Hostis loopback, this machine's own hostname/IPs, or a name you allow via--allowed-hosts. If a client behind a reverse proxy or custom DNS name gets a403, add that hostname with--allowed-hosts.
See Command-Line Options for all available parameters.
Multi-Database Setup
Connect to multiple databases simultaneously using TOML configuration files. Perfect for managing production, staging, and development databases from a single DBHub instance.
See Multi-Database Configuration for complete setup instructions.
Development
Requires Node.js >= 22.5.0 (DBHub uses the built-in node:sqlite module).
# Install dependencies
pnpm install
# Run in development mode
pnpm dev
# Build and run for production
pnpm build && pnpm start --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"
Star History
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.