DB-MCP
An MCP server that bridges AI assistants with data warehouses through Cube.js to enable governed, natural language semantic analytics queries. It provides tools for metadata discovery and secure query execution while enforcing governance policies like PII blocking and access limits.
README
DB-MCP
A Model Context Protocol (MCP) server that provides governed semantic analytics queries through Cube.js.
What is this?
DB-MCP acts as a bridge between AI assistants and your data warehouse, enabling natural language queries while enforcing governance policies. It exposes your Cube.js semantic layer as MCP tools that AI models can use safely.
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ AI Assistant │────▶│ DB-MCP │────▶│ Cube.js │
│ (Claude, etc) │◀────│ MCP Server │◀────│ Semantic Layer │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
│ ▼
│ ┌─────────────────┐
│ │ Data Warehouse │
│ │ (Postgres, etc) │
│ └─────────────────┘
▼
┌─────────────────┐
│ Governance Layer │
│ - Query limits │
│ - PII blocking │
│ - Member access │
└─────────────────┘
Components
MCP Server (/src)
-
Tools exposed via MCP:
catalog.search- Search available measures, dimensions, segmentscatalog.describe- Get details about a specific memberquery.semantic- Execute governed queries against the semantic layer
-
Governance (
/src/policy) - Enforces limits, blocks PII, validates members -
Catalog (
/src/catalog) - Indexes Cube metadata with fuzzy search -
Query (
/src/query) - Executes validated queries through Cube.js
Admin UI (/admin)
- Backend (
/admin/backend) - Express API for management - Frontend (
/admin/frontend) - React admin dashboard with:- Database schema browser
- Governance configuration
- Query playground
- AI chat interface (uses MCP tools)
Cube.js (/cube)
- Semantic layer definitions (cubes, measures, dimensions)
- Connects to your data warehouse
Quick Start
# Start infrastructure (Postgres, Cube.js)
docker-compose up -d
# Install and build MCP server
npm install
npm run build
# Start admin backend (port 3000)
cd admin/backend && npm install && npm run dev
# Start admin frontend (port 3001)
cd admin/frontend && npm install && npm run dev
Configuration
Copy .env.example to .env and configure:
CUBE_API_URL=http://localhost:4000/cubejs-api/v1
CUBE_JWT_SECRET=your-secret-min-32-chars
MAX_LIMIT=1000
DENY_MEMBERS=Users.email,Users.ssn
MCP Integration
Use with Claude Desktop or any MCP-compatible client:
{
"mcpServers": {
"db-mcp": {
"command": "node",
"args": ["/path/to/db-mcp/dist/index.js"],
"env": {
"CUBE_API_URL": "http://localhost:4000/cubejs-api/v1",
"CUBE_JWT_SECRET": "your-secret"
}
}
}
}
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.