bytebase/dbhub

Token conscious database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.

What it solves

DBHub is a lightweight gateway that allows AI agents and MCP-compatible clients (like Claude Desktop, Cursor, and VS Code) to connect to and explore various databases without consuming excessive context window tokens. It simplifies multi-database management by replacing the need for separate servers for each database type.

How it works

It acts as a Model Context Protocol (MCP) server that interfaces between AI clients and databases such as PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite. It provides a minimal set of core tools—execute_sql and search_objects—to keep token usage low, with optional tools for query explanation and health checks. It also includes a built-in web workbench for visual interaction and supports secure access via SSH tunneling and SSL/TLS encryption.

Who it’s for

  • Developers performing schema exploration, query validation, and data debugging during local development.
  • Non-technical staff who need access to curated, read-only views of database data via AI interfaces.
  • Database administrators performing read-only diagnostics and production troubleshooting with built-in guardrails.

Highlights

  • Token Efficient: Uses significantly fewer tokens (1.4k) than alternative MCP servers to maximize the AI's context window.
  • Multi-Database Support: A single interface for PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite.
  • Safety Guardrails: Includes read-only mode, row limiting, and query timeouts to prevent runaway operations.
  • Custom Tools: Allows users to define reusable, parameterized SQL operations in a configuration file.
  • Secure Access: Supports SSH tunneling and SSL/TLS encryption.

Related

  • Project
  • Project
  • Project
  • Project
  • Project