Skip to content

docs: add HTTP/auth/SSH/API reference guides and fix tool reference inaccuracies - #395

Closed
laserduor wants to merge 4 commits into
bytebase:mainfrom
laserduor:docs/dbhub-docs-improvements
Closed

docs: add HTTP/auth/SSH/API reference guides and fix tool reference inaccuracies#395
laserduor wants to merge 4 commits into
bytebase:mainfrom
laserduor:docs/dbhub-docs-improvements

Conversation

@laserduor

Copy link
Copy Markdown
Contributor

Summary

Four documentation improvements for the DBHub docs site, covering previously undocumented configuration surfaces and fixing factual inaccuracies in the tool reference. All changes are docs-only — no source code touched.

Changes

1. New: HTTP Server deployment guide (docs/config/http-server.mdx)

Why: --transport=http has been a first-class feature since the HTTP transport landed, but there was no dedicated page explaining it. The only mention lived inside the CLI reference. Operators deploying DBHub behind a reverse proxy (or running it in Docker) had to piece together the endpoint list, auth model, and security properties from code.

What it covers:

  • When to use HTTP vs stdio transport
  • Full endpoint reference (/mcp, /healthz, /api/*)
  • Security: DNS-rebinding protection, bearer token auth, CORS
  • Production deployment: reverse proxy, Docker, multi-instance setup
  • Client configuration for HTTP transport (.mcp.json, Claude Code)

2. New: Authentication guide (docs/config/auth-token.mdx)

Why: --auth-token / DBHUB_AUTH_TOKEN support was added in #390, but the docs only mentioned it in passing. Auth is a security-sensitive topic — users deserve a complete, verified reference rather than inference from code.

What it covers:

  • How bearer token auth works (opt-in via token presence, no separate flag)
  • Setting the token: CLI flag, env var, .env file, Docker
  • Client configuration: curl, .mcp.json, Claude Code
  • Multiple tokens: comma-separated list for zero-downtime rotation and per-client tokens with independent revocation
  • Security notes: constant-time comparison, flat shared-secret model (not OAuth), defense in depth
  • Verification steps to confirm auth is actually enforced

Also simplified http-server.mdx to link to the new page instead of duplicating auth content.

3. New: SSH tunnel guide (docs/config/ssh-tunnel.mdx)

Why: SSH tunneling is a core deployment pattern for reaching databases on private networks, and DBHub has rich support for it (password, key, ProxyJump, ~/.ssh/config aliases). None of this was documented anywhere.

What it covers:

  • Quick start with --ssh-host / --ssh-user / --ssh-key
  • All four auth methods: password, SSH key (incl. passphrase), ProxyJump multi-hop, SSH config alias resolution
  • TOML [[sources]] equivalents
  • Troubleshooting common connection failures

4. New: REST API reference (docs/config/api-reference.mdx)

Why: The HTTP server exposes /api/sources and /api/requests (used by the Workbench frontend and useful for external tooling), but they were undocumented outside the code. External integrations had no reference for response shapes.

What it covers:

  • GET /api/sources — configured sources (passwords/keys excluded from responses)
  • GET /api/requests — tool execution traces (filterable by source_id)
  • GET /healthz — unauthenticated health probe for uptime monitors
  • Auth requirements per endpoint

5. Systematic fixes across existing pages (15 files)

  • Frontmatter: added description to 12/19 pages that had only title (all tools, config, getting-started pages). Mintlify surfaces descriptions in search results and link previews; pages without them looked incomplete in search.
  • execute-sql.mdx: added a Features table and a Parameters table; fixed factual errors:
    • Removed fabricated source_id / transaction / max_rows parameters — the actual tool schema has a single sql parameter (multi-source routing is by tool name suffix execute_sql_{source_id}, not by parameter)
    • Replaced the deprecated --max-rows CLI flag reference with the current TOML [[tools]] max_rows configuration (the flag now exits with an error pointing to TOML)
  • See Also links: added missing cross-links to explain-sql, health-check, debug pages
  • command-line.mdx: expanded the --id flag with a multi-instance scenario (e.g. running separate DBHub processes for different databases in Cursor/Claude Code)
  • toml.mdx: expanded hot-reload behavior (what triggers it, stdio limitation, troubleshooting); removed a duplicated hot-reload section
  • Nav (docs.json): registered all four new pages under Configuration

Verification

  • All internal links resolve (checked against the full docs tree; no orphans)
  • All flags referenced in the new pages exist in src/config/env.ts (verified each --ssh-*, --auth-token, --id, --transport, --demo, etc.)
  • All API endpoints and response fields verified against src/server.ts
  • Tool schemas verified against src/tools/*.ts (execute_sql, search_objects, explain_sql, health_check)
  • Multi-token rotation and constant-time comparison claims verified against src/config/env.ts
  • git diff origin/main is docs-only: 17 files, 811 insertions, 27 deletions

Notes

  • Pure documentation changes — no behavior change, no test impact
  • Commits are split by topic (http-server, auth-token, systematic fixes, parameter-table fix) to keep review easy
  • Happy to adjust tone, structure, or split the PR further if you'd prefer smaller chunks

Add a dedicated HTTP MCP server configuration page covering:

- When to use HTTP vs stdio transport
- All endpoints (/mcp, /healthz, /api/*)
- Security: DNS-rebinding protection, bearer token auth, CORS
- Production deployment: reverse proxy, Docker, multi-instance
- Client configuration for HTTP transport
- Complete command-line reference
New dedicated page (config/auth-token.mdx) covering:

- How bearer token auth works in DBHub
- Setting the token via CLI flag, env var, .env file, Docker
- Client configuration (curl, .mcp.json, Claude Code)
- Multiple tokens for zero-downtime rotation and per-client tokens
- Security considerations (constant-time comparison, defense in depth)
- Verification steps to confirm auth is working
- Complete reference table

Simplified http-server.mdx to reference the new auth page instead of
duplicating content.
- SSH: new docs/config/ssh-tunnel.mdx (password, key, ProxyJump, SSH config alias)
- API: new docs/config/api-reference.mdx (sources, requests, health check endpoints)
- Frontmatter: add description to 12/19 pages (all tools, config, getting started)
- Parameters: add parameter table to execute-sql.mdx
- See Also: add missing links to explain-sql, health-check, debug
- Links: installation.mdx, quickstart.mdx now link to HTTP, auth, SSH pages
- --id: expand multi-instance scenario docs
- TOML hot reload: expand with behavior, STDIO limitation, troubleshooting
- Nav: add ssh-tunnel, api-reference to docs.json
- Remove duplicate hot-reload section from toml.mdx
…s flag reference

- execute_sql schema only has a single 'sql' parameter; remove the
  fabricated source_id / transaction / max_rows entries
- readonly and max_rows are per-tool TOML config, not query parameters;
  multi-source routing is via tool name suffix (execute_sql_{source_id})
- replace deprecated --max-rows CLI flag mention with the TOML [[tools]]
  max_rows configuration
@laserduor
laserduor requested a review from tianzhou as a code owner August 8, 2026 06:16
@tianzhou

tianzhou commented Aug 8, 2026

Copy link
Copy Markdown
Member

thanks for creating the PR. But we are not accepting large doc PR. Keeping the doc minimum and not spreading across different places is deliberate.

e.g. --auth-token is already mentioned https://dbhub.ai/config/command-line#%E2%80%94auth-token

@tianzhou tianzhou closed this Aug 8, 2026
@laserduor

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback — understood, and agreed that docs should stay minimal. I have split the changes into three small, focused PRs (each one single-purpose, no new standalone pages):

  1. docs: replace deprecated --max-rows flag reference in execute_sql docs #396 — fix: replace deprecated --max-rows flag reference in execute_sql docs (the flag was removed from the CLI; the docs still described it) — 1 file, 1 line
  2. docs: add See Also cross-links to tool and config pages #397 — docs: add See Also cross-links to explain_sql, health_check, and debug pages (all link targets verified to exist) — 3 files
  3. docs: add description frontmatter to 12 pages #398 — docs: add description frontmatter to 12 pages (Mintlify search/preview metadata only) — 12 files, 1 line each

I dropped the standalone pages (HTTP server, auth-token, SSH tunnel, API reference) per your note that keeping docs minimal is deliberate. Happy to adjust any of the three further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants