MCP Toolbox for Databases
OFFICIAL SERVERLets an assistant explore schemas and query databases: PostgreSQL, MySQL, BigQuery, Spanner, Snowflake.
Lets an assistant explore schemas and run SQL on PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite
By Bytebase TypeScript Local · stdio Databases
86 popularity score ★ 3.8k ↓ 52k/wk
Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
It needs DSN. Replace each <NAME> with your value.
claude mcp add dbhub -e DSN=<DSN> -- npx -y @bytebase/dbhub{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DSN": "<DSN>"
}
}
}
}{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DSN": "<DSN>"
}
}
}
}{
"servers": {
"dbhub": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DSN": "<DSN>"
}
}
}
}[mcp_servers.dbhub]
command = "npx"
args = ["-y", "@bytebase/dbhub"]
[mcp_servers.dbhub.env]
DSN = "<DSN>"gemini mcp add --scope user -e DSN=<DSN> dbhub npx -- -y @bytebase/dbhubDSN |
Required: Database connection string, e.g. postgres://user:password@localhost:5432/dbname (or pass --dsn). |
|---|---|
TRANSPORT |
Optional: stdio (default) or http. |
PORT |
Optional: HTTP server port, http transport only (default 8080). |
DBHUB_AUTH_TOKEN |
Optional: Bearer tokens required on every HTTP request; auth is off unless set. |
DBHUB_HOST |
Optional: HTTP bind address (default 0.0.0.0). |
DBHub is a database MCP server from Bytebase. One process connects an MCP client such as Claude Code, Claude Desktop, Cursor or VS Code to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle or SQLite. It loads two tools by default, execute_sql and search_objects, to keep the tool list small. explain_sql and health_check are optional extras, and you can define your own parameterized SQL tools in a dbhub.toml file.
A single database is set with a DSN connection string, through the --dsn flag, the DSN variable or the DB_* variables. A TOML file passed with --config can connect several databases at once and set options per tool, such as read-only mode, row limits and query timeouts. Connections can go through SSH tunnels (bastion and jump hosts) and use SSL/TLS.
It runs on your machine with npx (Node.js 22.5.0 or later) or from the bytebase/dbhub Docker image, over stdio by default or over HTTP. HTTP mode also serves a web workbench for running queries and tools and viewing request traces. There is also a one-click MCP Bundle and a Claude Code plugin, and both are read-only.
execute_sqlsearch_objectsexplain_sqlhealth_check