Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

DBHub

MCP server by bytebase Community

Connects MCP clients such as Claude Desktop, Cursor and VS Code to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It exposes two tools by default, with read-only mode and query timeouts available as guardrails.

  • Score 94
  • 4k stars
  • 343k a week
  • MIT
  • Updated

Install DBHub

Built from the published package, never by AI.

claude mcp add dbhub -- npx -y @bytebase/dbhub

Run in your terminal. Add --scope user to use it in every project.

Step-by-step: install DBHub in Claude Code

MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the dbhub block.

About

DBHub is an MCP server that lets MCP-compatible clients connect to and explore several databases through one interface. It supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It can connect to multiple databases at once using TOML configuration, and it supports SSH tunneling and SSL/TLS encryption.

The server is designed to keep the context window small. Its two built-in tool definitions total 261 tokens with the cl100k_base tokenizer, according to the project. Guardrails include read-only mode, row limiting and query timeouts. A built-in web Workbench is also included. The project is aimed at local development, read-only access for non-technical staff, consolidating several database servers, and production troubleshooting.

Written from the project's README and checked against it.

Tools it gives your assistant

  • execute_sqlExecutes SQL queries with transaction support and safety controls.
  • search_objectsSearches schemas, tables, columns, indexes and procedures with progressive disclosure.
  • explain_sqlShows a query's execution plan without running it. Opt-in.
  • health_checkReports connection pool state and buffer cache hit ratio. Opt-in.
  • Custom ToolsDefines reusable, parameterized SQL operations in a dbhub.toml file.

What you need

  • Node.js 22.5.0 or later
  • A database connection string (DSN)
SettingNeededWhat it is
DSNEnvironment variable, secretOptionalDatabase connection string (e.g., postgres://user:pass@host:5432/db)
DB_TYPEEnvironment variableOptionalDatabase type: postgres, mysql, mariadb, sqlserver, oracle, clickhouse, sqlite
DB_HOSTEnvironment variableOptionalDatabase hostname
DB_PORTEnvironment variableOptionalDatabase port
DB_USEREnvironment variableOptionalDatabase username
DB_PASSWORDEnvironment variable, secretOptionalDatabase password
DB_NAMEEnvironment variableOptionalDatabase name or SQLite file path
TRANSPORTEnvironment variableOptionalTransport mode: stdio or http
PORTEnvironment variableOptionalHTTP server port (default: 8080)
IDEnvironment variableOptionalInstance identifier for tool names
SSH_HOSTEnvironment variableOptionalSSH server hostname
SSH_PORTEnvironment variableOptionalSSH server port (default: 22)
SSH_USEREnvironment variableOptionalSSH username
SSH_PASSWORDEnvironment variable, secretOptionalSSH password
SSH_KEYEnvironment variableOptionalPath to SSH private key
SSH_PASSPHRASEEnvironment variable, secretOptionalSSH key passphrase
SSH_AUTH_SOCKEnvironment variableOptionalPath to SSH agent socket

From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.

Try asking

  • Use DBHub to list the tables and columns in my orders database.
  • Run a query on the customers table and check the results for duplicates.
  • Show the execution plan for this SQL query without running it.

Good to know

  • Read-only mode is a guardrail, not a permission boundary. The source recommends a least-privilege, read-only database user.
  • With --dsn alone, execute_sql can write. A TOML config with readonly = true is needed to keep it read-only.
  • explain_sql and health_check are opt-in.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to DBHub

All alternatives →
Supabase supabase
97

Connects Supabase projects to AI assistants such as Cursor, Claude and Windsurf over the Model Context Protocol. It lets assistants manage tables, fetch config and query data in a Supabase project.

AAA Local and remote 172k/wk
ArcadeDB MCP Server ArcadeData
94

ArcadeDB MCP Server is the built-in Model Context Protocol server of the ArcadeDB multi-model database. It lets AI assistants and LLMs work with ArcadeDB's graph, document, time-series, vector and other data models. It suits people who already run ArcadeDB and want assistant access to it.

AAA Local 1.3k
MCP Toolbox for Databasesgoogleapis
94

MCP Toolbox for Databases is an open source MCP server that connects AI agents, IDEs and applications to enterprise databases. It provides prebuilt tools for exploring schemas and running queries, plus a framework for custom tools. It is aimed at developers building agents that need database access.

AAA Local 17k
MCP Toolbox for Databasesgoogleapis
94

Connects AI agents, IDEs and applications to enterprise databases through the Model Context Protocol. Offers prebuilt database tools for MCP clients and a framework for building custom tools for production agents.

AAA Local 17k
mongodb-mcp-servermongodb-js
94

MongoDB MCP Server lets AI assistants interact with MongoDB databases and MongoDB Atlas. It is an official server from mongodb-js, run locally with npx or Docker. It works with self-managed deployments and Atlas clusters.

AAA Local 203k/wk
dbxt8y2
94

Query databases from AI coding agents using the connections already set up in DBX. The dbx MCP server suits developers who use Claude Code, Cursor, Windsurf, or another MCP-compatible agent.

AAA Local 32k

Compare with Supabase, ArcadeDB MCP Server or MCP Toolbox for Databases

DBHub: common questions

Which databases does DBHub support?

The source lists PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite.

Can DBHub replace @modelcontextprotocol/server-postgres?

The source describes DBHub as a maintained replacement for the archived reference PostgreSQL server. An existing postgresql:// URL works unchanged with --dsn.

Does DBHub offer approval flows or data masking?

The source says enterprise guardrails such as approval flow, access control, data masking and audit logging are beyond what DBHub offers. It points users to Bytebase for those features.

How do I install DBHub?

In Claude Code run claude mcp add dbhub -- npx -y @bytebase/dbhub. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.

Is DBHub the official server?

DBHub is a community project by bytebase, not verified by a company domain.

Is DBHub free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is DBHub safe to use?

It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to DBHub?

Similar MCP servers: Supabase, ArcadeDB MCP Server, MCP Toolbox for Databases, MCP Toolbox for Databases.

Does DBHub work with ChatGPT?

Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.

Add to stack

Loading.