plugin/ directory of the DBHub repository and includes:
- MCP server — runs
npx @bytebase/dbhub(pinned to the plugin version) over stdio against a bundled read-only configuration. /dbhub:setup— helps you build the connection string, troubleshoot connection failures, and graduate to a multi-database TOML config when you outgrow the plugin./dbhub:explore— teaches Claude the progressive-disclosure workflow forsearch_objects(names→summary→full), keeping schema exploration cheap on large databases.
Install
Inside Claude Code, add the DBHub marketplace (defined in this repository) and install:claude --plugin-dir ./dbhub/plugin.
Claude Code prompts for your database connection string (DSN) on install and stores it in secure storage — it never lives in a config file. Example: postgres://user:password@localhost:5432/dbname (run /dbhub:setup for help building one). To change it later, open /plugin → dbhub → configuration.
Requires Node.js >= 22.5.0 on the machine running Claude Code —
npx fetches the @bytebase/dbhub package on first launch. The machine connects directly to the database, so the database must be reachable from it (VPN or network allow-list).Read-only by design
The bundled configuration setsreadonly = true and max_rows = 1000 on execute_sql: mutating statements are rejected, and the database session is additionally set to read-only at the engine level. Still, connect with a least-privilege, read-only database account — defense in depth beats configuration alone.
When to use the plugin vs. claude mcp add
The plugin covers the common case: one database, read-only, zero config files. For write access, multiple databases, SSH tunnels, or custom tools, register DBHub directly with your own TOML configuration:
/plugin → dbhub) to avoid two overlapping DBHub instances. See the Installation guide for all Claude Code registration options, including HTTP transport and project-scoped .mcp.json.