Back to MCP Catalog

DBHub Universal Database Gateway MCP Server

DatabasesTypeScript
Universal database gateway connecting to multiple database systems
Available Tools

execute_sql

Execute SQL queries against the connected database

list_connectors

List available database connectors and their status

generate_sql

Generate SQL queries based on natural language descriptions

explain_db

Explain database elements and structures

DBHub is a universal database gateway that implements the Model Context Protocol (MCP) server interface. It enables MCP-compatible clients like Claude Desktop and Cursor to connect to and explore different database systems including PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, and Oracle. This gateway allows AI assistants to directly query databases, explore schema information, and execute SQL commands.

Overview

DBHub serves as a bridge between MCP-compatible clients and various database systems. It allows AI assistants to interact with databases directly, providing capabilities for schema exploration, SQL execution, and database structure analysis.

Installation Options

Using Docker (Recommended)

The easiest way to run DBHub is using Docker:

# Basic example for PostgreSQL
docker run --rm --init \
   --name dbhub \
   --publish 8080:8080 \
   bytebase/dbhub \
   --transport sse \
   --database-url "postgresql://username:password@host:port/database"

For other database types, use the appropriate connection string format:

  • MySQL/MariaDB: mysql://username:password@host:port/database
  • SQL Server: sqlserver://username:password@host:port/database
  • SQLite: sqlite:///path/to/database.db
  • Oracle: oracle://username:password@host:port/service

Manual Installation

  1. Clone the repository:

    git clone https://github.com/bytebase/dbhub.git
    cd dbhub
    
  2. Install dependencies:

    npm install
    # or
    pnpm install
    
  3. Create a .env file based on the example:

    cp .env.example .env
    # Edit the .env file with your database connection details
    
  4. Start the server:

    npm start
    # or
    pnpm start
    

Configuration Options

DBHub supports several configuration options:

  • --port: Port to listen on (default: 8080)
  • --host: Host to bind to (default: 0.0.0.0)
  • --transport: Transport protocol (sse or websocket, default: sse)
  • --database-url: Database connection string
  • --database-type: Database type (postgresql, mysql, mariadb, sqlserver, sqlite, oracle)
  • --debug: Enable debug logging

Using with MCP Clients

Once DBHub is running, you can connect to it from any MCP-compatible client:

  1. In Claude Desktop, go to Settings > Model Context Protocol > Add Server
  2. In Cursor, configure the MCP server in your settings
  3. For other clients, refer to their specific documentation for adding MCP servers

The default endpoint will be: http://localhost:8080/sse for SSE transport or ws://localhost:8080/ws for WebSocket transport.

Demo Endpoint

For testing purposes, you can use the demo endpoint at https://demo.dbhub.ai/sse which connects to a sample employee database.

Security Considerations

  • DBHub has full access to your database, so ensure you're using appropriate credentials with the minimum required permissions
  • Consider running DBHub behind a reverse proxy with authentication if exposing it beyond your local network
  • Database credentials are passed in the connection string, so ensure secure transmission and storage of these details

Related MCPs

Milvus Vector Database
DatabasesPython

Connect to Milvus vector database for semantic search and vector operations

MotherDuck DuckDB
DatabasesPython

SQL analytics with DuckDB and MotherDuck for AI assistants

Alibaba Cloud Tablestore
DatabasesJava, Python

Connect to Alibaba Cloud Tablestore for vector search and RAG applications

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.