dbhub
Token conscious database MCP server for Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite.
What is dbhub?
Token conscious database MCP server for Postgres, MySQL, SQL Server, Oracle, MariaDB, SQLite.
Overview of dbhub
What it is
DBHub is a minimal MCP server for databases. It is token-efficient, zero-dependency, and provides two tools by default with opt-in extras. It allows MCP-compatible clients to connect to and explore different databases. DBHub is the official example in the Claude Code documentation for connecting to PostgreSQL via MCP.
Key features
- Minimal: Zero dependency, token efficient with a minimal set of MCP tools to maximize context window.
- Multi-Database: Supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, and SQLite through a single interface.
- Multi-Connection: Connect to multiple databases simultaneously with TOML configuration.
- Guardrails: Read-only mode, row limiting, and query timeout to prevent runaway operations.
- Secure Access: SSH tunneling and SSL/TLS encryption.
- Token Efficiency: Loads just 2 tools by default at 1.4k tokens — 13-14x fewer than alternatives.
- Built-in Workbench: A web interface for executing queries, running custom tools, and viewing request traces.
Use cases
- Local Development: Schema exploration, query validation, and data debugging with Claude Code, VS Code, Cursor, etc.
- Non-Technical Access: Expose curated, read-only views to non-technical staff via Claude Desktop, VS Code, Cursor, etc.
- Multi-Database Consolidation: Replace separate MCP servers for each database with a single DBHub process.
- Production Troubleshooting: Read-only diagnostics with guardrails against runaway queries.
Getting started
Install and run with npx:
npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
DBHub is also available as a Docker image, MCP Bundle (one-click install, read-only), and Claude Code plugin. For development, requires Node.js >= 22.5.0. See the repository README for full installation options.
License and pricing
License: MIT. Pricing: open source (free).
Based on the project's public README and repository metadata.