mcpField
D
DBHub Analytics

DBHub Analytics

Local
github.com/amansingh63Databases0Updated 30w ago

About DBHub Analytics

DBHub Analytics is an open-source MCP server connecting AI assistants to cloud warehouses and relational databases through one interface. It combines schema browsing and SQL tools with read-only, row-limit, and timeout safeguards.

Key features

  1. 01Connect to seven database systems
  2. 02Connect to multiple databases from TOML
  3. 03Browse catalogs, schemas, and tables
  4. 04Run SQL with read-only and row limits
  5. 05Define reusable parameterized SQL tools
  6. 06Use SSH tunneling and SSL/TLS

Use cases

  1. 01Query Databricks or BigQuery for analytics
  2. 02Explore schemas and diagnose database issues
  3. 03Safely query production read replicas
  4. 04Compare insights across databases

MCP support

Exposes SQL execution, database-object search, and configurable custom tools to MCP clients. It connects to supported databases using DSNs or a multi-database TOML configuration.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"amansingh63-dbhub-analytics": {
"command": "npx",
"args": [
"-y",
"dbhub-analytics"
],
"env": {
"DSN": "<DSN>",
"DB_TYPE": "<DB_TYPE>",
"DB_HOST": "<DB_HOST>",
"DB_PORT": "<DB_PORT>",
"DB_USER": "<DB_USER>",
"DB_PASSWORD": "<DB_PASSWORD>",
"DB_NAME": "<DB_NAME>",
"TRANSPORT": "<TRANSPORT>",
"PORT": "<PORT>",
"ID": "<ID>",
"SSH_HOST": "<SSH_HOST>",
"SSH_PORT": "<SSH_PORT>",
"SSH_USER": "<SSH_USER>",
"SSH_PASSWORD": "<SSH_PASSWORD>",
"SSH_KEY": "<SSH_KEY>",
"SSH_PASSPHRASE": "<SSH_PASSPHRASE>"
}
}
}
}
Run commandnpx -y dbhub-analytics
Environment variables to set
DSNSecretDatabase connection string (e.g., postgres://user:pass@host:5432/db)
DB_TYPEDatabase type: postgres, mysql, mariadb, sqlserver, sqlite, databricks, bigquery
DB_HOSTDatabase hostname
DB_PORTDatabase port
DB_USERDatabase username
DB_PASSWORDSecretDatabase password
DB_NAMEDatabase name or SQLite file path
TRANSPORTTransport mode: stdio or http
PORTHTTP server port (default: 8080)
IDInstance identifier for tool names
SSH_HOSTSSH server hostname
SSH_PORTSSH server port (default: 22)
SSH_USERSSH username
SSH_PASSWORDSecretSSH password
SSH_KEYSecretPath to SSH private key
SSH_PASSPHRASESecretSSH key passphrase

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmdbhub-analytics0.2.0

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

DBHub Analytics

Universal Database MCP Server for Databricks, Google BigQuery, PostgreSQL, MySQL, SQL Server, SQLite, MariaDB

npm version License: MIT

Built on top of DBHub by Bytebase.

What is DBHub Analytics?

DBHub Analytics is an open-source MCP (Model Context Protocol) server that connects AI assistants like Claude Desktop, Claude Code, Cursor, VS Code Copilot, and other MCP-compatible clients to your databases. Query Databricks SQL warehouses, Google BigQuery datasets, PostgreSQL, MySQL, and more — all through a single unified interface.

            +------------------+    +--------------+    +------------------+
            |                  |    |              |    |                  |
            |  Claude Desktop  +--->+              +--->+    PostgreSQL    |
            |                  |    |              |    |                  |
            |  Claude Code     +--->+              +--->+    SQL Server    |
            |                  |    |    DBHub     |    |                  |
            |  Cursor          +--->+   Analytics  +--->+    SQLite        |
            |                  |    |              |    |                  |
            |  VS Code         +--->+              +--->+    MySQL         |
            |                  |    |              |    |                  |
            |  Copilot CLI     +--->+              +--->+    MariaDB       |
            |                  |    |              |    |                  |
            |                  |    |              +--->+    Databricks    |
            |                  |    |              |    |                  |
            |                  |    |              +--->+    BigQuery      |
            |                  |    |              |    |                  |
            +------------------+    +--------------+    +------------------+
                 MCP Clients           MCP Server             Databases

Key Features

  • Cloud Data Warehouses: Connect to Databricks SQL and Google BigQuery for analytics workloads
  • Traditional Databases: Full support for PostgreSQL, MySQL, MariaDB, SQL Server, SQLite
  • Multi-Database: Connect to multiple databases simultaneously with a single TOML config file
  • Schema Explorer: Progressive disclosure — browse catalogs, datasets, schemas, tables, and columns
  • Safety Guardrails: Read-only mode, row limits, and query timeouts to prevent runaway operations
  • Secure Access: SSH tunneling, SSL/TLS encryption, and service account authentication
  • Zero Config: Just provide a DSN — no drivers to install, no complex setup

Supported Databases

DatabaseDSN ProtocolStatus
PostgreSQLpostgres://Stable
MySQLmysql://Stable
MariaDBmariadb://Stable
SQL Serversqlserver://Stable
SQLitesqlite:///Stable
Databricks SQLdatabricks://Stable
Google BigQuerybigquery://Stable

MCP Tools

ToolDescription
execute_sqlExecute SQL queries with read-only enforcement and row limiting
search_objectsBrowse catalogs, schemas, tables, columns, indexes, and routines
Custom ToolsDefine reusable, parameterized SQL queries in dbhub.toml

Quick Start

NPM (recommended)
npx dbhub-analytics --dsn "postgres://user:password@localhost:5432/dbname"
Databricks SQL
npx dbhub-analytics --dsn "databricks://token:[email protected]/sql/2.0/warehouses/your_warehouse_id"
Google BigQuery
npx dbhub-analytics --dsn "bigquery://your-gcp-project/your_dataset?keyFile=/path/to/service-account.json&location=US"
Docker
docker run --rm --init \
   --name dbhub-analytics \
   --publish 8080:8080 \
   amansingh63/dbhub-analytics \
   --transport http \
   --port 8080 \
   --dsn "postgres://user:password@localhost:5432/dbname"
Demo Mode
npx dbhub-analytics --demo

Connect to Your AI Assistant

Claude Desktop / Claude Code

Add to your claude_desktop_config.json or .mcp.json:

{
  "mcpServers": {
    "dbhub-analytics": {
      "command": "npx",
      "args": ["-y", "dbhub-analytics", "--dsn", "bigquery://your-project/your_dataset?keyFile=/path/to/sa.json&location=US"]
    }
  }
}
GitHub Copilot (VS Code)

Add to your .vscode/mcp.json:

{
  "servers": {
    "dbhub-analytics": {
      "command": "npx",
      "args": ["-y", "dbhub-analytics", "--dsn", "postgres://user:pass@localhost:5432/dbname"]
    }
  }
}
Cursor

Add to your Cursor MCP settings (~/.cursor/mcp.json):

{
  "mcpServers": {
    "dbhub-analytics": {
      "command": "npx",
      "args": ["-y", "dbhub-analytics", "--dsn", "databricks://token:YOUR_TOKEN@host/sql/2.0/warehouses/ID"]
    }
  }
}
Windsurf

Add to your Windsurf MCP config (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "dbhub-analytics": {
      "command": "npx",
      "args": ["-y", "dbhub-analytics", "--dsn", "mysql://user:pass@localhost:3306/dbname"]
    }
  }
}
Multi-Database via TOML Config

For connecting to multiple databases, use a TOML config file with any of the above clients:

{
  "mcpServers": {
    "dbhub-analytics": {
      "command": "npx",
      "args": ["-y", "dbhub-analytics", "--config", "/path/to/dbhub.toml"]
    }
  }
}

Configuration

DSN Connection Strings
DatabaseFormat
PostgreSQLpostgres://user:pass@host:5432/dbname?sslmode=require
MySQLmysql://user:pass@host:3306/dbname
MariaDBmariadb://user:pass@host:3306/dbname
SQL Serversqlserver://user:pass@host:1433/dbname
SQLitesqlite:///path/to/file.db or sqlite:///:memory:
Databricksdatabricks://token:TOKEN@host/sql/2.0/warehouses/ID?catalog=CAT&schema=SCH
BigQuerybigquery://PROJECT_ID/DATASET?keyFile=/path/to/key.json&location=US
Multi-Database Setup (TOML)

Connect to multiple databases simultaneously. Create a dbhub.toml file:

[[sources]]
id = "databricks_prod"
type = "databricks"
host = "adb-xxx.azuredatabricks.net"
password = "dapi..."
path = "/sql/2.0/warehouses/abc123"

[[sources]]
id = "bigquery_analytics"
type = "bigquery"
project = "my-gcp-project"
database = "analytics_dataset"
location = "US"

[[sources]]
id = "postgres_prod"
type = "postgres"
host = "localhost"
port = 5432
database = "production"
user = "dbuser"
password = "secret"

Then run:

npx dbhub-analytics --config dbhub.toml

See Multi-Database Configuration and Command-Line Options for complete documentation.

Use Cases

  • Data Analysts: Ask Claude to query your Databricks or BigQuery data warehouse in natural language
  • Backend Engineers: Explore database schemas, run diagnostic queries, and debug issues via AI
  • DevOps/SRE: Connect to production read-replicas safely with read-only mode and row limits
  • Data Scientists: Query multiple databases simultaneously — join insights across PostgreSQL and BigQuery

Development

# Install dependencies
pnpm install

# Run in development mode
pnpm dev

# Build for production
pnpm build

# Run tests
pnpm test

Credits

Built on top of DBHub by Bytebase, an open-source database DevSecOps platform. Licensed under MIT.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.