DBHub Analytics
Universal Database MCP Server enabling AI assistants to connect and query multiple databases including Databricks, BigQuery, PostgreSQL, MySQL, SQL Server, SQLite, and MariaDB through a unified interface.
README
<p align="center"> <h1 align="center">DBHub Analytics</h1> <p align="center">Universal Database MCP Server for Databricks, Google BigQuery, PostgreSQL, MySQL, SQL Server, SQLite, MariaDB</p> </p>
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
| Database | DSN Protocol | Status |
|---|---|---|
| PostgreSQL | postgres:// |
Stable |
| MySQL | mysql:// |
Stable |
| MariaDB | mariadb:// |
Stable |
| SQL Server | sqlserver:// |
Stable |
| SQLite | sqlite:/// |
Stable |
| Databricks SQL | databricks:// |
Stable |
| Google BigQuery | bigquery:// |
Stable |
MCP Tools
| Tool | Description |
|---|---|
execute_sql |
Execute SQL queries with read-only enforcement and row limiting |
search_objects |
Browse catalogs, schemas, tables, columns, indexes, and routines |
| Custom Tools | Define 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:YOUR_TOKEN@your-workspace.cloud.databricks.com/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
| Database | Format |
|---|---|
| PostgreSQL | postgres://user:pass@host:5432/dbname?sslmode=require |
| MySQL | mysql://user:pass@host:3306/dbname |
| MariaDB | mariadb://user:pass@host:3306/dbname |
| SQL Server | sqlserver://user:pass@host:1433/dbname |
| SQLite | sqlite:///path/to/file.db or sqlite:///:memory: |
| Databricks | databricks://token:TOKEN@host/sql/2.0/warehouses/ID?catalog=CAT&schema=SCH |
| BigQuery | bigquery://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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。