Metabase
STDIOHigh-performance MCP server for AI integration with Metabase analytics platforms featuring intelligent caching
High-performance MCP server for AI integration with Metabase analytics platforms featuring intelligent caching
Version: 1.0.0
Author: Jericho Sequitin (@jerichosequitin)
A high-performance Model Context Protocol server for AI integration with Metabase analytics platforms. Features intelligent caching, response optimization, and comprehensive data access tools.
Available as a Desktop Extension (DXT) for Claude Desktop.
metabase-mcp.dxt from Releases.dxt file with Claude Desktop to installFollow the standard MCP server installation process detailed in the Local Development Setup section below.
list, retrieve, search, execute, and export toolsThe server exposes the following optimized tools for AI assistants:
list: Fetch ALL records for a single resource type with highly optimized responses
cards, dashboards, tables, databases, collectionsretrieve: Get detailed information for specific items by ID
card, dashboard, table, database, collection, fieldsearch: Unified search across all Metabase items using native search API
execute: Unified command for executing SQL queries or saved cards (2K row limit)
card_parameters array with name/value pairsexport: Unified command for exporting large datasets (up to 1M rows)
card_parameters arrayclear_cache: Clear internal cache with granular control
cards, dashboards, tables, databases, collections, fieldscards-list, dashboards-list, tables-list, databases-list, collections-listall, all-individual, all-lists// List all cards list({ model: "cards" }) // Get detailed card information retrieve({ model: "card", ids: [1, 2, 3] }) // Search for dashboards search({ query: "sales", models: ["dashboard"] }) // Execute SQL query execute({ database_id: 1, query: "SELECT * FROM users LIMIT 100" }) // Export large dataset export({ database_id: 1, query: "SELECT * FROM large_table", format: "csv" })
API Key (Recommended):
METABASE_URL=https://your-metabase-instance.com METABASE_API_KEY=your_api_key
Email/Password:
METABASE_URL=https://your-metabase-instance.com METABASE_USER_EMAIL=[email protected] METABASE_PASSWORD=your_password
Optional Settings:
EXPORT_DIRECTORY=~/Downloads/Metabase # Or ${DOWNLOADS}/Metabase LOG_LEVEL=info
# Clone and build git clone https://github.com/jerichosequitin/metabase-mcp.git cd metabase-mcp npm install npm run build
Create a .env file:
# Required METABASE_URL=https://your-metabase-instance.com # Choose authentication method METABASE_API_KEY=your_api_key # Recommended # OR # [email protected] # METABASE_PASSWORD=your_password # Optional EXPORT_DIRECTORY=~/Downloads/Metabase # Or ${DOWNLOADS}/Metabase LOG_LEVEL=info CACHE_TTL_MS=600000 # 10 minutes by default REQUEST_TIMEOUT_MS=600000 # 10 minutes by default
To integrate with Claude Desktop, you'll need to configure the MCP server in Claude's configuration file.
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json{ "mcpServers": { "metabase-mcp": { "command": "/Users/your-username/path/to/metabase-mcp/build/src/index.js", "env": { "METABASE_URL": "https://your-metabase-instance.com", "METABASE_API_KEY": "your_api_key_here", "LOG_LEVEL": "info", "CACHE_TTL_MS": "600000", "EXPORT_DIRECTORY": "/path/to/your/export/directory" } } } }
/Users/username/Documents/metabase-mcp/build/src/index.js)your-username with your actual usernamepath/to/metabase-mcp with the actual path to your cloned repositorybuild/src/index.js is correct and the file existsnpm run buildFor executing saved cards with filters, use the card_parameters array:
execute({ card_id: 42, card_parameters: [ { "id": "param-uuid", "slug": "start_date", "target": ["dimension", ["template-tag", "start_date"]], "type": "date/all-options", "value": "2024-01-01~2024-12-31" } ] })
Get parameter structure by retrieving card details first.
// List with pagination list({ model: "cards", limit: 100, offset: 0 }) // Large database tables retrieve({ model: "database", ids: [1], table_limit: 20 })
Use the MCP Inspector for development:
npm run inspector
# Build and test docker build -t metabase-mcp . docker run -e METABASE_URL=https://metabase.example.com \ -e METABASE_API_KEY=your_api_key \ metabase-mcp
Note: Docker is primarily for development/testing.
# Run tests npm test # Coverage report npm run test:coverage # Development tools npm run inspector # MCP Inspector for debugging
# Build for distribution npm run dxt:build
Creates metabase-mcp.dxt ready for GitHub Releases.
This project is licensed under the MIT License.