Metabase MCP 服务器のロゴ

Metabase MCP 服务器

組織
CW-Codewalnut

Backend integration layer that connects your Metabase instance with AI assistants using the Model Context Protocol (MCP)

公開者CW-Codewalnut
リポジトリMetabase-MCP-Server
言語Python
フォーク
12
スター
17
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスApache-2.0
リンク
  • ツールをAIワークフローに接続

    Metabase MCP 服务器は、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには17件のスターと12件のフォークがあります。

📊 Metabase MCP Server

📚 Table of Contents

  1. What is this tool about?
  2. Video Walkthrough
  3. Architecture Diagram
  4. Getting Started
  5. Configuration Options
  6. Getting Your Metabase API Key
  7. DXT File Support
  8. How to Create Your Own DXT File
  9. Remote Deployment
  10. Debugging with MCP Inspector
  11. Available Tools
  12. Example Prompts to Try
  13. Connect with Us
  14. License

😊 What is this tool about?

Metabase MCP Server is a backend integration layer that connects your Metabase instance with AI assistants using the Model Context Protocol (MCP). This allows business leaders, product managers and analysts to interact with business intelligence assets like dashboards and charts using natural language—through any MCP client (e.g., Claude Desktop).

Instead of navigating through menus or constructing SQL queries manually, you can:

  • You can ask a question and get an instant insight.
  • Generate dashboards and charts by describing what you want.
  • Manage user access and database connections through simple instructions.

This project makes Metabase not just a dashboarding tool—but a conversational, intelligent business assistant.


🎥 Video Walkthrough

Watch this video to see the Metabase MCP Server in action:


📐 Architecture Diagram

Architecture Diagram


🚀 Getting Started

1. Set Up Metabase (If you haven't already)

Follow the official Metabase installation guide: Metabase Docs

2. Install uv Package Manager

Install uv which includes Python and package management:

Windows:

bash
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

macOS/Linux:

bash
curl -LsSf https://astral.sh/uv/install.sh | sh

Or install via package managers:

bash
# macOS
brew install uv

# Windows (via Scoop)
scoop install uv

# Windows (via Chocolatey)
choco install uv

For more information about uv installation and usage, please visit the official documentation: https://docs.astral.sh/uv/getting-started/installation/

3. Clone or Download the Repository

You need to get this tool onto your computer. You can either download it manually or use Git. Open your computer's Terminal (Mac) or Command Prompt (Windows). Navigate to the folder where you unzipped the files or want to clone the project:

bash
# Example (replace with your actual path):
cd ~/Downloads/metabase-mcp-server-dev

Option 1: Download ZIP

  1. Go to the GitHub repository
  2. Click the green "Code" button
  3. Select "Download ZIP"
  4. Unzip the downloaded file to a location like your Documents folder

Option 2: Use Git If you're familiar with Git, run this in your terminal:

bash
git clone https://github.com/CW-Codewalnut/Metabase-MCP-Server.git
cd Metabase-MCP-Server

4. Install dependencies

This command will automatically:

  • Install the required Python version (if not already available)
  • Create a virtual environment for the project
  • Install all necessary packages and dependencies
bash
uv sync

5. Configure Your Credentials

You have three options to configure your Metabase credentials for the MCP Server:

Option 1: Using a .env file (Recommended) Create a .env file in the project root:

env
METABASE_URL=http://localhost:3000
METABASE_API_KEY=mb_xxx_your_key
PORT=3200
HOST=localhost
TRANSPORT=streamable-http
LOG_LEVEL=INFO

Option 2: Using command-line arguments Pass configuration directly via command line:

bash
uv run src/metabase_mcp_server.py --metabase-url http://localhost:3000 --metabase-api-key "YOUR_API_KEY" --port 3200 --host localhost --transport streamable-http --log-level INFO

Option 3: Using environment variables in MCP client config Configure directly in your MCP client without a .env file (see examples below).

json
{
  "mcpServers": {
    "metabase": {
      "type": "stdio",
      "command": "C:\\Users\\YourName\\Projects\\metabase-mcp-server\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\Users\\YourName\\Projects\\metabase-mcp-server\\src\\metabase_mcp_server.py"
      ],
      "env": {
        "METABASE_URL": "http://localhost:3000",
        "METABASE_API_KEY": "mb_xxx_your_key",
        "PORT": 3200,
        "HOST": "localhost",
        "TRANSPORT": "streamable-http",
        "LOG_LEVEL": "INFO"
      }
    }
  }
}

6. Connect to Your MCP client

Choose your preferred MCP clients like Claude Desktop app, Claude Code, Cursor, Windsurf etc., and add the Metabase MCP server in their respective configuration files. All MCP clients follow a similar configuration pattern.

Configuration Examples

For stdio transport (recommended for local MCP server):

Windows:

json
{
  "mcpServers": {
    "metabase": {
      "type": "stdio",
      "command": "C:\\Users\\YourName\\Projects\\metabase-mcp-server\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\Users\\YourName\\Projects\\metabase-mcp-server\\src\\metabase_mcp_server.py"
      ]
    }
  }
}

Mac:

json
{
  "mcpServers": {
    "metabase": {
      "type": "stdio",
      "command": "/Users/YourName/Projects/metabase-mcp-server/.venv/bin/python",
      "args": [
        "/Users/YourName/Projects/metabase-mcp-server/src/metabase_mcp_server.py"
      ]
    }
  }
}
Key Differences:
  • Windows uses backslashes \\ in paths
  • macOS/Linux uses forward slashes / in paths
  • Make sure to match the correct format based on your OS to avoid errors
Important Notes:
  • Replace FULL_PATH with the actual absolute path to your project directory
  • After saving configuration changes, restart your MCP client to apply the new settings
  • For project-specific tools in Cursor, create a .cursor/mcp.json file in your project directory
  • For global tools in Cursor, create a ~/.cursor/mcp.json file in your home directory

For streamable-http transport (recommended for remote MCP server):

json
{
  "mcpServers": {
    "metabase": {
      "type": "streamable-http",
      "url": "http://localhost:3200/mcp/"
    }
  }
}

Compatible MCP clients

Click on any client to visit their official MCP setup documentation:

ClientOfficial MCP Documentation
Claude DesktopAnthropic's official MCP guide for Claude Desktop
Claude CodeOfficial Claude Code MCP setup documentation
CursorCursor's official MCP configuration guide
WindsurfWindsurf official MCP setup documentation
ClineCline's official MCP quickstart guide
VS CodeVS Code Copilot MCP server configuration

Once you have added the configuration, the MCP server should be visible in your MCP client.


🔧 Configuration Options

The Metabase MCP Server supports flexible configuration through environment variables, command-line arguments, or a combination of both.

Environment Variables

VariableDescriptionDefault ValueExample
METABASE_URLYour Metabase instance URLRequiredhttp://127.0.0.1:3000
METABASE_API_KEYYour Metabase API keyRequiredmb_xxx_your_api_key
TRANSPORTTransport protocolstdiostdio, sse, streamable-http
HOSTHost for HTTP transportslocalhost0.0.0.0, 127.0.0.1
PORTPort for HTTP transports32008080, 9000
LOG_LEVELLogging levelINFODEBUG, INFO, WARNING, ERROR

Command-line Arguments

ArgumentDescriptionOptionsDefault Value
--metabase-urlMetabase instance URLAny Metabase URLRequired
--metabase-api-keyMetabase API keymb_... keyRequired
--transportTransport protocolstdio, sse, streamable-httpstdio
--hostHost for HTTP transportsAny host or IPlocalhost
--portPort for HTTP transportsAny port number3200
--log-levelLogging verbosity levelDEBUG, INFO, WARNING, ERRORINFO

Transport Protocols

ProtocolDescriptionUse Case
stdioStandard input/output communicationBest for local integrations (Claude Desktop, Cursor, etc.)
streamable-httpHTTP-based streaming protocolIdeal for remote deployments and web-based integrations
sseServer-Sent Events over HTTP⚠️ Deprecated - Not recommended for new setups

Configuration Priority

Configuration values are applied in the following priority order (highest to lowest):

  1. Command-line arguments (overrides everything)
  2. Environment variables (overrides defaults)
  3. Default values

Complete Command Examples

bash
uv run src/metabase_mcp_server.py --transport streamable-http --host localhost --port 3200 --metabase-url http://127.0.0.1:3000 --metabase-api-key mb_xxx_your_key

Note: You don't need to pass every parameter when running the server. However, you must provide the Metabase URL and API key. Any parameters not specified will use their default values as shown above.


🔑 Getting Your Metabase API Key

To get your Metabase API key:

  1. Log into your Metabase instance
  2. Click on your profile picture (top-right corner)
  3. Select "Account settings"
  4. Navigate to the "API Keys" tab
  5. Click "Create API Key"
  6. Give your key a descriptive name (e.g., "MCP Server Key")
  7. Copy the generated key (starts with mb_)

⚠️ Important: Store your API key securely and never commit it to version control. The key provides full access to your Metabase instance.


📂 DXT File Support

You no longer need to go through the steps of cloning the repository and setting up the environment. Simply follow the steps below to install the Metabase MCP Server in your Claude Desktop App:

  1. Download the DXT File
    Check the link below to download the latest DXT file directly:
    Download DXT File

  2. Open the Claude Desktop App
    Once you have the file, open the Claude Desktop App on your system.

  3. Navigate to Extensions Settings
    In the Claude Desktop App:

    • Go to Files → Settings → Extensions
    • Then click on Advanced Settings.
  4. Select the DXT File
    In the Advanced Settings section, click on Choose File, select the downloaded DXT file.

  5. Enter the Required Details
    After selecting the DXT file, a prompt will appear asking you to fill in the required details:

    • Metabase URL: Enter your Metabase server URL.
    • API Key: Add the relevant API key for authentication.
  6. Complete the Setup
    After entering the necessary details, click Save to apply the configuration.

That's it! The Metabase MCP Server is now installed and ready to use in your Claude Desktop App.

How to Create Your Own DXT File

If you want to create your own DXT file, please visit the Official Guide:
Creating Your Own DXT File

🚀 Remote Deployment

For production use or team collaboration, you can deploy the Metabase MCP Server remotely. We use this approach internally at Codewalnut.

Docker Deployment

We've included Docker configuration files to make remote deployment straightforward.

Quick Start with Docker

bash
# Build the Docker image
docker build -t metabase-mcp-server .

# Run with environment variables
docker run -d \
  -p 3200:3200 \
  -e METABASE_URL="http://your-metabase-instance.com" \
  -e METABASE_API_KEY="mb_xxx_your_api_key" \
  metabase-mcp-server

Docker Compose (Recommended)

yaml
version: "3.8"
services:
  metabase-mcp:
    build: .
    ports:
      - "3200:3200"
    environment:
      - METABASE_URL=http://your-metabase-instance.com
      - METABASE_API_KEY=mb_xxx_your_api_key
      ##- PORT=3200
      ##- HOST=localhost
      ##- TRANSPORT=streamable-http
      ##- LOG_LEVEL=INFO
    restart: unless-stopped

Remote HTTP/SSE transports are read-only by default. Set the matching ALLOW_* environment variable to true only when the server is behind trusted access controls and the configured Metabase API key is allowed to make those changes: ALLOW_WRITE_TOOLS, ALLOW_ADMIN_TOOLS, and ALLOW_SQL_TOOL.

Connecting to Remote MCP Server

Once deployed, configure your MCP clients to connect to the remote server:

json
{
  "mcpServers": {
    "metabase": {
      "type": "streamable-http",
      "url": "http://server-ip:3200/mcp/"
    }
  }
}

Deployment Options

  • Cloud Providers: AWS ECS, Google Cloud Run, Azure Container Instances
  • VPS/Dedicated Servers: DigitalOcean, Linode, Vultr
  • Container Platforms: Kubernetes, Docker Swarm
  • Platform-as-a-Service: Railway, Render, Fly.io

Security Considerations

  • Use HTTPS in production environments
  • Implement proper firewall rules
  • Consider VPN access for sensitive business data
  • Regularly rotate API keys
  • Monitor access logs

Need Help with Deployment?

Our team at CodeWalnut offers deployment and consulting services. Contact us for enterprise-grade setup and support.


🔍 Debugging with MCP Inspector

To debug and test your Metabase MCP Server setup, you can use the official MCP Inspector tool.

Prerequisites

First, install Node.js if you haven't already:

  • Download from: nodejs.org

  • Or install via package manager:

    bash
    # macOS
    brew install node
    
    # Windows (via Chocolatey)
    choco install nodejs
    
    # Windows (via Scoop)
    scoop install nodejs

Install and Run MCP Inspector

bash
# Install MCP Inspector globally
npm install -g @modelcontextprotocol/inspector

# Run the inspector with your Metabase MCP Server
npx @modelcontextprotocol/inspector uv run FULL_PATH/metabase-mcp-server/src/metabase_mcp_server.py

Using MCP Inspector

The MCP Inspector provides:

  • Real-time tool testing - Execute MCP tools directly from the web interface
  • Request/Response monitoring - See exactly what data is being sent and received
  • Error debugging - Identify configuration or API issues quickly
  • Schema validation - Verify that your tools are properly defined

Once running, open your browser to http://localhost:5173 to access the inspector interface.

Common Debugging Scenarios

  • Connection issues - Verify your Metabase URL and API key
  • Permission errors - Check if your API key has the required permissions

🔧 Available Tools

FunctionDescription
Collection Operations
get_metabase_collectionGet a collection by ID
create_metabase_collectionCreate a new collection
update_metabase_collectionUpdate collection metadata
delete_metabase_collectionDelete a collection
Chart (Card) Operations
get_metabase_cardsList all charts
get_card_query_resultsGet results from a chart query
create_metabase_cardCreate a new chart
update_metabase_cardUpdate an existing chart
delete_metabase_cardDelete a chart
Dashboard Operations
get_metabase_dashboardsList all dashboards
get_dashboard_by_idGet a dashboard by ID
get_dashboard_cardsGet cards in a dashboard
get_dashboard_itemsGet all dashboard items
create_metabase_dashboardCreate a dashboard
update_metabase_dashboardUpdate a dashboard
delete_metabase_dashboardDelete a dashboard
copy_metabase_dashboardCreate a copy of an existing dashboard
Database Operations
get_metabase_databasesList databases
create_metabase_databaseCreate a new database connection
update_metabase_databaseUpdate a database connection
delete_metabase_databaseDelete a database connection
User Operations
get_metabase_usersList all users
get_metabase_current_userGet current user details
create_metabase_userCreate a new user
update_metabase_userUpdate user info
delete_metabase_userDelete a user
Group Operations
get_metabase_groupsList user groups
create_metabase_groupCreate a user group
delete_metabase_groupDelete a user group
SQL Operations
execute_sql_queryExecute a native SQL query

🧪 Example Prompts to Try

  • Create a dashboard called 'Flight Overview' with a bar chart showing flights by destination city.
  • Run SQL: SELECT origin, destination, COUNT(*) FROM flights GROUP BY origin, destination LIMIT 10.
  • Create a card displaying total bookings last month grouped by region.
  • Delete the chart named 'Abandoned Queries'.
  • Update the dashboard 'Sales KPIs' to include a new revenue card.
  • Show all users in the 'Admin' group.
  • Create a new group called 'Finance Analysts'.
  • Connect to a Supabase database and list all tables.

🌐 Connect with Us

Stay connected and get support through our community channels:

🏢 Official Links

📱 Social Media

💬 Community Support

🤝 Professional Services

  • Consulting: Custom Metabase integrations and AI solutions
  • Training: MCP and business intelligence workshops
  • Support: Enterprise-grade support and maintenance

📢 Follow us for updates on new MCP servers, AI integrations, and business intelligence tools!


📜 License

This project is licensed under the Apache License 2.0.

You can find the full license text in the LICENSE file.


インストール

TypingMind
{
  "mcpServers": {
    "cw-codewalnut-metabase-mcp-server": {
      "command": "python",
      "args": [
        "path/to/your/main.py"
      ]
    }
  }
}

Metabase MCP 服务器のMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Metabase MCP 服务器に接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Metabase MCP 服务器をサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Metabase MCP 服务器のMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "cw-codewalnut-metabase-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてMetabase MCP 服务器のMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Metabase MCP 服务器のMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Metabase MCP 服务器を使ってこのタスクを手伝ってもらえますか?
Metabase MCP 服务器
はい、読みました。
Metabase MCP 服务器で調べた結果をお伝えします。

よくある質問

Metabase MCP 服务器 MCPサーバーは何に使いますか?

Metabase MCP 服务器は、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでMetabase MCP 服务器 MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでMetabase MCP 服务器を利用できます。

TypingMindでMetabase MCP 服务器 MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Metabase MCP 服务器を接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Metabase MCP 服务器 MCPをTypingMindに接続するにはどうすればよいですか?

Metabase MCP 服务器はTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでMetabase MCP 服务器 MCPのどのようなツールを利用できますか?

Metabase MCP 服务器はMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Metabase MCP 服务器 MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Metabase MCP 服务器で認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇