home / mcp / metabase mcp server
A Model Context Protocol server that integrates AI assistants with Metabase analytics platform
Configuration
View docs{
"mcpServers": {
"hyeongjun-dev-metabase-mcp-server": {
"command": "/absolute/path/to/metabase-mcp-server/build/index.js",
"args": [],
"env": {
"LOG_LEVEL": "info",
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your_api_key",
"METABASE_PASSWORD": "your_password",
"METABASE_USER_EMAIL": "[email protected]"
}
}
}
}You run a Metabase MCP Server to let AI assistants query and interact with your Metabase analytics data. It exposes a set of tools to list dashboards, cards, databases, run saved questions, extract cards from dashboards, and execute custom SQL, all through a simple MCP interface.
Connect your MCP client to the Metabase MCP Server using one of the supported local (stdio) configurations or through a remote setup. Once connected, you can browse and retrieve Metabase resources, run saved questions, and execute custom queries. Use the available tools to list dashboards and cards, view all databases, or run a specific card with optional parameters. You can also fetch all cards from a particular dashboard for quick exploration and then run those cards against your databases.
Prerequisites you need before installation are straightforward.
# Prerequisites
- Node.js 18.0.0 or higher
- Access to a Metabase instance with credentials
# Install dependencies
npm install
# Build the project
npm run build
# Start the server (production)
npm start
# For development with auto-rebuild
npm run watchTwo authentication methods are supported to connect securely to Metabase:
Option 1: Username and Password Authentication requires your Metabase URL, user email, and password. You may optionally set a log level.
# Required
METABASE_URL=https://your-metabase-instance.com
[email protected]
METABASE_PASSWORD=your_password
# Optional
LOG_LEVEL=info # Options: debug, info, warn, error, fatalOption 2: API Key Authentication is recommended for production. You must provide the Metabase URL and an API key.
# Required
METABASE_URL=https://your-metabase-instance.com
METABASE_API_KEY=your_api_key
# Optional
LOG_LEVEL=info # Options: debug, info, warn, error, fatalYou can run the server locally and point Claude Desktop at it by editing the client configuration. This example shows the server path and environment variables you would provide to Claude Desktop.
{
"mcpServers": {
"metabase-mcp-server": {
"command": "/absolute/path/to/metabase-mcp-server/build/index.js",
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_USER_EMAIL": "[email protected]",
"METABASE_PASSWORD": "your_password"
// Or alternatively, use API key authentication
// "METABASE_API_KEY": "your_api_key"
}
}
}
}If you prefer using a command-line MCP runner (via a local CLI) you can pass a full JSON configuration to the runner. The following examples show both API key and username/password approaches.
# API Key Authentication example for MCP runner
{
"mcpServers": {
"metabase-mcp-server": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@hyeongjun-dev/metabase-mcp-server",
"--config",
"{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"your_api_key\",\"metabasePassword\":\"\",\"metabaseUserEmail\":\"\"}"
]
}
}
}# Username and Password Authentication example for MCP runner
{
"mcpServers": {
"metabase-mcp-server": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@hyeongjun-dev/metabase-mcp-server",
"--config",
"{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"\",\"metabasePassword\":\"your_password\",\"metabaseUserEmail\":\"[email protected]\"}"
]
}
}
}MCP servers communicate over stdio. If you encounter issues, use the MCP Inspector to monitor requests and responses in a browser-based interface. Start the inspector with the provided debugging command in your project scripts.
A Docker image is available for containerized deployment. Build and run with environment variables to point at your Metabase instance.
# Build the Docker image
docker build -t metabase-mcp-server .
# Run the container with environment variables
docker run -e METABASE_URL=https://your-metabase.com \
-e METABASE_API_KEY=your_api_key \
metabase-mcp-serverUse API keys for production, keep credentials secure, and consider using Docker secrets or environment variables to avoid hardcoding values. Limit network access to your Metabase instance to trusted clients.
Contributions are welcome. If you have improvements or fixes, submit a pull request with your changes.
Retrieve all available dashboards in your Metabase instance.
Get all saved questions/cards in Metabase.
View all connected database sources.
Run saved questions/cards and retrieve results with optional parameters.
Extract all cards from a specific dashboard.
Execute custom SQL queries against any connected database.