SuperAPIAI Directory

dbhub

github.com · Other AI tools

DBHub is an MCP server for databases that supports PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, SQLite, and ClickHouse. It is designed with the principles of being minimal, zero-dependency, and token-efficient, providing only two MCP tools by default, with additional tools enabled through configuration. DBHub allows MCP-compatible clients to connect to and explore a variety of databases, supporting multiple connections, read-only mode, row limits, query timeouts, and other safeguards, as well as SSH tunneling and SSL/TLS encryption. It is suitable for scenarios such as local development, access by non-technical users, multi-database consolidation, and production troubleshooting.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

DBHub is a minimal MCP server designed to provide database access to MCP-compatible clients in a token-efficient manner. It is zero-dependency, includes only two MCP tools by default, and can optionally enable additional tools through configuration, thereby maximizing the utilization efficiency of the context window.

Key capabilities:

  • Multi-database support: Connect to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse, and SQLite through a single interface.
  • Multiple connections: Connect to multiple databases simultaneously using a TOML configuration file.
  • Safeguards: Provide read-only mode, row limits, and query timeouts to prevent runaway operations.
  • Secure access: Support SSH tunneling and SSL/TLS encryption.
  • Built-in tools: execute_sql (execute SQL queries, with transaction and safety controls), search_objects (search and explore database schemas, tables, columns, indexes, and stored procedures, with progressive disclosure support); optional tools include explain_sql (show the query execution plan without running the query) and health_check (report connection pool status and buffer cache hit ratio).
  • Custom tools: Define reusable, parameterized SQL operations in the dbhub.toml configuration file.
  • Built-in web interface: Provide a visual way to execute queries, run custom tools, and view request traces without an MCP client.

Usage: DBHub requires Node.js >= 22.5.0 (using the built-in node:sqlite module). It can be installed with one click via MCP Bundle (read-only), or refer to the installation guide for other installation methods. For Claude Code and Codex, plugins can be installed (Codex reads the connection string from DBHUB_DSN). The connection string is passed via the --dsn parameter, and existing postgresql:// URLs can be used directly. If read-only mode is needed, point --config to a TOML file with readonly = true set.

Applicable scenarios:

  • Local development: Work with tools such as Claude Code, VS Code, and Cursor for schema exploration, query validation, and data debugging.
  • Non-technical access: Expose to non-technical users through Claude Desktop, VS Code, Cursor, etc.A carefully curated read-only view.
  • Multi-database consolidation: Replace separate MCP servers for each database with a single DBHub process.
  • Production troubleshooting: Use read-only diagnostics and safeguards to prevent runaway queries.

Limitations: Read-only mode is a safeguard rather than a permission boundary; you should always connect using a least-privilege read-only database user. DBHub is the maintained replacement for @modelcontextprotocol/server-postgres, which has been archived and is no longer maintained.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools