Metabase MCP Plus
Provides tools for querying databases, executing SQL, and managing dashboards, cards, and collections in Metabase.
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 Plus list all dashboards"
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.
Metabase MCP Plus
An enhanced Model Context Protocol (MCP) server for Metabase, enabling AI assistants like Claude, Cursor, and other MCP clients to query databases, execute SQL, manage dashboards, cards, and collections — all through natural language.
Quick Start
Using uvx (No Installation Required)
uvx metabase-mcp-plusUsing pip
pip install metabase-mcp-plus
metabase-mcp-plusFrom Source
git clone https://github.com/schachan/metabase-mcp.git
cd metabase-mcp
uv sync
uv run python server.pyRelated MCP server: superset-mcp
Configuration
Set environment variables directly or create a .env file:
cp .env.example .envAPI Key Authentication (Recommended)
METABASE_URL=https://your-metabase-instance.com
METABASE_API_KEY=your-api-key-hereEmail/Password Authentication
METABASE_URL=https://your-metabase-instance.com
METABASE_USER_EMAIL=your-email@example.com
METABASE_PASSWORD=your-passwordOptional: Custom Host/Port (SSE/HTTP transports)
HOST=localhost # Default: 0.0.0.0
PORT=9000 # Default: 8000Available Tools (22)
Database Operations (6 tools)
Tool | Description |
| List all configured databases |
| Get details of a specific database |
| Get all tables in a database with metadata |
| Retrieve field/column information for a table |
| List all schemas in a database |
| Get tables within a specific schema |
Query Operations (1 tool)
Tool | Description |
| Execute native SQL queries with parameter support |
Card / Question Management (6 tools)
Tool | Description |
| List all saved questions/cards |
| Get details of a specific card |
| Run a saved question and return results |
| Create a new question with a SQL query |
| Update an existing card's name, query, or collection |
| Archive a card |
Dashboard Management (5 tools)
Tool | Description |
| List all dashboards |
| Get full dashboard details including cards |
| Create a new dashboard |
| Update a dashboard's name, description, or cards |
| Delete a dashboard |
Collection Management (3 tools)
Tool | Description |
| Browse all collections |
| List items within a collection |
| Create a new collection |
Search (1 tool)
Tool | Description |
| Search across cards, dashboards, collections, and tables |
Transport Methods
metabase-mcp-plus # STDIO (default, for IDE integration)
metabase-mcp-plus --sse # Server-Sent Events
metabase-mcp-plus --http # Streamable HTTPOr from source:
uv run python server.py # STDIO
uv run python server.py --sse # SSE
uv run python server.py --http # HTTPIDE Integration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"metabase": {
"command": "uvx",
"args": ["metabase-mcp-plus"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your-api-key-here"
}
}
}
}Cursor
Add to your MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"metabase": {
"command": "uvx",
"args": ["metabase-mcp-plus"],
"env": {
"METABASE_URL": "https://your-metabase-instance.com",
"METABASE_API_KEY": "your-api-key-here"
}
}
}
}Project Structure
metabase-mcp/
├── server.py # Entry point — CLI arg parsing and transport selection
├── app.py # FastMCP app setup, env loading, client instantiation
├── client.py # MetabaseClient with auth, retry, and error handling
├── tools/
│ ├── __init__.py # Registers all tool modules
│ ├── databases.py # Database, table, schema, and field tools
│ ├── queries.py # SQL query execution
│ ├── cards.py # Card CRUD and execution
│ ├── dashboards.py # Dashboard CRUD
│ ├── collections.py # Collection browsing and creation
│ └── search.py # Cross-entity search
├── tests/ # Comprehensive test suite (95% coverage)
├── .github/workflows/
│ ├── ci.yml # Lint + test on push/PR
│ └── publish.yml # Release → PyPI + attach assets
├── RELEASING.md # How to cut a release (trusted publisher setup)
└── pyproject.tomlDevelopment
# Install with dev dependencies
uv sync --group dev
# Run linting and formatting
uv run ruff check .
uv run ruff format .
# Run tests with coverage
uv run pytest tests/ --cov=. --cov=tools --cov-report=term-missing -vArchitecture Highlights
Modular tools — each domain (databases, cards, dashboards, etc.) is a separate module
Automatic auth retry — expired session tokens are refreshed transparently on 401
Custom exceptions —
MetabaseAPIErrorandMetabaseAuthErrorfor typed error handlingError handler decorator —
@tool_error_handlereliminates boilerplate try/except across all 22 toolsMiddleware stack — built-in error handling and logging middleware via FastMCP
Releases & PyPI
Publishing to PyPI is automated when you publish a GitHub Release (workflow .github/workflows/publish.yml): lint → test → build → attach wheels to the release → upload to PyPI (trusted publisher / OIDC).
See RELEASING.md for one-time PyPI + GitHub environment setup and the exact tag/version rules (v1.2.3 must match version = "1.2.3" in pyproject.toml).
License
MIT License — see LICENSE for details.
Resources
Available Tools
22 toolsarchive_cardA
Archive a card/question in Metabase (soft delete).
This sets the card's archived status to true, which hides it from normal views but preserves the data. Safer than permanent deletion.
Args: card_id: The ID of the card to archive.
Returns: The updated card object with archived status.
Inputs: card_id (required). Returns: object
create_cardB
Create a new question/card in Metabase.
Args: name: Name of the card. database_id: ID of the database to query. query: SQL query for the card. description: Optional description. collection_id: Optional collection to place the card in. visualization_settings: Optional visualization configuration.
Returns: The created card object.
Inputs: name (required), database_id (required), query (required), description, +2 more. Returns: object
create_collectionB
Create a new collection in Metabase.
Args: name: Name of the collection. description: Optional description. color: Optional color for the collection. parent_id: Optional parent collection ID.
Returns: The created collection object.
Inputs: name (required), description, color, parent_id. Returns: object
create_dashboardA
Create a new dashboard in Metabase.
Args: name: Name of the dashboard. description: Optional description. collection_id: Optional collection to place the dashboard in. parameters: Optional dashboard filter parameters.
Returns: The created dashboard object.
Inputs: name (required), description, collection_id, parameters. Returns: object
delete_dashboardC
Delete a dashboard from Metabase.
Args: dashboard_id: The ID of the dashboard to delete.
Returns: Confirmation of the deletion.
Inputs: dashboard_id (required). Returns: object
execute_cardB
Execute a saved Metabase question/card and retrieve results.
Args: card_id: The ID of the card to execute. parameters: Optional parameters for the card execution.
Returns: Card execution results.
Inputs: card_id (required), parameters. Returns: object
execute_queryC
Execute a native SQL query against a Metabase database.
Args: database_id: The ID of the database to query. query: The SQL query to execute. native_parameters: Optional parameters for the query.
Returns: Query execution results.
Inputs: database_id (required), query (required), native_parameters. Returns: object
get_cardA
Get detailed information about a specific card/question.
Args: card_id: The ID of the card to retrieve.
Returns: Dictionary with full card metadata including query, visualization settings, and collection info.
Inputs: card_id (required). Returns: object
get_collection_itemsA
List items inside a specific collection.
Args: collection_id: The ID of the collection to browse. models: Optional filter for item types (e.g., ["card", "dashboard", "collection"]).
Returns: Dictionary containing the items in the collection.
Inputs: collection_id (required), models. Returns: object
get_dashboardB
Get detailed information about a specific dashboard.
Args: dashboard_id: The ID of the dashboard.
Returns: Dictionary with full dashboard metadata including cards, parameters, and layout.
Inputs: dashboard_id (required). Returns: object
get_databaseA
Get detailed information about a specific database.
Args: database_id: The ID of the database.
Returns: Dictionary with full database metadata including engine, features, and settings.
Inputs: database_id (required). Returns: object
get_schema_tablesA
List all tables within a specific schema of a database.
Args: database_id: The ID of the database. schema_name: The name of the schema.
Returns: A list of table metadata dictionaries for the given schema.
Inputs: database_id (required), schema_name (required). Returns: result
get_table_fieldsB
Get all fields/columns in a specific table.
Args: table_id: The ID of the table. limit: Maximum number of fields to return (default: 20).
Returns: Dictionary with field metadata, truncated if necessary.
Inputs: table_id (required), limit. Returns: object
list_cardsB
List all saved questions/cards in Metabase.
Returns: Dictionary containing all cards with their metadata.
Inputs: no named parameters. Returns: object
list_collectionsA
List all collections in Metabase.
Returns: Dictionary containing all collections with their metadata.
Inputs: no named parameters. Returns: object
list_dashboardsA
List all dashboards in Metabase.
Returns: A list of dashboard metadata dictionaries.
Inputs: no named parameters. Returns: result
list_databasesA
List all databases configured in Metabase.
Returns: A dictionary containing all available databases with their metadata.
Inputs: no named parameters. Returns: object
list_database_schemasA
List all schemas in a specific database.
Args: database_id: The ID of the database.
Returns: A list of schema names available in the database.
Inputs: database_id (required). Returns: result
list_tablesB
List all tables in a specific database.
Args: database_id: The ID of the database to query.
Returns: Formatted markdown table showing table details.
Inputs: database_id (required). Returns: result
searchA
Search across Metabase entities by keyword.
Searches cards (questions), dashboards, collections, and tables for matching results.
Args: query: The search keyword or phrase. models: Optional filter for entity types (e.g., ["card", "dashboard", "collection", "table"]).
Returns: Dictionary containing search results with matched entities.
Inputs: query (required), models. Returns: object
update_cardA
Update an existing card/question in Metabase.
Args: card_id: The ID of the card to update. name: New name for the card. description: New description. query: New SQL query (requires database_id). database_id: Database ID for the query. collection_id: Move card to this collection. visualization_settings: New visualization configuration.
Returns: The updated card object.
Inputs: card_id (required), name, description, query, +3 more. Returns: object
update_dashboardA
Update an existing dashboard in Metabase.
Args: dashboard_id: The ID of the dashboard to update. name: New name for the dashboard. description: New description. collection_id: Move dashboard to this collection. parameters: New dashboard filter parameters.
Returns: The updated dashboard object.
Inputs: dashboard_id (required), name, description, collection_id, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool has a clearly distinct purpose. For example, list_cards vs get_card (list vs single), execute_card vs execute_query (saved vs ad-hoc), and get_collection_items vs list_collections (items vs collections themselves) are well-differentiated.
All tools follow a consistent verb_noun pattern in snake_case (e.g., list_cards, create_card, execute_query). The pattern is predictable and easy for an agent to infer.
With 22 tools covering cards, dashboards, collections, databases, schemas, tables, fields, search, and execution, the count is well-scoped for a Metabase management server—not too few nor too many.
Core entities like cards and dashboards have CRUD (except card hard delete), but collections lack update/delete and get_collection by ID. Database management is read-only. These gaps may require workarounds.
Maintenance
Related MCP Connectors
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
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-
- FlicenseBqualityDmaintenanceAn MCP server that provides AI assistants with full access to Apache Superset instances, enabling interaction with dashboards, charts, datasets, databases, and SQL execution capabilities.34-
- -licenseNot gradedqualityDmaintenanceAn MCP server that bridges AI assistants with SQL databases, enabling natural language querying across multiple database types with built-in optimization and security.3-
- AlicenseAqualityDmaintenanceA MCP server for Metabase that gives AI assistants direct access to dashboards, cards, and query execution.331MIT