io.github.enessari/metabase-ai-assistant

AI 与智能体

by enessari

面向 Metabase 的 MCP Server,提供 111 项工具,支持 SQL 生成、仪表板构建与 PostgreSQL 操作。

什么是 io.github.enessari/metabase-ai-assistant

面向 Metabase 的 MCP Server,提供 111 项工具,支持 SQL 生成、仪表板构建与 PostgreSQL 操作。

README

<div align="center">

🚀 Metabase AI Assistant

The Most Powerful MCP Server for Metabase

134 ToolsMCP SDK v1.26.0AI-Powered SQLStructured OutputEnterprise Security

npm version npm downloads GitHub stars License

MCP Compatible Claude Cursor Node.js MCP Badge

Turn your AI assistant into a Metabase power user.
Generate SQL from natural language, create dashboards, manage users, and automate BI workflows.

📦 Install Now📖 Documentation🎯 Features⭐ Star Us

</div>

⭐ Why This Project?

"I analyzed every Metabase MCP server on the market. This one has 4x more tools and features than any competitor."

FeatureThis ProjectOther MCP Servers
Total Tools1346-30
AI SQL Generation
AI SQL Optimization
Dashboard Templates
User Management
Workspace Export/Import
Read-Only Security Mode
Response Caching
Activity Logging
Metadata Analytics
Parametric Questions
Environment Comparison
Structured Output (JSON)
Tool Annotations

🚀 Quick Start

One-Line Install

bash
npx metabase-ai-assistant

Add to Claude Desktop / Cursor

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

That's it! Your AI assistant now has full Metabase superpowers. 🦸


🎯 What Can You Do?

💬 Natural Language → SQL

code
You: "Show me total revenue by product category for the last 30 days"
AI: Uses ai_sql_generate → Runs query → Returns formatted results

📊 Instant Dashboard Creation

code
You: "Create an executive dashboard for our e-commerce sales"
AI: Uses mb_dashboard_template_executive → Creates fully configured dashboard

🔍 Deep Database Exploration

code
You: "What tables are related to 'orders' and show their relationships"
AI: Uses db_relationships_detect → Returns complete ER diagram info

🛡️ Enterprise-Grade Security

code
You: "DROP TABLE users" 
AI: 🔒 Blocked - Read-only mode active

🔧 Complete Tool List (134)

🆕 All tools include MCP annotations and title. 16 priority tools support outputSchema + structuredContent for typed JSON responses.

<details> <summary><b>📊 Database Operations (25 tools)</b></summary>
ToolDescription
db_listList all databases
db_schemasGet schemas in a database
db_tablesGet tables with fields
sql_executeExecute SQL queries
db_table_createCreate tables (AI-prefixed)
db_view_createCreate views
db_matview_createCreate materialized views
db_index_createCreate indexes
db_vacuum_analyzeVACUUM and ANALYZE
db_query_explainEXPLAIN query plans
db_table_statsTable statistics
db_index_usageIndex usage analysis
db_schema_exploreFast schema exploration
db_schema_analyzeDeep schema analysis
db_relationships_detectDetect foreign keys
...and more
</details> <details> <summary><b>🤖 AI-Powered Features (5 tools)</b></summary>
ToolDescription
ai_sql_generateNatural language → SQL
ai_sql_optimizeQuery optimization suggestions
ai_sql_explainExplain SQL in plain English
ai_relationships_suggestSuggest table relationships
mb_auto_describeAuto-generate descriptions
</details> <details> <summary><b>📋 Question/Card Management (12 tools)</b></summary>
ToolDescription
mb_question_createCreate new questions
mb_questionsList all questions
mb_question_create_parametricParametric questions
mb_card_getGet card details
mb_card_updateUpdate cards
mb_card_deleteDelete cards
mb_card_archiveArchive cards
mb_card_dataGet card data as JSON
mb_card_copyCopy cards
mb_card_cloneClone cards
...and more
</details> <details> <summary><b>📈 Dashboard Management (14 tools)</b></summary>
ToolDescription
mb_dashboard_createCreate dashboards
mb_dashboardsList all dashboards
mb_dashboard_getGet dashboard details
mb_dashboard_updateUpdate dashboards
mb_dashboard_deleteDelete dashboards
mb_dashboard_add_cardAdd cards to dashboard
mb_dashboard_add_filterAdd filters
mb_dashboard_layout_optimizeOptimize layout
mb_dashboard_template_executiveExecutive templates
...and more
</details> <details> <summary><b>👥 User & Permission Management (10 tools)</b></summary>
ToolDescription
mb_user_listList users
mb_user_getGet user details
mb_user_createCreate users
mb_user_updateUpdate users
mb_user_disableDisable users
mb_permission_group_listList groups
mb_permission_group_createCreate groups
...and more
</details> <details> <summary><b>📊 Metadata Analytics (14 tools)</b></summary>
ToolDescription
mb_meta_overviewInstance health check
mb_meta_query_performanceQuery analytics
mb_meta_content_usageContent usage stats
mb_meta_user_activityUser activity
mb_meta_table_dependenciesTable dependencies
mb_meta_impact_analysisBreaking change analysis
mb_meta_optimization_recommendationsIndex suggestions
mb_meta_export_workspaceBackup to JSON
mb_meta_import_previewImport dry-run
mb_meta_compare_environmentsDev vs Prod diff
mb_meta_auto_cleanupSafe cleanup
...and more
</details>

🛡️ Security Features

FeatureDescription
🔒 Read-Only ModeBlocks INSERT, UPDATE, DELETE, DROP (default: enabled)
🏷️ AI PrefixAll AI-created objects use claude_ai_ prefix
✅ Explicit ApprovalDestructive operations require confirmation
📝 Activity LoggingFull audit trail of all operations
🔐 Env ValidationZod-validated environment variables
💾 Auto-BackupPrompts for backup before destructive ops
bash
# Enable/disable read-only mode
METABASE_READ_ONLY_MODE=true  # Default: blocks write ops
METABASE_READ_ONLY_MODE=false # Allow write operations

⚙️ Configuration

Create a .env file:

bash
# Required
METABASE_URL=https://your-metabase.com
METABASE_API_KEY=mb_your_api_key

# Or use username/password
# METABASE_USERNAME=admin@example.com
# METABASE_PASSWORD=your_password

# Security (defaults to true)
METABASE_READ_ONLY_MODE=true

# AI Features (optional)
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...

# Performance (optional)
CACHE_TTL_MS=600000  # 10 minutes

📦 Installation Options

npm (Recommended)

bash
npm install -g metabase-ai-assistant

Docker

bash
docker run -e METABASE_URL=... -e METABASE_API_KEY=... ghcr.io/enessari/metabase-ai-assistant

From Source

bash
git clone https://github.com/enessari/metabase-ai-assistant.git
cd metabase-ai-assistant
npm install
npm run mcp

🏗️ Architecture

code
metabase-ai-assistant/
├── src/
│   ├── mcp/
│   │   ├── server.js              # MCP Server entry point
│   │   ├── tool-registry.js       # 134 tool definitions + annotations + outputSchema
│   │   ├── tool-router.js         # Dynamic routing with read-only gate
│   │   └── handlers/              # 15 modular handler files
│   ├── utils/
│   │   ├── structured-response.js # Structured output (MCP 2025-06-18)
│   │   ├── cache.js               # TTL-based caching
│   │   ├── config.js              # Zod validation
│   │   └── response-optimizer.js  # Compact response formatting
│   └── metabase/
│       └── client.js              # Metabase API client

🤝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

bash
# Fork, clone, install
git clone https://github.com/YOUR_USERNAME/metabase-ai-assistant.git
npm install

# Create feature branch
git checkout -b feature/amazing-feature

# Test and submit PR
npm test
git push origin feature/amazing-feature

📚 Resources


📄 License

Apache License 2.0 - see LICENSE


<div align="center">

⭐ Star this repo if it helps you!

Built with ❤️ by Abdullah Enes SARI @ ONMARTECH LLC

Star History


Keywords: Metabase MCP Server, Model Context Protocol, AI SQL Generation, Business Intelligence, Claude AI, Cursor AI, Natural Language SQL, Dashboard Automation, PostgreSQL, Data Analytics, LLM Tools

</div>

常见问题

io.github.enessari/metabase-ai-assistant 是什么?

面向 Metabase 的 MCP Server,提供 111 项工具,支持 SQL 生成、仪表板构建与 PostgreSQL 操作。

相关 Skills

Claude接口

by anthropics

Universal
热门

面向接入 Claude API、Anthropic SDK 或 Agent SDK 的开发场景,自动识别项目语言并给出对应示例与默认配置,快速搭建 LLM 应用。

想把Claude能力接进应用或智能体,用claude-api上手快、兼容Anthropic与Agent SDK,集成路径清晰又省心

AI 与智能体
未扫描149.6k

RAG架构师

by alirezarezvani

Universal
热门

聚焦生产级RAG系统设计与优化,覆盖文档切块、检索链路、索引构建、召回评估等关键环节,适合搭建可扩展、高准确率的知识库问答与检索增强应用。

面向RAG落地,把知识库、向量检索和生成链路系统串联起来,做架构设计时更清晰,也更少踩坑。

AI 与智能体
未扫描17.9k

多智能体架构

by alirezarezvani

Universal
热门

聚焦多智能体系统架构设计,梳理 Supervisor、Swarm、分层和 Pipeline 等模式,覆盖角色定义、通信协作与性能评估,适合规划稳健可扩展的 AI agent 编排方案。

帮你系统解决多智能体应用的架构设计与协同编排难题,适合构建复杂 AI 工作流,成熟度高、社区认可也很亮眼。

AI 与智能体
未扫描17.9k

相关 MCP Server

知识图谱记忆

编辑精选

by Anthropic

热门

Memory 是一个基于本地知识图谱的持久化记忆系统,让 AI 记住长期上下文。

帮 AI 和智能体补上“记不住”的短板,用本地知识图谱沉淀长期上下文,连续对话更聪明,数据也更可控。

AI 与智能体
87.1k

顺序思维

编辑精选

by Anthropic

热门

Sequential Thinking 是让 AI 通过动态思维链解决复杂问题的参考服务器。

这个服务器展示了如何让 Claude 像人类一样逐步推理,适合开发者学习 MCP 的思维链实现。但注意它只是个参考示例,别指望直接用在生产环境里。

AI 与智能体
87.1k

PraisonAI

编辑精选

by mervinpraison

热门

PraisonAI 是一个支持自反思和多 LLM 的低代码 AI 智能体框架。

如果你需要快速搭建一个能 24/7 运行的 AI 智能体团队来处理复杂任务(比如自动研究或代码生成),PraisonAI 的低代码设计和多平台集成(如 Telegram)让它上手极快。但作为非官方项目,它的生态成熟度可能不如 LangChain 等主流框架,适合愿意尝鲜的开发者。

AI 与智能体
8.1k

评论