@databrainhq/mcp-server v0.2.0 — available on npm. Requires Node.js 18+.How It Works
You describe what you want
Tell your AI assistant what you need — embed a dashboard, query data, customize theming, or anything else.
MCP server translates to API calls
The server (
@databrainhq/mcp-server) maps your request to the right Databrain API operations, manages authentication, and validates inputs.MCP Server vs NPM Plugin
Databrain offers two integration paths. Choose based on your workflow:| MCP Server | NPM Plugin (@databrainhq/plugin) | |
|---|---|---|
| Best for | Setting up and configuring embeds via AI assistant | Rendering embeds in your frontend |
| How it works | Natural language in Cursor, Claude, Windsurf | Web components (<dbn-dashboard>, <dbn-metric>) |
| What it does | Creates embeds, manages tokens, configures themes/filters, queries data, generates frontend code | Renders dashboards and metrics in the browser |
| When you use it | During development and setup | At runtime in your application |
They’re complementary, not competing. Use the MCP server to set up and configure your embeds, then use the NPM plugin to render them in your app. The MCP server even generates the plugin code for you via
generate_embed_code.Key Capabilities
Embed Dashboards
Discover data apps, select dashboards, create embeds, and generate framework-specific frontend code — all through conversation.
Query Your Data
Ask questions in natural language. The AI converts them to SQL, runs the query, and returns results with chart type suggestions.
Brand & Theme
Customize colors, fonts, chart styles, responsive breakpoints, and card styling to match your product.
Multi-Tenant Embeds
Create per-client dashboard embeds with row-level security. Each customer sees only their data.
Self-Serve Analytics
Enable end-users to build their own metrics with drag-and-drop or AI-powered chat mode.
Semantic Layer
Populate and maintain table/column descriptions, synonyms, and example questions to improve natural language query accuracy.
Supported AI Clients
The server uses stdio transport and works with any MCP-compatible client:- Cursor — IDE with built-in MCP support
- Claude Desktop — Anthropic’s desktop app
- Claude Code — CLI tool for developers
- Windsurf — Codeium’s AI IDE
- Any MCP client — Any tool that supports the Model Context Protocol
What’s Included
The server ships with 24 tools, 10 guided prompts, and 11 built-in knowledge resources.Infrastructure creation (datasources, datamarts, workspaces) is done in the Databrain UI. The MCP server handles everything from embedding onward — plus the semantic layer, which is populated entirely via MCP tools.
Built-in Knowledge Resources
The server bundles reference documentation that your AI assistant reads automatically when needed — you don’t have to provide context manually.View all 11 resources
View all 11 resources
| Resource | Content |
|---|---|
| Getting Started | Entity model, onboarding checklist, token types |
| API Reference | All Databrain API endpoints |
| Embedding Guide | Framework-specific code (React, Next.js, Vue, Angular, Svelte, vanilla JS) |
| Theme Reference | Full theme schema — admin theme, component theme, chart appearance |
| Web Component Reference | All <dbn-dashboard> and <dbn-metric> attributes |
| Filter Reference | Filter types, operators, server-side filters |
| Self-Serve Reference | Permission flags, metric creation modes |
| Semantic Layer Guide | AI-powered metric creation setup |
| Multi-Tenancy Guide | Row-level security, clientId patterns, tenant isolation |
| Use Case Guides | Decision guide for choosing the right setup path |
| Permission Schema | Embed accessSettings, guest token permissions, precedence rules |
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
DATABRAIN_SERVICE_TOKEN | Yes | — | Org-level token from Settings → Service Tokens. Powers all discovery and setup operations. |
DATABRAIN_API_TOKEN | No | — | Per-data-app token. Created automatically during setup via create_api_token, or set manually if you already have one. |
DATABRAIN_API_URL | No | https://api.usedatabrain.com | API base URL. Only change this for self-hosted Databrain. |
Authentication Model
Databrain uses two token types: Service Token — org-level, set once in your MCP config. Used for discovery operations: listing datasources, datamarts, workspaces, data apps, and querying data. API Token — scoped to a single data app. Used for embed operations: creating embeds, customizing themes, generating guest tokens. The MCP server creates these automatically viacreate_api_token during setup — you never need to manage them manually.
Get Started
Quickstart
Set up in 2 minutes
Workflows
Common use cases
Tools Reference
All 24 tools

