metabase-mcp-server
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
- What is this tool about?
- Video Walkthrough
- Architecture Diagram
- Getting Started
- Available Tools
- Example Prompts to Try
- 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
π 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:
-
Python 3.11+ β Required to run the MCP server backend. Download Python
-
Node.js β Required for running auxiliary MCP components or inspectors. Download Node.js
-
Any MCP-compatible AI client β Example: Claude Desktop. Download Claude Desktop
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
-
Go to the GitHub repository
-
Click the green "Code" button
-
Select "Download ZIP"
-
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
andargs
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 correctcommand
to your Python executable andargs
to your MCP Server script path, based on your operating system.
π§ Available Tools
Function | Description |
---|---|
Collection Operations | |
get_metabase_collection | Get a collection by ID |
create_metabase_collection | Create a new collection |
update_metabase_collection | Update collection metadata |
delete_metabase_collection | Delete a collection |
Chart (Card) Operations | |
get_metabase_cards | List all charts |
get_card_query_results | Get results from a chart query |
create_metabase_card | Create a new chart |
create_simple_visualization | Create a simple visualization |
update_metabase_card | Update an existing chart |
delete_metabase_card | Delete a chart |
Dashboard Operations | |
get_metabase_dashboards | List all dashboards |
get_dashboard_by_id | Get a dashboard by ID |
get_dashboard_cards | Get cards in a dashboard |
get_dashboard_items | Get all dashboard items |
create_metabase_dashboard | Create a dashboard |
update_metabase_dashboard | Update a dashboard |
delete_metabase_dashboard | Delete a dashboard |
copy_metabase_dashboard | Create a copy of an existing dashboard |
Database Operations | |
get_metabase_databases | List databases |
create_metabase_database | Create a new database connection |
update_metabase_database | Update a database connection |
delete_metabase_database | Delete a database connection |
User Operations | |
get_metabase_users | List all users |
get_metabase_current_user | Get current user details |
create_metabase_user | Create a new user |
update_metabase_user | Update user info |
delete_metabase_user | Delete a user |
Group Operations | |
get_metabase_groups | List user groups |
create_metabase_group | Create a user group |
delete_metabase_group | Delete a user group |
SQL Operations | |
execute_sql_query | Execute 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.