metabase-mcp-navi
Provides tools for interacting with Metabase, enabling AI agents to manage dashboards, cards, databases, and execute queries programmatically.
Metabase MCP Server
A Model Context Protocol (MCP) server for Metabase - gives AI assistants direct access to dashboards, cards, and query execution.
Features
Three Authentication Methods: API Key, Session ID, or Username/Password
Dashboard Tools: List, search, get details, get cards from dashboards
Card Tools: List, search, get details, execute saved questions
Database Tools: List databases, tables, get metadata, sync
Query Tools: Execute SQL, test queries, get suggestions, explain queries
Image Export: Export cards and dashboards as PNG images
CRUD Operations: Create, update, delete cards, dashboards, and collections
Related MCP server: superset-mcp
Quick Start
Installation
# Install via pip
pip install metabase-mcp-navi
# Or via uvx (recommended for MCP)
uvx metabase-mcp-naviConfiguration
Set environment variables:
# Required
export METABASE_URL=https://your-metabase-instance.com
# Authentication (choose one):
export METABASE_API_KEY=your_api_key
# OR
export METABASE_SESSION_ID=your_session_id
# OR
export METABASE_USER_EMAIL=your_email
export METABASE_PASSWORD=your_password
# Optional
export METABASE_VERIFY_SSL=false # Disable SSL verification
export METABASE_TIMEOUT=60 # Request timeout in secondsCursor MCP Configuration
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"metabase": {
"command": "uvx",
"args": ["metabase-mcp-navi"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_SESSION_ID": "your_session_id",
"METABASE_VERIFY_SSL": "false"
}
}
}
}Claude Desktop Configuration
Add to your Claude Desktop config:
{
"mcpServers": {
"metabase": {
"command": "uvx",
"args": ["metabase-mcp-navi"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_SESSION_ID": "your_session_id"
}
}
}
}Available Tools
Dashboard Tools
Tool | Description |
| List all accessible dashboards |
| Get dashboard details |
| Get all cards from a dashboard |
| Search dashboards by name |
Card Tools
Tool | Description |
| List saved questions |
| Get card details and SQL query |
| Run a saved question |
| Search cards by name |
Database Tools
Tool | Description |
| List connected databases |
| Get database details |
| List tables in a database |
| Get table columns and types |
| Trigger metadata sync |
Query Tools
Tool | Description |
| Execute native SQL |
| Test query with auto LIMIT |
| Get suggested queries for a table |
| Get query execution plan |
Image Tools
Tool | Description |
| Get card as base64 PNG |
| Save card image to disk |
| Check exportable cards |
| Download all dashboard images |
CRUD Tools
Tool | Description |
| Create a new collection |
| Create a new card with SQL |
| Create a new dashboard |
| Add card to dashboard |
| Update card properties |
| Delete a card |
| Delete a dashboard |
Other Tools
Tool | Description |
| Test Metabase connectivity |
| List folders/collections |
| Browse collection contents |
Usage Examples
After configuring, you can ask your AI assistant:
"List all dashboards in Metabase"
"Get dashboard 3301 details"
"Execute card 12345"
"Run this SQL on database 104: SELECT * FROM users LIMIT 10"
"Search for dashboards about 'payments'"
"Create a new card with this query..."
"Download all images from dashboard 42"
Getting Session ID
Open Metabase in your browser and log in
Open Developer Tools (F12)
Go to Application → Cookies
Copy the value of
metabase.SESSION
Project Structure
metabase-mcp-navi/
├── src/
│ └── metabase_mcp_navi/
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Module entry point
│ ├── config.py # Configuration management
│ ├── client.py # Metabase API client
│ ├── models.py # Data models
│ ├── server.py # MCP server setup
│ └── tools/
│ ├── __init__.py # Tools package
│ ├── dashboards.py # Dashboard tools
│ ├── cards.py # Card/question tools
│ ├── databases.py # Database tools
│ ├── queries.py # Query execution tools
│ ├── images.py # Image export tools
│ └── crud.py # CRUD operations
├── pyproject.toml # Package configuration
├── README.md
└── LICENSEDevelopment
# Clone the repository
git clone https://github.com/manish-coder-1007/metabase-mcp-navi.git
cd metabase-mcp-navi
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
ruff check src/License
MIT License - see LICENSE for details.
Author
Manish Balot
Related Projects
trino-mcp-navi - MCP server for Trino databases
Available Tools
33 toolsadd_card_to_dashboardB
Add an existing card to a dashboard.
Args: dashboard_id: ID of the dashboard card_id: ID of the card to add row: Row position (default: 0) col: Column position (default: 0, max: 17) size_x: Width in grid units (default: 8, max: 18) size_y: Height in grid units (default: 6)
Returns: Success message with dashcard details
Inputs: dashboard_id (required), card_id (required), row, col, +2 more. Returns: result
create_cardA
Create a new card (saved question) with a native SQL query.
Args: name: Name of the card/question database_id: ID of the database to query query: SQL query string display: Visualization type: table, line, bar, pie, scalar, row, area, combo, pivot, funnel, map description: Optional description collection_id: Optional collection ID to save the card in
Returns: Created card details
Inputs: name (required), database_id (required), query (required), display, +2 more. Returns: result
create_collectionA
Create a new collection (folder) to organize dashboards and cards.
Args: name: Name of the collection description: Optional description parent_id: Optional parent collection ID (for nested collections)
Returns: Created collection details
Inputs: name (required), description, parent_id. Returns: result
create_dashboardA
Create a new empty dashboard.
Args: name: Name of the dashboard description: Optional description collection_id: Optional collection ID to save the dashboard in
Returns: Created dashboard details
Inputs: name (required), description, collection_id. Returns: result
delete_cardB
Delete a card (saved question). WARNING: This action cannot be undone!
Args: card_id: ID of the card to delete
Returns: Confirmation message
Inputs: card_id (required). Returns: result
delete_collectionA
Delete a collection (folder). WARNING: This may affect items inside the collection!
Args: collection_id: ID of the collection to delete
Returns: Confirmation message
Inputs: collection_id (required). Returns: result
delete_dashboardA
Delete a dashboard. WARNING: This action cannot be undone!
Args: dashboard_id: ID of the dashboard to delete
Returns: Confirmation message
Inputs: dashboard_id (required). Returns: result
download_all_dashboard_cardsA
Download all exportable card images from a dashboard.
Args: dashboard_id: The ID of the dashboard output_dir: Directory to save images (default: output/)
Returns: Summary of downloaded images
Inputs: dashboard_id (required), output_dir. Returns: result
download_card_imageC
Download a card/question image and save it to disk.
Args: card_id: The ID of the card to download output_dir: Directory to save the image (default: mcp-servers/output) filename: Optional custom filename without extension
Returns: Success message with file path or error message
Inputs: card_id (required), output_dir, filename. Returns: result
execute_cardA
Execute a saved question (card) and return results.
Args: card_id: The ID of the card to execute parameters: Optional JSON string of parameters (e.g., '{"param1": "value1"}') max_rows: Maximum rows to return (default 100)
Returns: Query results in markdown table format
Inputs: card_id (required), parameters, max_rows. Returns: result
execute_queryC
Execute a native SQL query against a database.
Args: database_id: The ID of the database to query query: SQL query to execute max_rows: Maximum rows to return (default 100)
Returns: Query results in markdown table format
Inputs: database_id (required), query (required), max_rows. Returns: result
explain_queryB
Get the query execution plan (EXPLAIN) for a SQL query.
Args: database_id: The ID of the database query: SQL query to explain
Returns: Query execution plan
Inputs: database_id (required), query (required). Returns: result
get_cardB
Get detailed information about a specific card (saved question).
Args: card_id: The ID of the card
Returns: Card details including query information
Inputs: card_id (required). Returns: result
get_card_imageA
Get a card/question as a PNG image (base64 encoded).
Args: card_id: The ID of the card to export
Returns: Base64 encoded image data or error message
Inputs: card_id (required). Returns: result
get_collection_itemsA
Get items (dashboards, cards, collections) in a collection.
Args: collection_id: The ID of the collection (use "root" for root collection) item_type: Type of items to return: "all", "dashboard", "card", "collection"
Returns: Items in the collection
Inputs: collection_id (required), item_type. Returns: result
get_dashboardA
Get detailed information about a specific dashboard.
Args: dashboard_id: The ID of the dashboard
Returns: Dashboard details including all cards
Inputs: dashboard_id (required). Returns: result
get_dashboard_cardsA
Get all cards (questions) from a specific dashboard.
Args: dashboard_id: The ID of the dashboard
Returns: List of cards with their details
Inputs: dashboard_id (required). Returns: result
get_dashboard_cards_as_imagesA
Get all card images from a dashboard. Returns information about which cards can be exported as images.
Args: dashboard_id: The ID of the dashboard
Returns: List of cards and their image export status
Inputs: dashboard_id (required). Returns: result
get_databaseC
Get detailed information about a specific database.
Args: database_id: The ID of the database
Returns: Database details
Inputs: database_id (required). Returns: result
get_query_suggestionsA
Get AI-suggested queries for a table based on its structure.
Args: database_id: The ID of the database table_name: Name of the table
Returns: Suggested SQL queries
Inputs: database_id (required), table_name (required). Returns: result
get_table_metadataB
Get detailed metadata about a specific table including columns.
Args: database_id: The ID of the database table_id: The ID of the table
Returns: Table metadata including columns
Inputs: database_id (required), table_id (required). Returns: result
list_cardsA
List saved questions (cards) accessible to the current user.
Args: collection_id: Optional collection ID to filter by database_id: Optional database ID to filter by limit: Maximum number of cards to return (default 100)
Returns: Markdown formatted list of cards
Inputs: collection_id, database_id, limit. Returns: result
list_collectionsA
List all collections (folders) in Metabase.
Args: parent_id: Optional parent collection ID to list children
Returns: List of collections
Inputs: parent_id. Returns: result
list_dashboardsA
List all dashboards accessible to the current user.
Args: collection_id: Optional collection ID to filter by limit: Maximum number of dashboards to return (default 100)
Returns: Markdown formatted list of dashboards
Inputs: collection_id, limit. Returns: result
list_databasesA
List all databases connected to Metabase.
Returns: Markdown formatted list of databases
Inputs: no named parameters. Returns: result
list_tablesA
List all tables in a database.
Args: database_id: The ID of the database schema: Optional schema name to filter by
Returns: List of tables in the database
Inputs: database_id (required), schema. Returns: result
remove_card_from_dashboardA
Remove a card from a dashboard.
Args: dashboard_id: ID of the dashboard dashcard_id: ID of the dashcard (not the card ID - get this from dashboard info)
Returns: Success message
Inputs: dashboard_id (required), dashcard_id (required). Returns: result
search_cardsA
Search for cards (saved questions) by name or description.
Args: query: Search term limit: Maximum results to return (default 20)
Returns: Matching cards
Inputs: query (required), limit. Returns: result
search_dashboardsC
Search for dashboards by name or description.
Args: query: Search term limit: Maximum results to return (default 20)
Returns: Matching dashboards
Inputs: query (required), limit. Returns: result
sync_databaseB
Trigger a sync of a database's metadata.
Args: database_id: The ID of the database to sync
Returns: Sync status
Inputs: database_id (required). Returns: result
test_connectionA
Test the connection to Metabase. Use this to verify connectivity and authentication.
Returns: Connection status and user information
Inputs: no named parameters. Returns: result
test_queryA
Test a SQL query with automatic LIMIT (for exploration). Automatically adds LIMIT to prevent large result sets.
Args: database_id: The ID of the database to query query: SQL query to test limit: Maximum rows to return (default 10)
Returns: Query results preview
Inputs: database_id (required), query (required), limit. Returns: result
update_cardB
Update an existing card's properties.
Args: card_id: ID of the card to update name: New name (optional) description: New description (optional) query: New SQL query (optional) display: New visualization type (optional) collection_id: Move to different collection (optional)
Returns: Updated card details
Inputs: card_id (required), name, description, query, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Most tools have clearly distinct purposes, but some pairs like get_card_image vs download_card_image and execute_card vs execute_query could cause confusion if descriptions are not carefully read. Overall, the set is well-differentiated.
All tool names follow a consistent verb_noun pattern in snake_case, e.g., create_card, list_dashboards, delete_collection. No mixing of conventions.
33 tools is on the higher side, but each covers a distinct operation in the Metabase domain. There is some redundancy (e.g., two card image retrieval tools) that could be consolidated, but overall the count is reasonable for a comprehensive server.
The tool surface covers CRUD for cards, dashboards, and collections, plus database exploration and query execution. Missing update_collection and some admin features, but these are minor gaps for typical use.
Maintenance
Related MCP Connectors
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
An MCP server giving access to Grafana dashboards, data and more.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Control Protocol server that enables AI assistants to interact with Metabase databases, allowing models to explore database schemas, retrieve metadata, visualize relationships, and execute actions.7-
- FlicenseBqualityDmaintenanceAn MCP server that provides AI assistants with full access to Apache Superset instances, enabling interaction with dashboards, charts, datasets, databases, and SQL execution capabilities.34-
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to query databases, execute SQL, and manage Metabase resources like dashboards, cards, and collections through natural language.22MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Metabase that gives AI agents full access to query, explore, and manage content in your Metabase instance.1MIT