DBHub MCP server
DBHub is an open-source MCP server by Bytebase that gives AI agents SQL access to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite through one server with two default tools.
Checked by CookiesForAI on : repository facts (stars, last push, archived) re-read from GitHub; listing in the MCP Registry checked.
Written by
Connect DBHub
Claude Code, as a plugin (prompts for the connection string and stores it securely)
/plugin marketplace add bytebase/dbhubThen install the plugin
/plugin install dbhub@dbhubCodex, trying the built-in demo database first
codex mcp add dbhub -- npx @bytebase/dbhub@latest --transport stdio --demoRun as an HTTP server for any client (add your own --dsn instead of --demo)
npx @bytebase/dbhub@latest --transport http --port 8080 --demoPass your database with --dsn, for example a postgres:// URI with user and password, or keep several connections in a dbhub.toml file and use --config. From Docker, use host.docker.internal instead of localhost to reach a database on your machine.
Or paste this into your coding agent: Connect the DBHub MCP server to my coding agent using its documented setup: https://github.com/bytebase/dbhub. Checked by CookiesForAI on : repository facts (stars, last push, archived) re-read from GitHub; listing in the MCP Registry checked.
Your first question with this server installed
DBHubTool list 274One answer 972 tools listed without a key
Typical serverFirst question 2,022 (median of 10 servers)
DBHub's first question takes 371 tokens: its tool list plus one answer. That is about 18% of the median first question of the 10 servers we measured with both numbers on (2,022 tokens).
Measured without a key or sign-in. Assistants that load every tool send this list to the model with each question; some load tools only when a task needs them. The one answer is from execute_sql, a fixed read-only call. Our page names 4 of its tools, so set up as its maker documents, it can list more than we measured. Tokens are counted with OpenAI's o200k tokenizer; other models count a little differently.
Measured . How we measure.
What the DBHub MCP server does
DBHub is a database MCP server from Bytebase, the company behind a database DevOps platform. One DBHub process connects an AI agent to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle or SQLite, and a TOML file lets it hold several connections at once, for example a local dev database and a read-only replica. It supports SSH tunnels and SSL for databases behind a bastion host.
DBHub keeps its default tool list to two: execute_sql runs queries with transaction support, and search_objects explores schemas, tables, columns, indexes and procedures a step at a time. Bytebase measures this at about 1,400 tokens of context, against roughly 19,000 for some alternatives. Two opt-in tools show a query plan and report connection pool health, and you can define your own parameterized SQL tools in the config file. A built-in web workbench runs the same tools without an MCP client.
Guardrails include a read-only mode, a row limit and a query timeout. DBHub runs through npx (Node.js 22.5 or newer), Docker, an MCP Bundle file or a Claude Code plugin; the bundle and plugin are read-only by design. Claude Code's own docs use DBHub as the example for querying PostgreSQL. The repo had 3,589 GitHub stars on .
Tools it gives your agent
execute_sqlsearch_objectsexplain_sqlhealth_check
When to use DBHub
- You work with more than one database engine and want a single MCP server for all of them.
- You want the agent to explore an unfamiliar schema without filling its context with tool definitions.
- You want to give non-technical teammates read-only views of data through Claude Desktop or VS Code.
- You need to reach a database behind an SSH bastion host.
When to pick something else
- Deep Postgres tuning such as index recommendations and health reports; Postgres MCP Pro specializes in that.
- Write access on production without care: unless read-only mode is on, execute_sql can change data.
What DBHub needs
- Node.js 22.5 or newer, or Docker
- A database connection string (DSN)
What the DBHub MCP server costs
Free and open source under MIT and run on your own machine, with no paid tier; Bytebase's enterprise product is separate.
Questions people ask
Is DBHub free?
Yes. DBHub is open source under MIT and runs on your own machine with no paid tier.
Which databases does DBHub support?
PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite (README read ). SQLite needs no extra driver because DBHub uses Node's built-in module.
Other MCP servers for databases
- MongoDB: The MongoDB MCP server gives AI agents access to MongoDB databases and MongoDB Atlas: run find and aggregate queries, inspect schemas and indexes, and create or manage Atlas clusters and users.
- Neon: The Neon MCP server gives AI agents control of Neon serverless Postgres: create projects and branches, run SQL, inspect schemas, find slow queries and run migrations on a branch before applying them.
- Postgres MCP Pro: Postgres MCP Pro is an open-source MCP server that gives AI agents access to a PostgreSQL database, with schema browsing, safe SQL execution, EXPLAIN plans, index recommendations and database health checks.
- Qdrant: The Qdrant MCP server gives AI agents semantic memory in a Qdrant collection, with tools to store information and retrieve relevant entries through natural-language queries.