MCP/DBHub (Bytebase)
DBHub (Bytebase) logo

DBHub (Bytebase)

Verified Golden (1000+ GitHub stars)

Token-conscious universal database MCP server for Postgres, MySQL, SQLite, SQL Server, Oracle, and MariaDB.

rag-data•Databases & Storage
GitHub3.7k
License:MIT
VERIFIED

About this Server

DBHub by Bytebase is a token-conscious Model Context Protocol (MCP) server that consolidates database access for AI coding assistants. Supporting PostgreSQL, MySQL, SQLite, SQL Server, Oracle, and MariaDB, DBHub provides schema exploration, safe query execution with transactions, EXPLAIN query planning, and connection health diagnostics while preserving LLM context windows through progressive schema disclosure.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

Read-Only Roles: Connect agents using read-only database user credentials whenever modifying data is not required.
DSN Secret Handling: Store sensitive connection strings in client environment variables rather than plaintext config files.
Transaction Guardrails: Automatic query timeouts and row caps prevent runaway queries from exhausting memory or locks.

When to Use (and When Not To)

Best For
  • •Local schema exploration, SQL query generation, and query debugging across multi-database environments
  • •Diagnosing slow query plans with EXPLAIN before pushing changes to production
  • •Consolidating multiple database MCP servers (Postgres, MySQL, SQLite, Oracle) into a single unified process
Not For / Limitations
  • •Vector embedding similarity search across high-dimensional vectors (use Chroma MCP instead)
  • •Document and website web scraping (use Firecrawl MCP instead)
  • •Public package and SDK documentation lookups (use Context7 MCP instead)

Install & Setup

terminal command
$claude mcp add dbhub -- npx -y @bytebase/dbhub@latest --transport stdio --dsn "$DATABASE_URL"

Exposed Tools & Endpoints

4 tools

Functions your AI agent can invoke via this Model Context Protocol server

execute_sql

Executes SQL queries with transaction rollback support, row limits, and runaway query safety controls.

search_objects

Explores database schemas, tables, columns, indexes, and procedures using progressive disclosure to save tokens.

explain_sql

Generates query execution plans without running the query to analyze index usage and query cost.

health_check

Reports database connection pool status, active connections, and buffer cache hit ratio.