MCP HubMCP Hub
imlewc

metabase-server

by: imlewc

mcp metabase

19created 02/03/2025
Visit
metabase

📌Overview

Purpose: To facilitate integration between AI assistants and Metabase through a Model Context Protocol (MCP) server.

Overview: The Metabase MCP Server is a TypeScript-based server that enables seamless interaction with the Metabase API, allowing AI assistants to access and manage Metabase resources, such as dashboards and databases, efficiently.

Key Features:

  • Resources: Offers the ability to list and access various Metabase resources (dashboards, questions/cards, databases) via metabase:// URIs, ensuring structured data access through JSON content type.

  • Tools: Provides a suite of tools for listing and executing queries, including:

    • list_dashboards for retrieving all dashboards.
    • list_cards for accessing all questions/cards.
    • list_databases for viewing available databases.
    • execute_card to run specific questions/cards and retrieve results.
    • get_dashboard_cards to gather all cards in a specific dashboard.
    • execute_query to perform SQL queries against Metabase databases.

metabase-server MCP Server

A Model Context Protocol (MCP) server for Metabase integration. This TypeScript-based MCP server interacts with the Metabase API, allowing AI assistants to access and manipulate Metabase data such as dashboards, questions/cards, and databases.

Features

Resources

  • Access Metabase resources via metabase:// URIs
  • Work with dashboards, cards/questions, and databases
  • JSON content type for structured data access

Tools

  • list_dashboards: List all dashboards in Metabase
  • list_cards: List all questions/cards in Metabase
  • list_databases: List all databases in Metabase
  • execute_card: Execute a Metabase question/card and get results
  • get_dashboard_cards: Get all cards in a dashboard
  • execute_query: Execute a SQL query against a Metabase database

Configuration

Before running the server, set the following environment variables:

# Required environment variables
export METABASE_URL=https://your-metabase-instance.com
export METABASE_USERNAME=your_username
export METABASE_PASSWORD=your_password

These can be set in your shell profile or in a .env file using a package like dotenv.

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild on changes:

npm run watch

Installation

To use with Claude Desktop, add the server configuration to the appropriate config file:

  • On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%/Claude/claude_desktop_config.json

Example configuration:

{
  "mcpServers": {
    "metabase-server": {
      "command": "/path/to/metabase-server/build/index.js",
      "env": {
        "METABASE_URL": "https://your-metabase-instance.com",
        "METABASE_USERNAME": "your_username",
        "METABASE_PASSWORD": "your_password"
      }
    }
  }
}

You can alternatively set these environment variables at the system level instead of in the config file.

Installing via Smithery

To install metabase-server automatically for Claude Desktop:

npx -y @smithery/cli install @imlewc/metabase-server --client claude

Debugging

MCP servers communicate over stdio, which can make debugging difficult. Use the MCP Inspector to assist with debugging:

npm run inspector

The inspector will provide a URL for browser-based debugging tools.