DBHub
MCP server by bytebase Community
Connects MCP clients such as Claude Desktop, Cursor and VS Code to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It exposes two tools by default, with read-only mode and query timeouts available as guardrails.
Install DBHub
Built from the published package, never by AI.
claude mcp add dbhub -- npx -y @bytebase/dbhubRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"dbhub": {
"args": [
"-y",
"@bytebase/dbhub"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"dbhub": {
"args": [
"-y",
"@bytebase/dbhub"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"dbhub": {
"args": [
"-y",
"@bytebase/dbhub"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add dbhub -- npx -y @bytebase/dbhub{
"mcpServers": {
"dbhub": {
"args": [
"-y",
"@bytebase/dbhub"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add dbhub npx -y @bytebase/dbhubGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the dbhub block.
About
DBHub is an MCP server that lets MCP-compatible clients connect to and explore several databases through one interface. It supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It can connect to multiple databases at once using TOML configuration, and it supports SSH tunneling and SSL/TLS encryption.
The server is designed to keep the context window small. Its two built-in tool definitions total 261 tokens with the cl100k_base tokenizer, according to the project. Guardrails include read-only mode, row limiting and query timeouts. A built-in web Workbench is also included. The project is aimed at local development, read-only access for non-technical staff, consolidating several database servers, and production troubleshooting.
Written from the project's README and checked against it.
Tools it gives your assistant
execute_sqlExecutes SQL queries with transaction support and safety controls.search_objectsSearches schemas, tables, columns, indexes and procedures with progressive disclosure.explain_sqlShows a query's execution plan without running it. Opt-in.health_checkReports connection pool state and buffer cache hit ratio. Opt-in.Custom ToolsDefines reusable, parameterized SQL operations in a dbhub.toml file.
What you need
- Node.js 22.5.0 or later
- A database connection string (DSN)
| Setting | Needed | What it is |
|---|---|---|
DSNEnvironment variable, secret | Optional | Database connection string (e.g., postgres://user:pass@host:5432/db) |
DB_Environment variable | Optional | Database type: postgres, mysql, mariadb, sqlserver, oracle, clickhouse, sqlite |
DB_Environment variable | Optional | Database hostname |
DB_Environment variable | Optional | Database port |
DB_Environment variable | Optional | Database username |
DB_Environment variable, secret | Optional | Database password |
DB_Environment variable | Optional | Database name or SQLite file path |
TRANSPORTEnvironment variable | Optional | Transport mode: stdio or http |
PORTEnvironment variable | Optional | HTTP server port (default: 8080) |
IDEnvironment variable | Optional | Instance identifier for tool names |
SSH_Environment variable | Optional | SSH server hostname |
SSH_Environment variable | Optional | SSH server port (default: 22) |
SSH_Environment variable | Optional | SSH username |
SSH_Environment variable, secret | Optional | SSH password |
SSH_Environment variable | Optional | Path to SSH private key |
SSH_Environment variable, secret | Optional | SSH key passphrase |
SSH_Environment variable | Optional | Path to SSH agent socket |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- Use DBHub to list the tables and columns in my orders database.
- Run a query on the customers table and check the results for duplicates.
- Show the execution plan for this SQL query without running it.
Good to know
- Read-only mode is a guardrail, not a permission boundary. The source recommends a least-privilege, read-only database user.
- With --dsn alone, execute_sql can write. A TOML config with readonly = true is needed to keep it read-only.
- explain_sql and health_check are opt-in.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to DBHub
All alternatives →Connects Supabase projects to AI assistants such as Cursor, Claude and Windsurf over the Model Context Protocol. It lets assistants manage tables, fetch config and query data in a Supabase project.
ArcadeDB MCP Server is the built-in Model Context Protocol server of the ArcadeDB multi-model database. It lets AI assistants and LLMs work with ArcadeDB's graph, document, time-series, vector and other data models. It suits people who already run ArcadeDB and want assistant access to it.
MCP Toolbox for Databases is an open source MCP server that connects AI agents, IDEs and applications to enterprise databases. It provides prebuilt tools for exploring schemas and running queries, plus a framework for custom tools. It is aimed at developers building agents that need database access.
Connects AI agents, IDEs and applications to enterprise databases through the Model Context Protocol. Offers prebuilt database tools for MCP clients and a framework for building custom tools for production agents.
MongoDB MCP Server lets AI assistants interact with MongoDB databases and MongoDB Atlas. It is an official server from mongodb-js, run locally with npx or Docker. It works with self-managed deployments and Atlas clusters.
Query databases from AI coding agents using the connections already set up in DBX. The dbx MCP server suits developers who use Claude Code, Cursor, Windsurf, or another MCP-compatible agent.
Compare with Supabase, ArcadeDB MCP Server or MCP Toolbox for Databases
DBHub: common questions
Which databases does DBHub support?
The source lists PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite.
Can DBHub replace @modelcontextprotocol/server-postgres?
The source describes DBHub as a maintained replacement for the archived reference PostgreSQL server. An existing postgresql:// URL works unchanged with --dsn.
Does DBHub offer approval flows or data masking?
The source says enterprise guardrails such as approval flow, access control, data masking and audit logging are beyond what DBHub offers. It points users to Bytebase for those features.
How do I install DBHub?
In Claude Code run claude mcp add dbhub -- npx -y @bytebase/dbhub. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is DBHub the official server?
DBHub is a community project by bytebase, not verified by a company domain.
Is DBHub free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is DBHub safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to DBHub?
Similar MCP servers: Supabase, ArcadeDB MCP Server, MCP Toolbox for Databases, MCP Toolbox for Databases.
Does DBHub work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
