metabase-ai-assistant — Claude Code MCP server for Metabase and dbt
An MCP server that wires your AI assistant into Metabase: SQL, dashboards, dbt models and PII masking.
claude mcp add --env METABASE_URL=<METABASE_URL> --env METABASE_USERNAME=<METABASE_USERNAME> --env METABASE_PASSWORD=<METABASE_PASSWORD> --env METABASE_API_KEY=<METABASE_API_KEY> --env DATABASE_HOST=<DATABASE_HOST> --transport stdio metabase-ai-assistant -- npx -y metabase-ai-assistantWhat metabase-ai-assistant does
The server exposes your Metabase Business Intelligence instance to an AI assistant. Through it you can write SQL, build dashboards, read dbt manifests and semantic models, and run queries with automatic error recovery — the engine catches column misspellings, a missing GROUP BY and dialect differences across Postgres, MySQL, BigQuery, Snowflake and SQLite.
A large part of the toolset targets dbt: project scanning, shortest join path resolution, and a pre-aggregation advisor that emits DDL for Postgres, BigQuery, Snowflake, ClickHouse, DuckDB, Redshift and MySQL. Business rules live in a separate layer: a rule is proposed as PENDING_APPROVAL, activated only after confirmation, and archived with a mandatory reason. Personal data in query results is masked on the fly.
You need Node.js 18+ and access to your Metabase. The config takes METABASE_URL, METABASE_USERNAME, METABASE_PASSWORD, METABASE_API_KEY and DATABASE_HOST; without them the server cannot reach the instance. Compatibility is stated for Metabase v0.43 and later, Open Source and Enterprise alike.
What it helps with
- turn a plain-language question into a Metabase SQL query
- build a dashboard from dbt models and YAML metadata
- find the join path between two tables in a dbt project
- suggest pre-aggregations and DDL for materialized views
- mask personal data in query results
Example prompts for the agent
- List the models in my dbt project and the priority sources for a revenue query
- Build a Metabase dashboard from
schema.ymlwith Lightdash metadata - Run this query against Metabase and fix it if it fails
How to install metabase-ai-assistant
Platform CLI
claude mcp add --env METABASE_URL=<METABASE_URL> --env METABASE_USERNAME=<METABASE_USERNAME> --env METABASE_PASSWORD=<METABASE_PASSWORD> --env METABASE_API_KEY=<METABASE_API_KEY> --env DATABASE_HOST=<DATABASE_HOST> --transport stdio metabase-ai-assistant -- npx -y metabase-ai-assistantReplace <…> with your own values. 4 more environment variables are in the server README
Platform CLI
codex mcp add metabase-ai-assistant --env METABASE_URL=<METABASE_URL> --env METABASE_USERNAME=<METABASE_USERNAME> --env METABASE_PASSWORD=<METABASE_PASSWORD> --env METABASE_API_KEY=<METABASE_API_KEY> --env DATABASE_HOST=<DATABASE_HOST> -- npx -y metabase-ai-assistantReplace <…> with your own values. 4 more environment variables are in the server README
Config file
{
"mcpServers": {
"metabase-ai-assistant": {
"command": "npx",
"args": [
"-y",
"metabase-ai-assistant"
],
"env": {
"METABASE_URL": "<METABASE_URL>",
"METABASE_USERNAME": "<METABASE_USERNAME>",
"METABASE_PASSWORD": "<METABASE_PASSWORD>",
"METABASE_API_KEY": "<METABASE_API_KEY>",
"DATABASE_HOST": "<DATABASE_HOST>"
}
}
}
}Replace <…> with your own values. 4 more environment variables are in the server README
Config file
{
"servers": {
"metabase-ai-assistant": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"metabase-ai-assistant"
],
"env": {
"METABASE_URL": "<METABASE_URL>",
"METABASE_USERNAME": "<METABASE_USERNAME>",
"METABASE_PASSWORD": "<METABASE_PASSWORD>",
"METABASE_API_KEY": "<METABASE_API_KEY>",
"DATABASE_HOST": "<DATABASE_HOST>"
}
}
}
}Replace <…> with your own values. 4 more environment variables are in the server README
Platform CLI
gemini mcp add -e METABASE_URL=<METABASE_URL> -e METABASE_USERNAME=<METABASE_USERNAME> -e METABASE_PASSWORD=<METABASE_PASSWORD> -e METABASE_API_KEY=<METABASE_API_KEY> -e DATABASE_HOST=<DATABASE_HOST> metabase-ai-assistant npx -y metabase-ai-assistantReplace <…> with your own values. 4 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about metabase-ai-assistant
How do I install metabase-ai-assistant in Claude Code?
Run `claude mcp add metabase-ai-assistant -e METABASE_URL=<METABASE_URL> -e METABASE_PASSWORD=<METABASE_PASSWORD> -e METABASE_API_KEY=<METABASE_API_KEY> -e DATABASE_PASSWORD=<DATABASE_PASSWORD> -- npx -y metabase-ai-assistant`. Replace the placeholders with your own values.
What does metabase-ai-assistant do?
It connects an AI assistant to Metabase: SQL generation, dashboard building, dbt model and semantic rule handling, and masking of personal data in results.
Which Metabase versions are supported?
Compatibility is stated for Metabase v0.43 and later, including Open Source and Enterprise. Newer versions are supported through the MBQL 5 format.