What is DBHub?
DBHub is a lightweight Model Context Protocol (MCP) server that bridges AI assistants with your databases. It implements the MCP specification to provide a standardized interface for database operations, enabling AI agents like Claude Desktop, Claude Code, Cursor, and VS Code to interact with your databases intelligently.DBHub is brought to you by Bytebase, the open-source database DevSecOps platform.
Understanding MCP servers
The Model Context Protocol (MCP) is a standardized interface that allows AI assistants to interact with external data sources and tools. DBHub implements this protocol as an MCP server, acting as a gateway between:- MCP Clients: AI assistants (Claude Desktop, Claude Code, Cursor, VS Code, Copilot CLI)
- Databases: Your PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite databases
Supported databases
DBHub supports five major database systems through a unified interface:PostgreSQL
Full support for schemas, procedures, functions, and advanced features
MySQL
Complete MySQL compatibility with all standard operations
MariaDB
Native MariaDB connector with full feature support
SQL Server
Microsoft SQL Server support including named instances and NTLM authentication
SQLite
File-based and in-memory SQLite databases
Key features
Zero dependencies
Zero dependencies
DBHub is designed to work out of the box with no additional dependencies. Simply install via npm or run with Docker, and you’re ready to connect to your databases.
Token efficient
Token efficient
DBHub implements only two core MCP tools (
execute_sql and search_objects) to maximize your AI assistant’s context window. The search_objects tool uses progressive disclosure, allowing you to start with minimal token usage (just object names) and request more details only when needed.Multi-database support
Multi-database support
Connect to multiple databases simultaneously using TOML configuration. Perfect for managing production, staging, and development databases from a single DBHub instance.
SSH tunnels
SSH tunnels
Securely connect to remote databases through SSH bastion hosts with support for:
- Password and key-based authentication
- Multi-hop tunneling via ProxyJump
- Automatic SSH config file parsing
- Keepalive for stable long-running connections
Built-in workbench
Built-in workbench
DBHub includes a web-based interface for testing queries, running custom tools, and viewing request traces without requiring an MCP client.
Guardrails and safety
Guardrails and safety
Built-in safety controls include:
- Read-only mode to prevent accidental modifications
- Row limiting to prevent overwhelming responses
- Query timeouts to prevent runaway operations
- Per-tool configuration for granular control
MCP tools
DBHub exposes three types of MCP tools:Built-in tools
execute_sql
Execute SQL queries with transaction support and safety controls. Supports multiple statements separated by semicolons.
search_objects
Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure.
Custom tools
Define reusable, parameterized SQL operations in yourdbhub.toml configuration file. Perfect for common queries that you want to expose as dedicated tools. Learn more about custom tools.
How it works
- Configure: Set up DBHub with your database connection details via command-line arguments, environment variables, or TOML configuration
- Connect: DBHub establishes a connection to your database(s) and registers MCP tools
- Discover: Your AI assistant discovers available tools through the MCP protocol
- Execute: The assistant can execute SQL queries, explore schemas, and invoke custom tools
- Respond: DBHub formats results and returns them to the assistant
Next steps
Installation
Install DBHub using Docker, npm, or build from source
Quick start
Get started in minutes with Docker or demo mode
Configuration
Learn about multi-database setup and advanced configuration
Workbench
Explore the built-in web interface