metabase-ai-connector
Facilitate conversational interaction with Metabase analytics through integrated AI assistants. This enables agents to directly query data sources, retrieve visualizations, and administer Metabase assets using structured request/response formats.
Author

zsh52013148087
Quick Info
Actions
Tags
Metabase AI Integration Service
This Model Context Protocol (MCP) service acts as a secure intermediary, connecting advanced language models to the Metabase business intelligence environment.
Core Purpose
The primary function of this server is to bridge the gap between cognitive AI agents and your organization's Metabase data repository. It translates natural language instructions into executable Metabase API calls, returning results in a machine-readable JSON structure suitable for AI consumption.
Features at a Glance
- Native URI Navigation: Interact with Metabase objects (dashboards, questions) using a standardized
metabase://addressing scheme. - Dual Auth Support: Accommodates both traditional session credentials (email/password) and modern, headless API key verification.
- Predictable Output: All data retrieval operations guarantee JSON output formatting for reliable parsing by LLMs.
- Operational Transparency: Comprehensive, configurable logging for debugging and auditing interactions.
- Resilient Operations: Implements thorough error trapping to provide meaningful feedback on failed requests.
Available Agent Capabilities
The following programmatic interfaces are exposed for AI orchestration:
Data Probing
list_dashboards: Inventory all available visual reports.list_cards: Fetch metadata for all saved analytical questions.list_databases: Enumerate all linked data sources.list_collections: Retrieve the hierarchy of Metabase organizational folders.list_tables: Obtain a schema listing for tables within a specified data source.get_table_fields: Detail the columns and attributes of a given table.
Analytical Execution
execute_card: Run pre-defined saved questions, accepting optional runtime parameters.execute_query: Inject and execute arbitrary SQL against any configured backend database.
Dashboard Manipulation
get_dashboard_cards: Deconstruct a dashboard to list its constituent visual components.create_dashboard: Provision a new dashboard entity based on provided specifications.update_dashboard: Modify the metadata (name, description, parameters) of an extant dashboard.delete_dashboard: Permanently remove a dashboard.add_card_to_dashboard: Integrate or reposition existing cards onto a dashboard structure.
Question/Card Lifecycle
create_card: Define and save a new analytical question, typically leveraging an SQL definition.update_card_visualization: Modify the presentation layer settings (chart type, axis configuration) of a card.
Organization
create_collection: Establish a new container for grouping related reports and dashboards.
Configuration Directives
The system requires environmental variables to establish connectivity:
Method A: Credential Pairing (Session-Based)
bash
Mandatory
METABASE_URL=https://your-metabase-instance.com METABASE_USER_EMAIL=your_email@example.com METABASE_PASSWORD=your_password
Optional
LOG_LEVEL=info # Choices: debug, info, warn, error, fatal
Method B: API Token (Preferred for Automation)
bash
Mandatory
METABASE_URL=https://your-metabase-instance.com METABASE_API_KEY=your_secret_token
Optional
LOG_LEVEL=info # Choices: debug, info, warn, error, fatal
Configuration files (.env) leveraging [dotenv] conventions are supported.
Deployment via Smithery Workflow
To integrate this service with Claude or other AI frontends, utilize the Smithery deployment pipeline:
Deployment Sequence:
- Create a personal fork of this source repository on GitHub.
- Authorize Smithery via its web interface and link your GitHub account.
- Initiate deployment of your forked repository through the Smithery control panel.
Claude Desktop Integration Setup
Update the configuration file used by your local Claude client:
MacOS Path: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows Path: %APPDATA%/Claude/claude_desktop_config.json
API Key Authentication Schema:
{ "mcpServers": { "metabase-ai-connector": { "command": "npx", "args": [ "-y", "@smithery/cli@latest", "run", "YOUR_GITHUB_USERNAME/metabase-ai-connector", "--config", "{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"your_api_key\",\"metabasePassword\":\"\",\"metabaseUserEmail\":\"\"}" ] } } }
User/Pass Authentication Schema:
{ "mcpServers": { "metabase-ai-connector": { "command": "npx", "args": [ "-y", "@smithery/cli@latest", "run", "YOUR_GITHUB_USERNAME/metabase-ai-connector", "--config", "{\"metabaseUrl\":\"https://your-metabase-instance.com\",\"metabaseApiKey\":\"\",\"metabasePassword\":\"your_password\",\"metabaseUserEmail\":\"your_email@example.com\"}" ] } } }
Security Posture
- API token usage is strongly recommended for automated/production environments.
- Protect all sensitive credentials; avoid hardcoding secrets.
- Utilize environment variables as the primary mechanism for secret injection.
- Implement ingress controls to restrict network exposure of the Metabase endpoint.
