Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite
registry version 1.6.0
npm
npx -y @bytebase/dbhubnpm
npx -y @bytebase/dbhub@1.6.0
Pick your client — the config below is generated for this server (local stdio). Copy respects the “Pin version” switch above.
claude_desktop_config.json
{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DSN": "<YOUR_DSN>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>"
}
}
}
}{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub@1.6.0"
],
"env": {
"DSN": "<YOUR_DSN>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>"
}
}
}
}Format verified against the official Claude Desktop docs ↗.
terminal
claude mcp add --env DSN=<YOUR_DSN> --env DB_PASSWORD=<YOUR_DB_PASSWORD> dbhub -- npx -y @bytebase/dbhub
claude mcp add --env DSN=<YOUR_DSN> --env DB_PASSWORD=<YOUR_DB_PASSWORD> dbhub -- npx -y @bytebase/dbhub@1.6.0
Format verified against the official Claude Code docs ↗.
.cursor/mcp.json
{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DSN": "<YOUR_DSN>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>"
}
}
}
}{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub@1.6.0"
],
"env": {
"DSN": "<YOUR_DSN>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>"
}
}
}
}Format verified against the official Cursor docs ↗.
.vscode/mcp.json
{
"servers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DSN": "<YOUR_DSN>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>"
}
}
}
}{
"servers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub@1.6.0"
],
"env": {
"DSN": "<YOUR_DSN>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>"
}
}
}
}Format verified against the official VS Code docs ↗.
mcp_config.json
{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub"
],
"env": {
"DSN": "<YOUR_DSN>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>"
}
}
}
}{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": [
"-y",
"@bytebase/dbhub@1.6.0"
],
"env": {
"DSN": "<YOUR_DSN>",
"DB_PASSWORD": "<YOUR_DB_PASSWORD>"
}
}
}
}Format verified against the official Windsurf docs ↗.
Defined in the server's official registry manifest. Required secrets are shown as <YOUR_…> placeholders in the configs above.
DSN secret — Database connection string (e.g., postgres://user:pass@host:5432/db)DB_TYPE — Database type: postgres, mysql, mariadb, sqlserver, oracle, sqliteDB_HOST — Database hostnameDB_PORT — Database portDB_USER — Database usernameDB_PASSWORD secret — Database passwordDB_NAME — Database name or SQLite file pathTRANSPORT — Transport mode: stdio or httpOfficial · by Bytebase
Independent, non-official implementations of the DBHub MCP server maintained by the community.
Last verified: 2026-10-15 | Sources: Verification basis ↗
⭐ 3,652 stars · 最近更新于 29 天前 · MIT license
> [!NOTE] > If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase. > > > /> /> /> > > > > > > > > > > > > DBHub is a minimal MCP server: token-efficient, zero-dependency, and just two tools by default with opt-in extras. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases: Minimal : Zero dependency, token efficient with a minimal set of MCP tools to maximize context window Multi-Database : 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 > DBHub is the official example in the Claude Code docs for connecting to PostgreSQL via MCP. Token Efficiency DBHub loads just 2 tools by default at 1.4k tokens — 13-14x fewer than alternatives — keeping the context window open for your actual work. MCP Server Default Config Default Tools ------------ --------------- -------------- DBHub 1.4k 2 ( execute sql , search objects ) MCP Toolbox 19.0k 28 Supabase MCP 19.3k all 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 Supported Databases PostgreSQL, MySQL, SQL Server, MariaDB, Oracle, and SQLite. MCP Tools DBHub implements MCP tools for database operations: execute sql : Execute SQL queries with transaction support and safety controls search objects : Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure explain sql (opt-in): Show a query's execution plan without running it health check (opt-in): Report connection pool state and buffer cache hit ratio Custom Tools : Define reusable, parameterized SQL operations in your dbhub.toml configuration file Workbench DBHub includes a built-in web interface for interacting with your database tools. It provides a visual way to execute queries, run custom tools, and view request traces without requiring an MCP client. Installation Also available as: Docker image MCP Bundle (one-click install, read-only) Claude Code plugin See the Installation Guide for all options, Command-Line Options for parameters, and Multi-Database Configuration for connecting several databases at once. Development Requires Node.js >= 22.5.0 (DBHub uses the built-in node:sqlite module). See Testing and Debug. Contributors > /> > Star History > > /> /> /> > >…
Summary from the project README — github.com/bytebase/dbhub
Distributed as npm, listed under Databases. Review our MCP security guide before granting access to real data.
> [!NOTE] > If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase. > > > /> /> /> > > > > > > > > > > > > DBHub is a minimal MCP server: token-efficient, zero-dependency, and just two tools by default with opt-in extras. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases: Minimal : Zero dependency, token efficient with a minimal set of MCP tools to maximize context window Multi-Database : 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 > DBHub is the official example in the Claude Code docs for connecting to PostgreSQL via MCP. Token Efficiency DBHub loads just 2 tools by default at 1.4k tokens — 13-14x fewer than alternatives — keeping the context window open for your actual work. MCP Server Default Config Default Tools ------------ --------------- -------------- DBHub 1.4k 2 ( execute sql , search objects ) MCP Toolbox 19.0k 28 Supabase MCP 19.3k all 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 Supported Databases PostgreSQL, MySQL, SQL Server, MariaDB, Oracle, and SQLite. MCP Tools DBHub implements MCP tools for database operations: execute sql : Execute SQL queries with transaction support and safety controls search objects : Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure explain sql (opt-in): Show a query's execution plan without running it health check (opt-in): Report connection pool state and buffer cache hit ratio Custom Tools : Define reusable, parameterized SQL operations in your dbhub.toml configuration file Workbench DBHub includes a built-in web interface for interacting with your database tools. It provides a visual way to execute queries, run custom tools, and view request traces without requiring an MCP client. Installation Also available as: Docker image MCP Bundle (one-click install, read-only) Claude Code plugin See the Installation Guide for all options, Command-Line Options for parameters, and Multi-Database Configuration for connecting several databases at once. Development Requires Node.js >= 22.5.0 (DBHub uses the built-in node:sqlite module). See Testing and Debug. Contributors > /> > Star History > > /> /> /> > >
Run the install command shown above, then paste the config for your client (Claude Desktop, Claude Code, Cursor, VS Code or Windsurf) into its MCP settings and restart the client.
The MCP server itself is free to install. The source is public on https://github.com/bytebase/dbhub. Any third-party service it calls may require its own API key and account.
Any MCP-compatible client can use it, including Claude Desktop, Claude Code, Cursor, VS Code, Windsurf and custom agents.
Publish this server? Link back with a badge on your README or site — copy either snippet.
Markdown
[](https://mcpnav.net/server/dbhub/)
HTML
<a href="https://mcpnav.net/server/dbhub/"><img src="https://mcpnav.net/badge/dbhub.svg" alt="Listed on MCPNav" height="20"></a>