Metabase Ai Assistant

io.github.enessari由 GitHub 账号 enessari 发布v3.2.0更新于 Oct 24, 2026

MCP Server for Metabase - 111 tools for SQL generation, dashboards & PostgreSQL

概览

AI 生成的概览

将 AI 助手连接到 Metabase BI 实例,用于 SQL、仪表板、卡片、集合以及 dbt 语义层相关工作。

可以做什么
提供大量工具(README 声称有 143 至 152 个),涵盖 SQL 与查询执行、自然语言转 SQL、卡片与可视化设置、仪表板创建与布局、集合组织、模式与数据建模、用户与权限管理,以及提醒、订阅和动作。还包含 dbt 与语义层功能,例如模型检查、血缘连接、预聚合建议、YAML 转仪表板,以及带提议、批准、弃用和恢复步骤的治理式语义记忆。自愈 SQL 循环会重试失败的查询,PII 掩码会处理邮箱、电话、证件号、银行卡、IP 和令牌。
适用场景
当助手需要在现有 Metabase 部署中工作时适用:浏览模式、编写并运行 SQL、创建或修改问题与仪表板、整理集合,或管理用户与权限。也适合维护 dbt 或 MetricFlow 语义模型、希望助手读取它们并生成仪表板或 YAML 的团队。
运行要求
以 stdio 方式在本地运行,通常通过 npx 或全局 npm 安装,因此需要 Node.js。需要 METABASE_URL,以及 METABASE_API_KEY 或 METABASE_USERNAME 配合 METABASE_PASSWORD。直接执行 PostgreSQL SQL 需要 DATABASE_HOST、DATABASE_NAME、DATABASE_PORT、DATABASE_USER 和 DATABASE_PASSWORD。需要能访问 Metabase 实例的网络。
安装前请注意
它持有 BI 系统以及可选数据库的凭据:METABASE_API_KEY、METABASE_PASSWORD 和 DATABASE_PASSWORD。许多工具会写入或更改数据,包括创建和编辑卡片与仪表板、移动集合、邀请用户、更改组成员身份与状态,以及执行 Metabase 动作、订阅和 webhook。直接 SQL 执行可能修改 PostgreSQL 数据库。README 中展示了只读模式开关,但它未出现在声明的环境变量列表中,因此在指向生产环境前应确认写入是如何被限制的。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Metabase Ai Assistant,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Metabase AI Assistant — Model Context Protocol (MCP) Server

[npm version] [License] [Node.js] [MCP SDK]

Metabase AI Assistant is an enterprise-grade Model Context Protocol (MCP) server that connects Large Language Models (LLMs), AI coding assistants, and automated data workflows directly to your Metabase Business Intelligence instance.

Featuring 152 dedicated tools, native dbt Metadata & Metrics Auto-Syncer, Metabase to dbt Reverse Lineage Exposures, dbt-Smart Question Creator, Lightdash Code-as-BI YAML-to-Dashboard generation, Cube.js-style Pre-aggregations & Multi-Hop Lineage Joins, Omni.co Controlled Semantic-to-YAML bridge, autonomous self-healing SQL execution, full-scale dashboard architecting, proactive anomaly detection, query index advisory, zero-leak PII masking, and strict security guardrails. Works seamlessly with Claude, Cursor, ChatGPT, Gemini, and Google Antigravity.


🌍 Language Versions / Dil Seçenekleri / 语言版本 / النسخ اللغوية


Table of Contents


Core Architectural Highlights

Metabase AI Assistant transforms standard AI interfaces (Claude Desktop, Cursor, VS Code, ChatGPT, Gemini, automated agent frameworks) into full-fledged Metabase power users:

  1. dbt Deep Scanning & MetricFlow Integration (dbt_project_scan_deep): 9-tier architectural classification, doc('...') resolution, and catalog.json table/column profiling.
  2. Cube.js Multi-Hop Lineage Joins (dbt_lineage_joins_graph): Resolves shortest join paths via Dijkstra Min-Heap algorithms with 3-color DAG cycle detection.
  3. Cube.js Pre-Aggregation & Rollup Advisor (dbt_semantic_preagg_advisor): Generates multi-dialect Materialized View DDLs (Postgres, BigQuery, Snowflake, ClickHouse, DuckDB, Redshift, MySQL) with HyperLogLog distinct counts.
  4. Lightdash Code-as-BI Dashboard Builder (dbt_build_dashboard_from_yaml): Translates meta.metabase and meta.lightdash formatting options into collision-free 24-column Metabase Dashboards.
  5. Omni.co Controlled Semantic-to-YAML Exporter (dbt_semantic_export_yaml): Serializes approved business rules into clean dbt schema.yml / semantic_models.yml code blocks.
  6. Autonomous Self-Healing SQL Engine (ai_sql_execute_and_heal): 3-iteration automated error-recovery loop for resilient querying.
  7. Zero-Leak Enterprise PII Masker: Real-time sanitization of emails, phone numbers, national IDs, credit cards, IP addresses, and tokens.

Next-Gen Autonomous Features (v5.1)

1. dbt Architectural Hierarchy & Source Prioritization

$$\mathbf{Gold;Marts;(fct_,;dim_,;rpt_)} ;\gg; \mathbf{Silver;(int_)} ;\gg; \mathbf{Bronze;Staging;(stg_)}$$

  • dbt_inspect_models: Parses dbt manifest.json and MetricFlow semantic models.
  • dbt_prioritize_sources: Dynamically routes natural language questions to pre-aggregated, tested dimensional and fact tables.

2. Governance-First Semantic Memory (No Silent Learning, No Hard-Deletes)

  • semantic_memory_propose: Proposes a business rule in PENDING_APPROVAL status.
  • semantic_memory_approve: Explicitly activates the rule with required data steward comments.
  • semantic_memory_deprecate: Safely soft-archives rules with mandatory audit reasons (DEPRECATED).
  • semantic_memory_restore: Instantly restores archived rules.
  • semantic_memory_list: Lists all rules with complete audit history and timestamps.

3. Autonomous Self-Healing SQL Engine (ai_sql_execute_and_heal)

  • Catches syntax errors, Levenshtein-distance column misspellings, missing GROUP BY clauses, and dialect quirks across Postgres, MySQL, BigQuery, Snowflake, and SQLite.
  • Preserves fix history in _provenance.healing_trail.

Metabase Version Compatibility

Metabase AI Assistant provides backward and forward compatibility across all major Metabase architectures:

Metabase Version RangeCompatibility LevelKey Features Supported
Metabase v0.55 – v0.61+ (Current)Full SupportModern MBQL 5 format (stages, lib/type), /api/upload/csv, updated collection permissions, multi-tab dashboards
Metabase v0.50 – v0.54Full SupportCollection tree hierarchies (/api/collection/tree), Model cards, API Key auth (x-api-key), sequential parametric queries
Metabase v0.43 – v0.49Full SupportSession token authentication (X-Metabase-Session), legacy MBQL query pipelines, database introspection
Metabase Open Source & EnterpriseFull SupportAutomatic feature detection (whitelabeling, audit logs, granular data permissions)

Quick Start & Installation

Global Execution via NPX

bash
npx metabase-ai-assistant

Manual Installation via NPM

bash
npm install -g metabase-ai-assistant

Client Configuration & Desktop Setup

1. Claude Desktop

Option A: One-Click Extension (DXT / MCPB)
  1. Open Claude Desktop Settings -> Developer / Extensions -> Install Local Extension.
  2. Select this repository folder.
  3. Or install via Smithery CLI:
    bash
    npx -y @smithery/cli install metabase-ai-assistant --client claude
Option B: Manual JSON Configuration

Add the server definition to claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
json
{  "mcpServers": {    "metabase": {      "command": "npx",      "args": ["-y", "metabase-ai-assistant"],      "env": {        "METABASE_URL": "https://your-metabase-instance.com",        "METABASE_API_KEY": "mb_your_api_key_here",        "METABASE_READ_ONLY_MODE": "true"      }    }  }}

2. Cursor IDE, Windsurf & VS Code

Add to .cursor/mcp.json or VS Code MCP settings:

json
{  "mcpServers": {    "metabase": {      "command": "npx",      "args": ["-y", "metabase-ai-assistant"],      "env": {        "METABASE_URL": "https://your-metabase-instance.com",        "METABASE_API_KEY": "mb_your_api_key_here",        "METABASE_READ_ONLY_MODE": "true"      }    }  }}

3. ChatGPT Custom GPTs & Actions

Expose Metabase AI Assistant as an OpenAPI Action for ChatGPT Plus / Team / Enterprise:

  1. Start the Remote SSE/HTTP server: npm run start:sse
  2. In ChatGPT, create a Custom GPT -> Actions -> Import from URL: https://your-domain.com/tools/openapi.json
  3. Detailed setup guide: docs/integrations/CHATGPT_ACTIONS_GUIDE.md

4. Google Gemini & Google AI Studio

Pass tool definitions to Gemini Function Calling SDKs (@google/genai or google-generativeai):

5. Cloudflare Workers (Serverless Edge)

Deploy directly to Cloudflare's edge network for free:

bash
cd deploy/cloudflarenpx wrangler deploy

Tool Categories Overview (143 Tools)

The 143 MCP tools are categorized into 10 operational domains:

  1. dbt & Semantic Layer (6 tools): Model hierarchy inspection, lineage resolution, source prioritization, governance-first business memory (propose, approve, soft-deprecate, restore).
  2. Autonomous AI BI Operations (4 tools): Self-healing SQL engine, end-to-end dashboard architect, query index advisor, proactive anomaly detector.
  3. SQL & Query Execution (14 tools): Direct SQL queries, async execution jobs, query status tracking, pagination, and speed benchmarks.
  4. AI Query Intelligence (6 tools): Natural language to SQL, query performance optimizer, query explainer, automated table description.
  5. Cards & Visualizations (34 tools): Question creation, query execution, parametric filtering, card cloning, visualization settings.
  6. Dashboards & Layouts (22 tools): Dashboard creation, grid placement, filter linking, tab management, executive templates.
  7. Collections & Organization (8 tools): Collection tree traversal, hierarchical moves, permission graphs, item listing.
  8. Schema & Data Modeling (18 tools): Schema retrieval, foreign key inference, data profiling, table definitions.
  9. User & Permission Administration (12 tools): User invitations, group assignments, membership controls, status toggling.
  10. Actions & Documentation (19 tools): Metabase actions execution, pulses, alerts, webhooks, metrics, segment definitions, workspace migration.

Testing & Quality Assurance

Backed by an automated multi-tier test suite covering unit logic, integration workflows, and security fuzzing:

bash
# Run complete test suite (32 suites, 583 tests)npm test
# Run unit testsnpm run test:unit
# Run integration workflowsnpm run test:integration
# Run security & PII zero-leak fuzzing testsnpm run test:security

License

Licensed under the Apache License 2.0. See the LICENSE file for details.

Developed and maintained by Abdullah Enes SARI (ONMARTECH LLC).

来源:README.md,提交 009ae02

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v3.2.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分