A Model Context Protocol server for Metabase integration.
This is a TypeScript-based MCP server that implements integration with Metabase API. It allows AI assistants to interact with Metabase, providing access to:
- Dashboards, questions/cards, and databases as resources
- Tools for listing and executing Metabase queries
- Ability to view and interact with Metabase data
- List and access Metabase resources via
metabase://URIs - Access dashboards, cards/questions, and databases
- JSON content type for structured data access
list_dashboards- List all dashboards in Metabaselist_cards- List all questions/cards in Metabaselist_databases- List all databases in Metabaseexecute_card- Execute a Metabase question/card and get resultsget_dashboard_cards- Get all cards in a dashboardexecute_query- Execute a SQL query against a Metabase database
Before running the server, you need to set environment variables for authentication. The server supports two methods:
-
API Key (Preferred):
METABASE_URL: The URL of your Metabase instance (e.g.,https://your-metabase-instance.com).METABASE_API_KEY: Your Metabase API key.
-
Username/Password (Fallback):
METABASE_URL: The URL of your Metabase instance.METABASE_USERNAME: Your Metabase username.METABASE_PASSWORD: Your Metabase password.
The server will first check for METABASE_API_KEY. If it's set, API key authentication will be used. If METABASE_API_KEY is not set, the server will fall back to using METABASE_USERNAME and METABASE_PASSWORD. You must provide credentials for at least one of these methods.
Example setup:
Using API Key:
