DBHub Analytics

io.github.amansingh63由 GitHub 账号 amansingh63 发布v0.2.0更新于 Oct 24, 2026

MCP server for Databricks, BigQuery, PostgreSQL, MySQL, SQL Server, SQLite, MariaDB

已验证STDIO仅桌面数据库数据与分析

概览

AI 生成的概览

让 AI 助手通过统一接口在 PostgreSQL、MySQL、MariaDB、SQL Server、SQLite、Databricks 和 BigQuery 上执行 SQL 并浏览结构。

可以做什么
DBHub Analytics 是一个本地 MCP 服务器,把 MCP 客户端连接到一个或多个数据库。主要工具是 execute_sql,在只读限制和行数限制下执行 SQL,以及 search_objects,用于浏览 catalog、schema、表、列、索引和例程。可在 dbhub.toml 中定义可复用的参数化查询作为自定义工具,并支持同时配置多个数据库。
适用场景
适合让助手直接查询或探索数据库的场景,例如用自然语言查询 Databricks 或 BigQuery 数据仓库、查看表结构,或对只读副本运行诊断查询。也适合希望用一个服务器覆盖多种数据库引擎的团队。
运行要求
通过 npx(Node.js)或 Docker 在本地运行。需要每个数据库的连接信息:DSN,或 DB_HOST、DB_PORT、DB_NAME、DB_USER、DB_PASSWORD 以及 DB_TYPE。Databricks 和 BigQuery 需要令牌或服务账号密钥文件;SSH 隧道需要 SSH_HOST、SSH_PORT、SSH_USER 以及密钥或密码。需要能访问数据库的网络。
安装前请注意
该服务器会接触数据库凭据:DSN、DB_PASSWORD、SSH_PASSWORD、SSH_PASSPHRASE 和 SSH_KEY,DSN 中可能内嵌密码或 Databricks 令牌。虽然提供只读模式和行数限制,execute_sql 仍可对生产数据执行查询,建议指向只读副本或受限账号,并在使用前确认只读设置。

安装

在 SourceWeft 中

  1. 打开 控制台中的 DBHub Analytics,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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)

bash
npx dbhub-analytics --dsn "postgres://user:password@localhost:5432/dbname"

Databricks SQL

bash
npx dbhub-analytics --dsn "databricks://token:[email protected]/sql/2.0/warehouses/your_warehouse_id"

Google BigQuery

bash
npx dbhub-analytics --dsn "bigquery://your-gcp-project/your_dataset?keyFile=/path/to/service-account.json&location=US"

Docker

bash
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

bash
npx dbhub-analytics --demo

Connect to Your AI Assistant

Claude Desktop / Claude Code

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

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:

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):

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):

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:

json
{  "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:

toml
[[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 = 5432database = "production"user = "dbuser"password = "secret"

Then run:

bash
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

bash
# Install dependenciespnpm install
# Run in development modepnpm dev
# Build for productionpnpm build
# Run testspnpm test

Credits

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

来源:README.md,提交 3888599

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分