
How to add DBHub to Claude Desktop
Zero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, and SQLite. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 ยท 3.0kโ ยท stdio ยท no auth
Claude Desktop config for DBHub
npx @bytebase/dbhub@latest --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"@bytebase/dbhub@latest",
"--transport",
"stdio",
"--dsn",
"postgres://user:password@localhost:5432/dbname"
]
}
}
}Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the DBHub config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm DBHub's tools appear under the ๐ tools menu.
Before you start
- Node.js >= 22.5.0 (for the NPM/npx install; DBHub uses the built-in node:sqlite module)
- Docker (optional, for the container-based install)
- A reachable database (PostgreSQL, MySQL, MariaDB, SQL Server, or SQLite) and its DSN connection string
What DBHub can do in Claude Desktop
execute_sqlExecute SQL queries with transaction support and safety controls (read-only mode, row limiting, query timeout).
search_objectsSearch and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure.
Custom ToolsDefine reusable, parameterized SQL operations in your dbhub.toml configuration file.
Security
The HTTP transport defaults to --host 0.0.0.0, exposing DBHub on every network interface, and DBHub does not authenticate HTTP clients. For production, bind to 127.0.0.1 and front it with a reverse proxy (nginx/Caddy) or a firewall. The HTTP transport has built-in DNS-rebinding protection, accepting only requests whose Host is loopback, this machine's own hostname/IPs, or a name allowed via --allowed-hosts. Use read-only mode, row limiting, and query timeouts as guardrails against runaway operations. Credentials are passed via the DSN connection string.
DBHub + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the DBHub config there under the "mcpServers" key and restart the client.
Is DBHub safe to use with Claude Desktop?
The HTTP transport defaults to --host 0.0.0.0, exposing DBHub on every network interface, and DBHub does not authenticate HTTP clients. For production, bind to 127.0.0.1 and front it with a reverse proxy (nginx/Caddy) or a firewall. The HTTP transport has built-in DNS-rebinding protection, accepting only requests whose Host is loopback, this machine's own hostname/IPs, or a name allowed via --allowed-hosts. Use read-only mode, row limiting, and query timeouts as guardrails against runaway operations. Credentials are passed via the DSN connection string.
Which databases does DBHub support?
PostgreSQL, MySQL, MariaDB, SQL Server (MSSQL), and SQLite, all through a single MCP interface.
How do I connect to multiple databases at once?
Use TOML configuration files to define multiple connections, letting one DBHub instance manage production, staging, and development databases simultaneously. See the Multi-Database Configuration docs at dbhub.ai/config/toml.
Does DBHub authenticate HTTP clients?
No. The HTTP transport does not authenticate clients and defaults to host 0.0.0.0. For production, bind to 127.0.0.1 and front it with a reverse proxy or firewall. It does include built-in DNS-rebinding protection via Host header checks and --allowed-hosts.