/dbhub:setupfrom dbhub
Connect DBHub to a database or fix a failing connection; also covers changing the DSN, write access, or multiple databases.
Ships in dbhub. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This plugin runs DBHub read-only and caps results at 1000 rows. Where the database connection string (DSN) lives depends on the host you are running in:
DBHUB_DSN environment variable of the environment Codex is started in.Help the user build their DSN if they don't have one:
postgres://user:password@localhost:5432/dbnamemysql://user:password@localhost:3306/dbnamemariadb://user:password@localhost:3306/dbnamesqlserver://user:password@localhost:1433/dbnameoracle://user:password@localhost:1521/FREEPDB1 (path is the service name)clickhouse://user:password@localhost:8123/dbname (the HTTP port; 8443 with ?sslmode=require for ClickHouse Cloud)sqlite:///absolute/path/to/database.db (no credentials)Append ?sslmode=require for SSL (sslmode=disable for local databases). URL-encode special characters in the password. Recommend a least-privilege, read-only database account. Full DSN options (SQL Server named instances/NTLM, PostgreSQL cert verification): https://dbhub.ai/installation
Have the user set it themselves — they should not paste the password into the chat:
/plugin, open dbhub → configuration, and set the connection string there.export DBHUB_DSN='<dsn>' to their shell profile (e.g. ~/.zshrc), then start Codex from a new shell so it inherits the variable.Reconnect:
/mcp and reconnect the dbhub server (or restart Claude Code).dbhub server with /mcp.references unset environment variable(s): DBHUB_DSN means the DSN never reached it. In Codex, DBHUB_DSN is not set in the environment Codex was started from (a desktop app may not inherit your shell profile — if so, register DBHub directly as described in the last section).echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"setup-check","version":"0"}}}' | DBHUB_DSN='<dsn>' npx -y @bytebase/dbhub@latest --transport stdio --config <plugin-root>/dbhub.toml
A JSON initialize response means the config parsed and the server started; a connection error points at host/port/credentials/SSL.sslmode, un-encoded special characters in the password, a SQLite path that isn't absolute.sh: dbhub: command not found, or npm reports a missing package.json under ~/.npm/_npx/, the npx cache entry is corrupted (concurrent or interrupted npx runs can leave it half-installed). Find and remove the entry for @bytebase/dbhub under ~/.npm/_npx/*/, then reconnect — npx will reinstall it cleanly.node --version).The plugin covers one database, read-only. For write access, multiple databases, SSH tunnels, or custom tools, register DBHub directly with your own TOML config:
# Claude Code
claude mcp add dbhub -- npx -y @bytebase/dbhub@latest --transport stdio --config /path/to/dbhub.toml
# Codex
codex mcp add dbhub -- npx -y @bytebase/dbhub@latest --transport stdio --config /path/to/dbhub.toml
Offer to write that TOML for the user — format reference: https://dbhub.ai/config/toml. Suggest disabling this plugin afterwards to avoid two overlapping DBHub instances.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 skills in this plugin
npx claudepluginhub bytebase/dbhub --plugin dbhubOther plugins' skills for the same job