# metabase-ai-assistant

An MCP server that wires your AI assistant into Metabase: SQL, dashboards, dbt models and PII masking.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 48
- Author: enessari
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/enessari/metabase-ai-assistant
- Updated: 2026-09-03
- HTML: https://affpapa.org/en/nevibecode/mcp/metabase-ai-assistant

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `METABASE_URL`, `METABASE_USERNAME`, `METABASE_PASSWORD`, `METABASE_API_KEY`, `DATABASE_HOST`, `DATABASE_PORT`, `DATABASE_NAME`, `DATABASE_USER`, `DATABASE_PASSWORD` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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-assistant
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
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-assistant
```
Replace <…> with your own values. 4 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
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-assistant
```
Replace <…> with your own values. 4 more environment variables are in the server README

## When to use it
- 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
- List the models in my dbt project and the priority sources for a revenue query
- Build a Metabase dashboard from `schema.yml` with Lightdash metadata
- Run this query against Metabase and fix it if it fails

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
