metabase-mcp-server

metabase-mcp-server

0

Metabase MCP Server is a backend tool that integrates Metabase with AI assistants using the Model Context Protocol. It enhances user interaction with business intelligence tools by enabling the use of natural language to manipulate dashboards and data insights.

πŸ“Š Metabase MCP Server

πŸ“š Table of Contents

  1. What is this tool about?
  2. Video Walkthrough
  3. Architecture Diagram
  4. Getting Started
  5. Available Tools
  6. Example Prompts to Try
  7. 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-compatible AI 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 Required Software

Make sure the following software is installed and available in your system path:

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:

# 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:

git clone https://github.com/codewalnut/metabase-mcp-server.git
cd metabase-mcp-server

4. Install uv Package Manager

Install uv using:

pip install uv

5. Create a Virtual Environment

uv venv .venv

# Windows
.venv\Scripts\activate

# macOS/Linux
source .venv/bin/activate

6. Install Requirements

uv pip install -r requirements.txt

7. Configure Your .env

Create a .env file and add:

METABASE_URL=http://127.0.0.1:3000
METABASE_API_KEY=mb_xxx_your_api_key

8. Connect to Your AI Client

If you are using Claude Desktop, you need to modify your claude_desktop_config.json file.

Windows Path:
C:\Users\<YOUR_USERNAME>\AppData\Roaming\Claude\claude_desktop_config.json
macOS Path:
~/Library/Application Support/Claude/claude_desktop_config.json

Inside the config file, add:

{
  "mcpServers": {
    "metabase": {
      "command": "FULL_PATH\\metabase-mcp-server\\.venv\\Scripts\\python.exe",
      "args": ["FULL_PATH\\metabase-mcp-server\\src\\metabase_mcp_server.py"]
    }
  }
}
Important Notes
  • Replace FULL_PATH with the actual location of your project directory.

  • After saving the changes, restart Claude Desktop to apply the new configuration.

  • The command and args paths depend on your operating system.

Windows Example:

"command": "FULL_PATH\\metabase-mcp-server\\.venv\\Scripts\\python.exe",
"args": ["FULL_PATH\\metabase-mcp-server\\src\\metabase_mcp_server.py"]

macOS/Linux Example:

"command": "FULL_PATH/metabase-mcp-server/.venv/bin/python",
"args": ["FULL_PATH/metabase-mcp-server/src/metabase_mcp_server.py"]

Key Differences:

  • Windows uses backslashes \\ and .exe files.
  • macOS/Linux uses forward slashes / and no .exe.

Make sure to match the correct format based on your OS to avoid errors.

Note:
For other AI clients, configure them similarly by setting the correct command to your Python executable and args to your MCP Server script path, based on your operating system.


πŸ”§ 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
create_simple_visualizationCreate a simple visualization
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.

πŸ“œ License

This project is licensed under the Apache License 2.0.

You can find the full license text in the file.