Skip to main content
Glama
metabase-mcp-navi

metabase-mcp-navi

Metabase MCP Server

PyPI version License: MIT

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-navi

Configuration

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 seconds

Cursor 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_dashboards

List all accessible dashboards

get_dashboard

Get dashboard details

get_dashboard_cards

Get all cards from a dashboard

search_dashboards

Search dashboards by name

Card Tools

Tool

Description

list_cards

List saved questions

get_card

Get card details and SQL query

execute_card

Run a saved question

search_cards

Search cards by name

Database Tools

Tool

Description

list_databases

List connected databases

get_database

Get database details

list_tables

List tables in a database

get_table_metadata

Get table columns and types

sync_database

Trigger metadata sync

Query Tools

Tool

Description

execute_query

Execute native SQL

test_query

Test query with auto LIMIT

get_query_suggestions

Get suggested queries for a table

explain_query

Get query execution plan

Image Tools

Tool

Description

get_card_image

Get card as base64 PNG

download_card_image

Save card image to disk

get_dashboard_cards_as_images

Check exportable cards

download_all_dashboard_cards

Download all dashboard images

CRUD Tools

Tool

Description

create_collection

Create a new collection

create_card

Create a new card with SQL

create_dashboard

Create a new dashboard

add_card_to_dashboard

Add card to dashboard

update_card

Update card properties

delete_card

Delete a card

delete_dashboard

Delete a dashboard

Other Tools

Tool

Description

test_connection

Test Metabase connectivity

list_collections

List folders/collections

get_collection_items

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

  1. Open Metabase in your browser and log in

  2. Open Developer Tools (F12)

  3. Go to Application → Cookies

  4. 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
└── LICENSE

Development

# 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

Available Tools

33 tools
add_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

    A3.6/5.0

    Scored across 33 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case, e.g., create_card, list_dashboards, delete_collection. No mixing of conventions.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A 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
      -
    • F
      license
      B
      quality
      D
      maintenance
      An 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
      -
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enables AI assistants to query databases, execute SQL, and manage Metabase resources like dashboards, cards, and collections through natural language.
      22
      MIT