How to integrate Metabase MCP with Claude Code

Framework Integration Gradient
Metabase Logo
Claude Code Logo
divider

Introduction

Manage your Metabase directly from Claude Code with zero worries about OAuth hassles, API-breaking issues, or reliability and security concerns.

You can do this in two different ways:

  1. Via Rube - Direct and easiest approach
  2. Via Composio SDK - Programmatic approach with more control

Why Rube?

Rube is a universal MCP server with access to 850+ SaaS apps. It ensures just-in-time tool loading so Claude can access the tools it needs, a remote workbench for programmatic tool calling and handling large tool responses out of the LLM context window, ensuring the LLM context window remains clean.

Connect Metabase to Claude Code with Rube

1. Get the MCP URL

Copy and paste the below command in Claude Code to add Rube MCP.

Terminal

2. Authenticate Rube

Run /mcp to view Rube

bash
/mcp
Run /mcp to view Rube in Claude Code
Click on Rube to authenticate
Authentication flow complete

3. Ensure it's connected

Run /mcp again to verify the connection. Now, do whatever you want with Claude Code and Metabase.

Rube connected successfully

Supported Tools & Triggers

Tools
Create BookmarkTool to create a new bookmark for a Metabase item (card, dashboard, collection, or dataset).
Create BookmarkTool to create a new bookmark for a Metabase item (card, dashboard, collection, or dataset).
Run Card Pivot QueryTool to run a pivot table query on a Metabase card (question).
Run Card QueryTool to run the query associated with a Card and return its results.
Copy DashboardTool to create a copy of an existing Metabase dashboard.
Run Dashboard Pivot DashCard QueryTool to run a pivot table query for a specific DashCard.
Save Dashboard to CollectionTool to save a denormalized dashboard description into a collection.
Discard Database Field ValuesTool to discard all saved field values for a specific database.
Dismiss Database Sync SpinnerTool to manually set the initial sync status of a Database and corresponding tables to complete.
Trigger Database Field Values RescanTool to trigger a manual scan of field values for a Database.
Trigger Database Schema SyncTool to trigger a manual update of the schema metadata for a Database.
Search Dataset Parameter ValuesTool to search for parameter values in datasets when editing cards or dashboards.
Create Field DimensionTool to set the dimension for a field at the specified ID in Metabase.
Discard Field ValuesTool to discard the FieldValues belonging to a Metabase field.
Update Field ValuesTool to update field values and human-readable values for a Field whose semantic type is category/city/state/country or whose base type is type/Boolean.
Unpersist CardTool to unpersist a Metabase card/model.
Disable Database Model PersistenceTool to disable model persistence for a Metabase database.
Discard Table Field ValuesTool to discard the FieldValues belonging to the Fields in a Metabase Table.
Rescan Table Field ValuesTool to manually trigger an update for FieldValues for Fields belonging to a specific Table.
Sync Table SchemaTool to trigger a manual update of the schema metadata for a specific Table.
Delete ActionTool to delete an Action from Metabase.
Delete ActionTool to delete a Metabase action by its ID.
Delete BookmarkTool to delete a bookmark from a Metabase item (card, dashboard, or collection).
Delete API CacheTool to delete/clear cached data in Metabase for specific entities.
Delete CardTool to delete a Metabase card (question) by its ID.
Delete DashboardTool to delete a Metabase dashboard by its ID.
Delete Model IndexTool to delete a Metabase model index by its ID.
Delete Timeline EventTool to delete a timeline event by ID.
Delete TimelineTool to delete a timeline by ID.
Delete User Key-ValueTool to delete a user key-value pair from Metabase.
Delete BookmarkTool to delete a bookmark by model and ID.
Delete CardTool to hard delete a Metabase card.
Delete DashboardTool to hard delete a Metabase dashboard by its ID.
Delete User SubscriptionsTool to delete all Alert and DashboardSubscription subscriptions for a User.
Delete Field DimensionTool to remove the dimension associated with a field at the specified ID.
Delete Glossary EntryTool to delete a glossary entry from Metabase.
Delete Glossary ItemTool to delete a glossary item by ID.
Delete Model IndexTool to delete a ModelIndex by ID from Metabase.
Delete TimelineTool to delete a Metabase timeline and cascade delete all its associated events.
Delete Timeline EventTool to delete a Metabase timeline event.
Delete User Key-Value PairTool to delete a user key-value pair by namespace and key.
Delete User SubscriptionsTool to delete all Alert and DashboardSubscription subscriptions for a User.
Get ActionTool to retrieve a Metabase action by ID.
Get Action Execute ParametersTool to fetch values for filling in action execution parameters.
Get all Metabase actionsTool to retrieve all actions available in the Metabase instance.
Get Popular ItemsTool to get the list of 5 popular items on the Metabase instance.
Get Recent Activity ViewsTool to retrieve recently viewed items in Metabase.
Get All AlertsTool to retrieve all alerts in Metabase.
Get Automagic Dashboard CandidatesTool to retrieve automagic dashboard candidates for a specific database.
Get Automagic Dashboard Cell AnalysisTool to return an automagic dashboard analyzing a specific cell in an entity's data.
Get Automagic Dashboard Cell Rule AnalysisTool to fetch an automagic dashboard analyzing a specific cell using a template rule.
Get Automagic Dashboard Query MetadataTool to retrieve all metadata for an automagic dashboard for the specified entity type and ID.
Get Automagic Dashboard with Rule and TemplateTool to retrieve an automagic dashboard for a specified entity using a specific rule prefix and dashboard template.
Get User BookmarksTool to retrieve all bookmarks for the authenticated user.
Get API CardTool to list all cards (questions) available to the authenticated user in Metabase.
Search Card Parameter ValuesTool to search for values of a specific parameter in a Metabase card.
Get Card by IDTool to retrieve a specific card (question) by its ID.
Get Card DashboardsTool to get a list of dashboards containing a specific card.
Get Card SeriesTool to retrieve series data for a specific card.
Get all collectionsTool to retrieve all collections that the current user has read permissions for.
Get Collection by IDTool to retrieve detailed information about a Metabase collection by its ID.
Get Collection ItemsTool to retrieve items from a specific Metabase collection.
Get Root CollectionTool to fetch the Root Collection and its top-level objects.
Get Collection TreeTool to retrieve the collection tree structure from Metabase.
Get Dashboard Parameter RemappingTool to get parameter remapping for a dashboard parameter value.
Get Dashboard Parameter ValuesTool to fetch available values for a specific dashboard parameter.
Get Dashboard Related EntitiesTool to retrieve related entities for a Metabase dashboard.
Get All DatabasesTool to retrieve a list of all Database instances configured in Metabase.
Get Database DetailsTool to retrieve complete details for a specific database in Metabase.
Get Database Autocomplete SuggestionsTool to retrieve autocomplete suggestions for table and field names in a database.
Get Database Card Autocomplete SuggestionsTool to get card autocomplete suggestions for a specific database in Metabase.
Get Database FieldsTool to retrieve all fields from a specific database in Metabase.
Check Database HealthTool to check the health status of a specific database connection in Metabase.
Get Database MetadataTool to retrieve complete metadata for a specific database including all tables and fields.
Get Virtual Database DatasetsTool to retrieve all datasets from a Metabase virtual database.
Get User Audit InfoTool to get audit info for the current authenticated user.
Get Billing API VersionTool to retrieve the billing API version information for the Metabase Enterprise Edition instance.
Get Resource DependentsTool to get dependents of a resource in Metabase's dependency graph.
Get Embedding Hub ChecklistTool to retrieve the embedding hub checklist status for Metabase Enterprise Edition.
Get Current Remote Sync TaskTool to retrieve the current remote sync task status in Metabase.
Get Stale Data By IDTool to retrieve stale data information by ID from Metabase Enterprise Edition.
Get Uploaded TablesTool to retrieve all uploaded tables in Metabase Enterprise Edition.
Get Field Related EntitiesTool to retrieve related entities for a Metabase field.
Search Field ValuesTool to search for field values in Metabase that start with a given string.
Get Field ValuesTool to retrieve distinct values for a Metabase field.
Get API GlossaryTool to retrieve all glossary items from Metabase.
Get Current User Login HistoryTool to retrieve login history for the currently authenticated user.
Get Model Index ValuesTool to retrieve indexed field values for a specific Metabase model.
Get Model Index DetailsTool to retrieve details of a specific model index by its ID.
Get all native query snippetsTool to retrieve all native query snippets available in the Metabase instance.
Get Native Query Snippet by IDTool to retrieve a specific native query snippet by its ID.
Get NotificationsTool to retrieve notifications from Metabase with optional filtering.
Get Public Card by UUIDTool to fetch a publicly-accessible card by its public UUID and return card information including query definition, visualization settings, and parameters.
Get Public oEmbed MetadataTool to get oEmbed metadata for public Metabase resources.
Get Public Pivot Card QueryTool to fetch a publicly-accessible pivot card and return query results including data rows, column metadata, and query status.
Get All PulsesTool to retrieve all pulses (scheduled reports/subscriptions) in Metabase.
Get Pulse Form Input ConfigurationTool to retrieve configuration information for creating or updating Pulses (scheduled email reports).
Get Pulse by IDTool to retrieve a specific pulse (subscription) by its ID.
Get Pulse Preview CardTool to retrieve the HTML preview of a Metabase card formatted for pulse emails.
Get Pulse Preview Card InfoTool to retrieve preview information for a Metabase card formatted for pulse emails.
Get Pulse Preview DashboardTool to retrieve the pulse preview for a specific dashboard by its ID.
Get Revision by ID and EntityTool to retrieve a specific revision by ID and entity type.
Get Entity Revision HistoryTool to retrieve the revision history for a Metabase entity (dashboard, card, metric, or segment).
Search Metabase objectsTool to search Cards, Dashboards, Collections, Tables, Databases, and Pulses for a substring.
Get Search WeightsTool to retrieve the current search weight configuration for the Metabase instance.
Get All SegmentsTool to retrieve all segments from Metabase.
Validate Password Reset TokenTool to validate a password reset token in Metabase.
Get Session PropertiesTool to retrieve all global session properties and their values that are public.
Get Card Table Foreign KeysTool to retrieve foreign key relationships for a card-based virtual table.
Get Card Virtual Table Query MetadataTool to retrieve metadata for a virtual table created from a card (saved question).
Get Table Foreign KeysTool to retrieve foreign key relationships for a Metabase table.
Get Table Query MetadataTool to retrieve metadata about a table useful for running queries.
Get Table Data by IDTool to retrieve data from a specific Metabase table by ID.
Get All TimelinesTool to retrieve all timelines in Metabase.
Get Collection TimelinesTool to retrieve timelines associated with a specific Metabase collection.
Get Root Collection TimelinesTool to retrieve all timelines associated with the root collection.
Get Timeline EventTool to retrieve a timeline event by ID.
Get Timeline by IDTool to fetch a timeline by its ID from Metabase.
Get Current UserTool to retrieve information about the currently authenticated user.
Get User by IDTool to retrieve a specific user by their ID.
Get User Key-Value by NamespaceTool to retrieve all user key-value pairs for a specified namespace.
Get User RecipientsTool to retrieve users for recipient selection.
Generate Random Security TokenTool to generate a cryptographically secure random token for Metabase.
Get Automagic DashboardTool to generate an automagic dashboard for a given entity.
Get Automagic DashboardTool to retrieve an automagic dashboard for a specified entity with its ID.
Get Automagic Dashboard Cell AnalysisTool to return an automagic dashboard analyzing a specific cell in an entity's data.
Get Automagic Dashboard Cell RuleTool to fetch an automagic dashboard analyzing a specific cell in a table or query.
Get Automagic Dashboards CompareTool to return an automagic comparison dashboard for entity with id compared with comparison-entity with comparison-entity-id-or-query.
Get Automagic Dashboard Query MetadataTool to retrieve all metadata for an automagic dashboard for a specific entity and ID.
Get automagic dashboard by ruleTool to return an automagic dashboard for a specific entity using a dashboard template with rule prefix.
Get Card DashboardsTool to get a list of dashboards that a specific card appears in.
Search Card Parameter ValuesTool to fetch possible values for a card parameter that match a search query.
Get Card Query MetadataTool to get comprehensive query metadata for a Metabase card (saved question).
Get Card SeriesTool to fetch a list of cards compatible as series with a specified card.
Get Collection by IDTool to fetch a specific Metabase collection with standard details added.
Get Collection ItemsTool to fetch items from a specific Metabase collection.
Get Automagic Comparison DashboardTool to retrieve an automagic comparison dashboard comparing a cell in one entity with another entity.
Get Dashboard by IDTool to retrieve details of a specific Metabase dashboard by ID.
Get Dashboard by IDTool to retrieve a dashboard by its ID from Metabase.
Search dashboard parameter valuesTool to search for dashboard parameter values in Metabase.
Get Dashboard Params RemappingTool to fetch the remapped value for a given dashboard parameter in Metabase.
Search Dashboard Parameter ValuesTool to fetch possible values of a dashboard parameter that contain the search query.
Get Dashboard Query MetadataTool to get all of the required query metadata for the cards on a dashboard.
Get Dashboard Related EntitiesTool to retrieve related entities for a Metabase dashboard.
Get Database Autocomplete SuggestionsTool to get autocomplete suggestions for table and field names in a Metabase database.
Get Database By IDTool to retrieve a single database by ID from Metabase.
Get Database Card Autocomplete SuggestionsTool to return a list of Card autocomplete suggestions for a given query in a given Database.
Get Database DatasetsTool to retrieve tables (models and metrics) from a virtual database schema in Metabase.
Get Database FieldsTool to retrieve all field metadata from a Metabase database.
Get Database HealthcheckTool to check if a Metabase database can currently connect.
Get Database MetadataTool to retrieve complete metadata for a specific database including all tables and fields.
Get Database SchemasTool to retrieve all schemas with tables for a specific database in Metabase.
Get Database Settings AvailableTool to get all database-local settings and their availability for a given database.
Get Database Syncable SchemasTool to retrieve all syncable schemas for a specific database in Metabase.
Get Stale Entities from CollectionTool to retrieve stale entities (cards and dashboards) from a Metabase collection that haven't been used recently.
Get Field RemappingTool to fetch remapped field values for a specific field in Metabase.
Get Field SummaryTool to get summary statistics for a Metabase field by its ID.
Get ModelIndex by IDTool to retrieve a ModelIndex by ID.
Get Most Recently Viewed DashboardTool to retrieve the most recently viewed dashboard for the authenticated user.
Get Native Query Snippet by IDTool to retrieve a specific native query snippet by its ID.
Get Pulse Preview CardTool to get HTML rendering of a Metabase card by ID.
Get Pulse Preview Card InfoTool to get JSON object containing HTML rendering of a card and additional information.
Get Dashboard HTML PreviewTool to retrieve an HTML preview rendering of a dashboard.
Get Revision History by IDTool to retrieve the complete revision history for a Metabase entity by its ID.
Get Table By IDTool to retrieve basic table information by ID from Metabase.
Get Table DataTool to retrieve data from a specific table in Metabase.
Get Table Foreign KeysTool to get all foreign keys whose destination is a field that belongs to a specific table.
Get Table Query MetadataTool to get metadata about a Table useful for running queries.
Get Timeline by IDTool to fetch a timeline by its ID.
Get Collection TimelinesTool to fetch timelines associated with a specific Metabase collection.
Get Timeline EventTool to fetch a timeline event by ID.
Get User by IDTool to fetch a Metabase user by their ID.
Get User Key-Value SettingTool to retrieve a user-specific key-value pair from Metabase storage.
Get All User Key-Values in NamespaceTool to retrieve all key-value pairs in a given namespace for the current user.
Get User Key-Value SettingTool to retrieve a user-specific key-value pair from Metabase storage.
Record Recent ActivityTool to record recent activity for a Metabase item.
Create BookmarkTool to create a bookmark for a Metabase item (card, dashboard, or collection).
Create CardTool to create a new Metabase card (question or model).
Execute Card QueryTool to execute a query for a saved Metabase card/question and retrieve results.
Bulk Move Cards to CollectionTool to bulk move multiple Metabase cards into a target collection or remove them from collections.
Copy CardTool to create a copy of an existing Metabase card (question) by its ID.
Execute Pivot Card QueryTool to execute a pivot query on a Metabase card and return the results.
Get Card Dashboard AssociationsTool to retrieve dashboard associations for given card IDs.
Bulk Move CardsTool to bulk move cards to a collection or remove them from collections.
Create CollectionTool to create a new Metabase collection for organizing content.
Create DashboardTool to create a new Metabase dashboard.
Copy DashboardTool to copy an existing Metabase dashboard.
Execute Dashboard Pivot QueryTool to execute a pivot table query for a specific card on a dashboard.
Create Dashboard in CollectionTool to create a new dashboard in a specific Metabase collection.
Discard Database Field ValuesTool to discard all saved field values for a specific database.
Dismiss Database SpinnerTool to dismiss the spinner for a specific database.
Rescan Database Field ValuesTool to trigger a manual rescan of field values for a specific database.
Sync Database SchemaTool to trigger a schema synchronization for a specific database.
Execute Dataset QueryTool to execute a query against a Metabase database and retrieve results.
Convert Query to Native SQLTool to convert a Metabase query to native SQL format.
Remap Dataset Parameter ValueTool to remap dataset parameter values in Metabase.
Get Dataset Parameter ValuesTool to fetch parameter values for dataset fields in Metabase.
Execute Pivot Table QueryTool to execute a pivot table query and retrieve results.
Get Dataset Query MetadataTool to retrieve query metadata for a dataset query including databases, tables, fields, and snippets.
Check Snippet DependenciesTool to check dependencies for a native query snippet in Metabase Enterprise Edition.
Create Dashboard SubscriptionTool to create a dashboard subscription using Metabot tools.
Filter RecordsTool to filter records from a Metabase data source using metabot tools.
Generate InsightsTool to generate insights for a table using Metabot tools.
Get Current UserTool to retrieve information about the current authenticated user in a Metabase metabot conversation.
Get Dashboard DetailsTool to retrieve dashboard details for a Metabase metabot conversation.
Get Document Details via MetabotTool to retrieve document details using Metabase metabot tools.
Get Query DetailsTool to get query details using Metabot tools API.
Get Snippet DetailsTool to retrieve SQL snippet details via Metabase metabot tools.
Get Metabot SnippetsTool to retrieve SQL snippets for a Metabase metabot conversation.
Get Table DetailsTool to retrieve comprehensive table details via Metabase metabot tools.
Query Datasource via MetabotTool to query a Metabase datasource using Metabot tools.
Metabot SearchTool to search Metabase entities using the metabot search API.
Search Metabase Items (Metabot V2)Tool to search Metabase items using the Metabot search v2 endpoint.
Cancel Current Remote Sync TaskTool to cancel the current active Remote Sync task in Metabase Enterprise Edition.
Translate Entity IDsTool to translate Metabase entity IDs (21-character strings) to their numeric IDs.
Discard Field ValuesTool to discard cached FieldValues for a specific field.
Rescan Field ValuesTool to manually trigger an update for the FieldValues for a specific field.
Create Glossary EntryTool to create a new glossary entry in Metabase.
Create Model IndexTool to create a new model index in Metabase.
Create native query snippetTool to create a new native query snippet in Metabase.
Create NotificationTool to create a new notification in Metabase.
Send NotificationTool to trigger sending an unsaved notification in Metabase.
Unpersist CardTool to unpersist a Metabase card by its ID.
Unpersist DatabaseTool to disable model persistence for a specific database.
Submit Product FeedbackTool to submit product feedback to Metabase.
Create PulseTool to create a new pulse (scheduled report/subscription) in Metabase.
Revert Entity to Previous RevisionTool to revert a Metabase entity (card, dashboard, document, or segment) to a previous revision.
Send Password Reset EmailTool to send a password reset email when user has forgotten their password.
Check Password ComplexityTool to check if a password meets Metabase's configured password complexity rules.
Submit Bug Report to SlackTool to submit a bug report to Slack via Metabase's bug reporting endpoint.
Discard Table Field ValuesTool to discard cached FieldValues for all Fields belonging to a specific Table.
Rescan Table Field ValuesTool to trigger a manual rescan of field values for a specific table.
Sync Table SchemaTool to trigger a manual update of the schema metadata for a specific Table.
Create TimelineTool to create a new timeline in Metabase.
Execute Dashboard Card QueryTool to execute a query for a specific card within a dashcard on a dashboard.
Update Action by IDTool to update an existing Metabase action by its ID.
Update Bookmark OrderingTool to update the order of bookmarks for the authenticated user.
Update Card by IDTool to update a specific card (question) by its ID.
Update Collection by IDTool to update an existing Metabase collection by its ID.
Update DashboardTool to update a Metabase dashboard by its ID.
Update Dashboard CardsTool to update dashboard cards and tabs.
Update Database ConfigurationTool to update a database configuration in Metabase.
Update Field MetadataTool to update a Metabase field by its ID.
Update Glossary Entry by IDTool to update an existing glossary entry in Metabase by its ID.
Update Native Query Snippet by IDTool to update an existing native query snippet by its ID.
Update Pulse by IDTool to update an existing pulse (scheduled report/subscription) by ID.
Update Search WeightsTool to update search weights configuration in Metabase.
Update Table MetadataTool to update a Metabase table by its ID.
Update Table MetadataTool to update a Metabase table metadata by its ID.
Update Table Field Display OrderTool to update the display order of fields in a Metabase table.
Update Timeline Event by IDTool to update an existing timeline event by its ID.
Update Timeline by IDTool to update an existing timeline by its ID.
Update User by IDTool to update an existing Metabase user by their ID.
Update ActionTool to update an existing Action in Metabase.
Update CollectionTool to update an existing Metabase collection.
Update DashboardTool to update a Metabase dashboard by ID.
Update Dashboard Cards (Deprecated)Tool to bulk update dashboard cards and tabs.
Update DatabaseTool to update a Database in Metabase.
Update Field MetadataTool to update metadata for a Metabase field by its ID.
Update Glossary EntryTool to update an existing glossary entry in Metabase.
Update Native Query SnippetTool to update an existing native query snippet by ID.
Update PulseTool to update an existing pulse (scheduled report/subscription) by ID.
Update Table by IDTool to update a Table in Metabase by its ID.
Update Table Fields OrderTool to reorder fields in a Metabase table.
Update TimelineTool to update a Metabase timeline by its ID.
Update Timeline EventTool to update an existing Metabase timeline event by its ID.

What is the Metabase MCP server, and what's possible with it?

The Metabase MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Metabase account. It provides structured and secure access so your agent can perform Metabase operations on your behalf.

Connecting Metabase via Tool Router

Tool Router is the underlying tech that powers Rube. It's a universal gateway that does everything Rube does but with much more programmatic control. You can programmatically generate an MCP URL with the app you need (here Metabase) for even more tool search precision. It's secure and reliable.

How the Tool Router works

The Tool Router follows a three-phase workflow:

  1. Discovery: Searches for tools matching your task and returns relevant toolkits with their details.
  2. Authentication: Checks for active connections. If missing, creates an auth config and returns a connection URL via Auth Link.
  3. Execution: Executes the action using the authenticated connection.

Step-by-step Guide

Prerequisites

Before starting, make sure you have:
  • Claude Pro, Max, or API billing enabled Anthropic account
  • Composio API Key
  • A Metabase account
  • Basic knowledge of Python or TypeScript

Install Claude Code

bash
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

# Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

To install Claude Code, use one of the following methods based on your operating system:

Set up Claude Code

bash
cd your-project-folder
claude

Open a terminal, go to your project folder, and start Claude Code:

  • Claude Code will open in your terminal
  • Follow the prompts to sign in with your Anthropic account
  • Complete the authentication flow
  • Once authenticated, you can start using Claude Code
Claude Code initial setup showing sign-in prompt
Claude Code terminal after successful login

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_user_id_here

Create a .env file in your project root with the following variables:

  • COMPOSIO_API_KEY authenticates with Composio (get it from Composio dashboard)
  • USER_ID identifies the user for session management (use any unique identifier)

Install Composio library

pip install composio-core python-dotenv

Install the Composio Python library to create MCP sessions.

  • composio-core provides the core Composio functionality
  • python-dotenv loads environment variables from your .env file

Generate Composio MCP URL

import os
from composio import Composio
from dotenv import load_dotenv

load_dotenv()

COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
USER_ID = os.getenv("USER_ID")

composio_client = Composio(api_key=COMPOSIO_API_KEY)

composio_session = composio_client.create(
    user_id=USER_ID,
    toolkits=["metabase"],
)

COMPOSIO_MCP_URL = composio_session.mcp.url

print(f"MCP URL: {COMPOSIO_MCP_URL}")
print(f"\nUse this command to add to Claude Code:")
print(f'claude mcp add --transport http metabase-composio "{COMPOSIO_MCP_URL}" --headers "X-API-Key:{COMPOSIO_API_KEY}"')

Create a script to generate a Composio MCP URL for Metabase. This URL will be used to connect Claude Code to Metabase.

What's happening:

  • We import the Composio client and load environment variables
  • Create a Composio instance with your API key
  • Call create() to create a Tool Router session for Metabase
  • The returned mcp.url is the MCP server URL that Claude Code will use
  • The script prints this URL so you can copy it

Run the script and copy the MCP URL

python generate_mcp_url.py

Run your Python script to generate the MCP URL.

  • The script connects to Composio and creates a Tool Router session
  • It prints the MCP URL and the exact command you need to run
  • Copy the entire claude mcp add command from the output

Add Metabase MCP to Claude Code

bash
claude mcp add --transport http metabase-composio "YOUR_MCP_URL_HERE" --headers "X-API-Key:YOUR_COMPOSIO_API_KEY"

# Then restart Claude Code
exit
claude

In your terminal, add the MCP server using the command from the previous step. The command format is:

  • claude mcp add registers a new MCP server with Claude Code
  • --transport http specifies that this is an HTTP-based MCP server
  • The server name (metabase-composio) is how you'll reference it
  • The URL points to your Composio Tool Router session
  • --headers includes your Composio API key for authentication

After running the command, close the current Claude Code session and start a new one for the changes to take effect.

Verify the installation

bash
claude mcp list

Check that your Metabase MCP server is properly configured.

  • This command lists all MCP servers registered with Claude Code
  • You should see your metabase-composio entry in the list
  • This confirms that Claude Code can now access Metabase tools

If everything is wired up, you should see your metabase-composio entry listed:

Claude Code MCP list showing the toolkit MCP server

Authenticate Metabase

The first time you try to use Metabase tools, you'll be prompted to authenticate.

  • Claude Code will detect that you need to authenticate with Metabase
  • It will show you an authentication link
  • Open the link in your browser (or copy/paste it)
  • Complete the Metabase authorization flow
  • Return to the terminal and start using Metabase through Claude Code

Once authenticated, you can ask Claude Code to perform Metabase operations in natural language. For example:

  • "Get all charts from marketing dashboard"
  • "Run SQL query for revenue last quarter"
  • "Share dashboard link with analytics team"

Complete Code

Here's the complete code to get you started with Metabase and Claude Code:

import os
from composio import Composio
from dotenv import load_dotenv

load_dotenv()

COMPOSIO_API_KEY = os.getenv("COMPOSIO_API_KEY")
USER_ID = os.getenv("USER_ID")

composio_client = Composio(api_key=COMPOSIO_API_KEY)

composio_session = composio_client.create(
    user_id=USER_ID,
    toolkits=["metabase"],
)

COMPOSIO_MCP_URL = composio_session.mcp.url

print(f"MCP URL: {COMPOSIO_MCP_URL}")
print(f"\nUse this command to add to Claude Code:")
print(f'claude mcp add --transport http metabase-composio "{COMPOSIO_MCP_URL}" --headers "X-API-Key:{COMPOSIO_API_KEY}"')

Conclusion

You've successfully integrated Metabase with Claude Code using Composio's MCP server. Now you can interact with Metabase directly from your terminal using natural language commands.

Key features of this setup:

  • Terminal-native experience without switching contexts
  • Natural language commands for Metabase operations
  • Secure authentication through Composio's managed MCP
  • Tool Router for dynamic tool discovery and execution

Next steps:

  • Try asking Claude Code to perform various Metabase operations
  • Add more toolkits to your Tool Router session for multi-app workflows
  • Integrate this setup into your development workflow for increased productivity

You can extend this by adding more toolkits, implementing custom workflows, or building automation scripts that leverage Claude Code's capabilities.

How to build Metabase MCP Agent with another framework

FAQ

What are the differences in Tool Router MCP and Metabase MCP?

With a standalone Metabase MCP server, the agents and LLMs can only access a fixed set of Metabase tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from Metabase and many other apps based on the task at hand, all through a single MCP endpoint.

Can I use Tool Router MCP with Claude Code?

Yes, you can. Claude Code fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right Metabase tools.

Can I manage the permissions and scopes for Metabase while using Tool Router?

Yes, absolutely. You can configure which Metabase scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

How safe is my data with Composio Tool Router?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Metabase data and credentials are handled as safely as possible.

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.