home / mcp / metabase mcp server

Metabase MCP Server

Metabase MCP server provides integration with the Metabase API, enabling LLM with MCP capabilites to directly interact with your analytics data, this server acts as a bridge between your analytics platform and conversational AI.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cpr43-metabase-mcp": {
      "url": "https://placeholder-hosted-mcp.example.com/mcp",
      "headers": {
        "METABASE_URL": "https://your-metabase-instance.com",
        "METABASE_API_KEY": "your_api_key",
        "METABASE_PASSWORD": "your_password",
        "METABASE_USER_EMAIL": "[email protected]"
      }
    }
  }
}

This MCP (Model Context Protocol) server bridges Metabase analytics data with conversational AI, letting you access dashboards, cards, databases, and more through natural language-enabled assistants. It supports both API-key and user/password authentication, returns structured JSON for AI consumption, and includes robust logging and error handling to help you build interactive analytics conversations.

How to use

You connect your AI assistant to Metabase through the MCP server and use it to browse, query, and manage analytics resources. You can retrieve dashboards, cards, databases, and tables, run saved questions or custom SQL, and organize content into collections and dashboards. Choose an authentication method that fits your security model: API keys for production or username/password for development. When you configure the client, point it to the MCP server using the provided runtime commands, and supply the required credentials via the chosen method.

Deployment channels include a Smithery-based runtime and a local, shell-driven workflow. If you are using Claude Desktop or a similar AI assistant, you can start the MCP server through the runtime command shown in the configuration examples and provide the necessary configuration payload via the --config parameter. This yields a live MCP endpoint that your assistant can call to list resources, execute cards and queries, and manage dashboards.

How to install

Prerequisites: have Node.js installed on your machine (version 14 or newer is recommended) and npm available in your environment.

1. Install the MCP server dependencies in your project.

2. Start the MCP server using the provided runtime command. If you are using the Smithery-based flow showcased for Claude Desktop integration, you will run a command that invokes npx with the MCP server package and passes a JSON configuration payload.

Concrete commands you can use as a starting point (adjust to your actual repository and configuration):

# Install dependencies
npm install

# Start the server via Smithery-based flow (example)
npx -y @smithery/cli@latest run YOUR_GITHUB_USERNAME/metabase-mcp-server --config "{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"your_api_key\",\"metabasePassword\":\"\",\"metabaseUserEmail\":\"\"}"

Configuration and security

The MCP server supports two authentication methods. Use API key authentication for production deployments to minimize credential handling. If you choose username and password authentication, supply the Metabase user email and password accordingly.

Environment variables can be set directly in your environment or via a .env file. Ensure credentials are kept secure and avoid hardcoding sensitive values in code or config files.

Notes and troubleshooting

If you encounter connection issues, verify that the Metabase URL is reachable from the MCP server host and that the authentication method (API key or user credentials) is correctly supplied. Check the server logs for authentication errors and API access messages to diagnose issues quickly.

Available tools

list_dashboards

Retrieve all dashboards available in your Metabase instance.

list_cards

Get all saved questions/cards stored in Metabase.

list_databases

View all connected database sources.

list_collections

List all collections in Metabase.

list_tables

List all tables in a specific database.

get_table_fields

Get all fields/columns in a specific table.

execute_card

Run a saved card and retrieve its results with optional parameters.

execute_query

Execute a custom SQL query against any connected database.

get_dashboard_cards

Extract all cards from a specific dashboard.

create_dashboard

Create a new dashboard with specified name and parameters.

update_dashboard

Update an existing dashboard's name, description, or parameters.

delete_dashboard

Delete a dashboard.

add_card_to_dashboard

Add or update cards in a dashboard with position and optional tab.

create_card

Create a new card/question with a SQL query.

update_card_visualization

Update visualization settings for a card.

create_collection

Create a new collection to organize dashboards and cards.