metabase-mcp-python
Provides tools for querying databases, managing dashboards, and interacting with Metabase instances.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@metabase-mcp-python show last week's revenue by region"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Language: English | Portugues (BR)
metabase-mcp-python
A Python Model Context Protocol (MCP) server for Metabase, enabling AI assistants to query databases, manage dashboards, and interact with your Metabase instance.
Inspired by CognitionAI/metabase-mcp-server (TypeScript). See CREDITS.md for attribution.
Installation
With uv (recommended)
uv tool install metabase-mcp-pythonWith pip
pip install metabase-mcp-pythonFrom source
git clone https://github.com/im-voracity/metabase-mcp-python.git
cd metabase-mcp-python
uv syncRelated MCP server: Metabase MCP Plus
Configuration
Set the following environment variables (or use a .env file):
Variable | Required | Description |
| Yes | Your Metabase instance URL (e.g., |
| One of | Metabase API key for authentication |
| One of | Username for session-based authentication |
| One of | Password for session-based authentication |
You must provide either METABASE_API_KEY or both METABASE_USERNAME and METABASE_PASSWORD.
Usage
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"metabase": {
"command": "uv",
"args": ["tool", "run", "metabase-mcp-python"],
"env": {
"METABASE_URL": "http://localhost:3000",
"METABASE_API_KEY": "your-api-key"
}
}
}
}With session authentication:
{
"mcpServers": {
"metabase": {
"command": "uv",
"args": ["tool", "run", "metabase-mcp-python"],
"env": {
"METABASE_URL": "http://localhost:3000",
"METABASE_USERNAME": "user@example.com",
"METABASE_PASSWORD": "your-password"
}
}
}
}Claude CLI
{
"mcpServers": {
"metabase": {
"command": "uv",
"args": ["tool", "run", "metabase-mcp-python", "--write"],
"env": {
"METABASE_URL": "http://localhost:3000",
"METABASE_API_KEY": "your-api-key"
}
}
}
}Running from source
{
"mcpServers": {
"metabase": {
"command": "uv",
"args": ["run", "--directory", "/path/to/metabase-mcp-python", "metabase-mcp"],
"env": {
"METABASE_URL": "http://localhost:3000",
"METABASE_API_KEY": "your-api-key"
}
}
}
}Tool Filtering Modes
The server supports three modes to control which tools are exposed to the AI assistant:
Mode | Flag | Tools | Description |
Essential |
| ~19 | Core read operations for querying and exploring |
Write |
| ~59 | Essential + create, update, and delete operations |
All |
| ~87 | Every available tool including advanced operations |
Examples:
metabase-mcp # Essential mode (default)
metabase-mcp --write # Essential + write tools
metabase-mcp --all # All toolsThe essential mode is the default to keep the tool list manageable and reduce the risk of unintended modifications. Use --write or --all when you need to create or modify Metabase resources.
Available Tools
Tools are organized into five categories:
Database (13 tools) -- List, inspect, create, and manage database connections; execute SQL queries
Table (17 tools) -- Browse tables, inspect schemas, manage field metadata, import/export CSV
Card (21 tools) -- CRUD for saved questions, execute queries, manage public links, move cards
Dashboard (27 tools) -- CRUD for dashboards, manage cards/layout, filters audit, public links
Additional (9 tools) -- Collections, search, users, playground links
See docs/tools-reference.md for the complete tool listing.
Development
Setup
git clone https://github.com/im-voracity/metabase-mcp-python.git
cd metabase-mcp-python
uv sync --group devTesting
uv run pytest
uv run pytest -m "not integration" # Skip integration testsLinting and type checking
uv run ruff check src tests
uv run ruff format --check src tests
uv run mypy srcArchitecture
See docs/architecture.md for a detailed overview of the codebase structure, request flow, and authentication system.
License
Available Tools
19 toolscreate_dashboardA
Create a new Metabase dashboard - use this to build new analytical views, organize related cards, or establish monitoring interfaces
Inputs: name (required), parameters, description, collection_id, +1 more. Returns: result
execute_cardARead-only
Run a Metabase card query and return the actual data results - use this to get current data from existing cards, refresh analytical insights, or programmatically access query results for further processing
Inputs: card_id (required), dashboard_id, ignore_cache, collection_preview. Returns: result
execute_queryARead-only
Execute a native SQL query against a Metabase database - use this for custom data analysis, complex queries, or extracting specific data not available through existing cards
Inputs: query (required), database_id (required), parameters. Returns: result
get_cardARead-only
Get complete metadata and configuration for a specific Metabase card including query definition, visualization settings, collection location, and permissions - use this when you need to examine or understand how a particular card is built
Inputs: card_id (required). Returns: result
get_card_dashboardsARead-only
Find all dashboards that include a specific Metabase card - use this to understand where a card is being used, track dependencies before making changes, or find related analytical content
Inputs: card_id (required). Returns: result
get_collection_itemsARead-only
Retrieve all items (cards, dashboards) within a Metabase collection - use this to explore collection contents, organize analytical assets, or understand content structure
Inputs: collection_id (required). Returns: result
get_dashboardARead-only
Retrieve detailed information about a specific Metabase dashboard including cards, layout, and settings - use this to examine dashboard structure or get configuration details
Inputs: dashboard_id (required). Returns: result
get_dashboard_cardsARead-only
Retrieve all cards within a specific Metabase dashboard - use this to analyze dashboard content, understand data sources, or examine card configurations
Inputs: dashboard_id (required). Returns: result
get_databaseARead-only
Retrieve detailed information about a specific Metabase database including connection details and schema - use this to examine database properties or troubleshoot connections
Inputs: database_id (required). Returns: result
get_field_idARead-only
Look up a field's ID and metadata by table and column name - essential for building parameter mappings. Returns field_id, base_type, and other metadata needed for filter connections.
Inputs: table_id (required), column_name (required). Returns: result
get_metabase_playground_linkARead-only
Generate a Metabase playground link for interactive query exploration - allows users to see results and experiment with data in a user-friendly interface
Inputs: query (required), display. Returns: result
get_tableARead-only
Retrieve comprehensive table information including schema, fields, and metadata - use this to understand structure, explore fields, or get configuration details.
Inputs: table_id (required), include_hidden_fields, include_sensitive_fields, include_editable_data_model. Returns: result
get_table_dataARead-only
Retrieve sample data from table for preview and analysis - use this to examine content, verify quality, or understand data patterns.
Inputs: table_id (required), limit. Returns: result
list_cardsARead-only
Retrieve all Metabase cards with optional filtering by source type (e.g., 'models') or model relationships - use this to discover available cards, find specific cards by type, or get an overview of all analytical content
Inputs: f, model_id. Returns: result
list_collectionsARead-only
Retrieve all Metabase collections for organizing analytical content - use this to understand content structure, find collections, or explore organizational hierarchy
Inputs: archived. Returns: result
list_dashboardsARead-only
Retrieve all Metabase dashboards - use this to discover available dashboards, get an overview of analytical content, or find specific dashboards
Inputs: no named parameters. Returns: result
list_databasesARead-only
Retrieve all database connections in Metabase - use this to discover available data sources, check connection status, or get an overview of connected databases
Inputs: no named parameters. Returns: result
list_tablesARead-only
Retrieve all Metabase tables with optional ID filtering - use this to discover available tables, explore database schema, or get metadata about specific tables.
Inputs: ids. Returns: result
search_contentARead-only
Search across all Metabase content including cards, dashboards, collections, and models - use this to find specific content, discover assets, or explore analytical resources
Inputs: q (required), type, limit, models, +2 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Each tool has a clearly distinct purpose: database vs table vs card vs dashboard vs collection operations are well-separated. Even similar tools like get_table and get_table_data are distinct (metadata vs sample data).
All tool names follow a consistent verb_noun pattern using snake_case, with clear verbs like get, list, execute, create, and search. No mixed conventions or ambiguous verbs.
19 tools is on the higher end of appropriate for a Metabase server, covering databases, tables, cards, dashboards, collections, and querying. Slightly heavy but each tool provides distinct functionality.
The set covers reading and querying well, but lacks create/update/delete operations for cards and collections. Only dashboard creation exists, leaving obvious lifecycle gaps for analytical content.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Control Protocol server that enables AI assistants to interact with Metabase databases, allowing models to explore database schemas, retrieve metadata, visualize relationships, and execute actions.7-
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to query databases, execute SQL, and manage Metabase resources like dashboards, cards, and collections through natural language.22MIT
- AlicenseAqualityDmaintenanceA MCP server for Metabase that gives AI assistants direct access to dashboards, cards, and query execution.331MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Metabase that gives AI agents full access to query, explore, and manage content in your Metabase instance.5 npm1MIT