MCP ConfigsApr 6, 2026·2 min read

DBHub — Universal Database MCP Server, Zero Dependencies

Token-efficient database MCP server supporting Postgres, MySQL, MariaDB, SQL Server, and SQLite. Just two MCP tools, zero dependencies, read-only safe.

TO
TokRepo精选 · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

Run with npx (no install):

npx @bytebase/dbhub --transport http --port 8080 --dsn "postgres://user:pass@host/db"

Or try the demo instantly:

npx @bytebase/dbhub --transport http --port 8080 --demo

Add to your .mcp.json:

{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": ["@bytebase/dbhub", "--transport", "stdio", "--dsn", "postgres://user:pass@host/db"]
    }
  }
}

Intro

DBHub is a zero-dependency, token-efficient database MCP server with 2,500+ GitHub stars. It supports PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite with just two MCP tools — keeping your context window clean. Built-in safety features include read-only mode, row limiting, and query timeout. Created by Bytebase, the team behind the popular database DevOps platform.

Best for: developers who want AI agents to query and explore databases safely. Works with: Claude Code, Cursor, any MCP client. Setup time: under 1 minute.


DBHub — AI Meets Your Database

Supported Databases

Database Status
PostgreSQL
MySQL
MariaDB
SQL Server
SQLite

Why Only Two Tools?

Most database MCP servers expose dozens of tools, consuming precious context window tokens. DBHub takes a minimalist approach with just two tools, maximizing the space available for your actual queries and results.

Safety Features

  • Read-only mode — Prevent accidental writes
  • Row limiting — Cap result set sizes
  • Query timeout — Prevent runaway queries
  • SSL/TLS — Encrypted connections
  • SSH tunneling — Secure access to remote databases

Installation Options

# NPX (recommended)
npx @bytebase/dbhub --transport http --port 8080 --dsn "postgres://..."

# Docker
docker run --rm --init --name dbhub \
  --publish 8080:8080 bytebase/dbhub \
  --transport http --port 8080 --dsn "postgres://..."

# Multi-database via TOML config
npx @bytebase/dbhub --transport http --port 8080 --config databases.toml

Multi-Database Config

[[databases]]
name = "production"
dsn = "postgres://user:pass@prod-host/mydb"

[[databases]]
name = "analytics"
dsn = "mysql://user:pass@analytics-host/warehouse"

FAQ

Q: What is DBHub? A: DBHub is a zero-dependency database MCP server that connects AI agents to PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite using just two token-efficient MCP tools.

Q: Is DBHub free? A: Yes, DBHub is free and open source under the MIT license.

Q: Is it safe to connect AI to my database? A: DBHub includes read-only mode, row limits, and query timeouts to prevent accidental data modification or runaway queries.


🙏

Source & Thanks

Created by Bytebase. Licensed under MIT.

dbhub — ⭐ 2,500+

Thank you for making database access safe and efficient for AI agents.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets