How to integrate Metabase MCP with Vercel AI SDK v6

This guide walks you through connecting Metabase to Vercel AI SDK v6 using the Composio tool router. By the end, you'll have a working Metabase agent that can get all charts from marketing dashboard, run sql query for revenue last quarter, share dashboard link with analytics team through natural language commands. This guide will help you understand how to give your Vercel AI SDK agent real control over a Metabase account through Composio's Metabase MCP server. Before we dive in, let's take a quick look at the key ideas and tools involved.

Metabase logoMetabase
Api Key

Metabase is an open-source business intelligence tool for visualizing and querying data. It helps teams turn raw data into insightful dashboards and charts, fast.

266 Tools

Introduction

This guide walks you through connecting Metabase to Vercel AI SDK v6 using the Composio tool router. By the end, you'll have a working Metabase agent that can get all charts from marketing dashboard, run sql query for revenue last quarter, share dashboard link with analytics team through natural language commands.

This guide will help you understand how to give your Vercel AI SDK agent real control over a Metabase account through Composio's Metabase MCP server.

Before we dive in, let's take a quick look at the key ideas and tools involved.

Also integrate Metabase with

TL;DR

Here's what you'll learn:
  • How to set up and configure a Vercel AI SDK agent with Metabase integration
  • Using Composio's Tool Router to dynamically load and access Metabase tools
  • Creating an MCP client connection using HTTP transport
  • Building an interactive CLI chat interface with conversation history management
  • Handling tool calls and results within the Vercel AI SDK framework

What is Vercel AI SDK?

The Vercel AI SDK is a TypeScript library for building AI-powered applications. It provides tools for creating agents that can use external services and maintain conversation state.

Key features include:

  • streamText: Core function for streaming responses with real-time tool support
  • MCP Client: Built-in support for Model Context Protocol via @ai-sdk/mcp
  • Step Counting: Control multi-step tool execution with stopWhen: stepCountIs()
  • OpenAI Provider: Native integration with OpenAI models

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.

What is the Composio tool router, and how does it fit here?

What is Composio SDK?

Composio's Composio SDK helps agents find the right tools for a task at runtime. You can plug in multiple toolkits (like Gmail, HubSpot, and GitHub), and the agent will identify the relevant app and action to complete multi-step workflows. This can reduce token usage and improve the reliability of tool calls. Read more here: Getting started with Composio SDK

The tool router generates a secure MCP URL that your agents can access to perform actions.

How the Composio SDK works

The Composio SDK 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

Step by step09 STEPS
1

Prerequisites

Before you begin, make sure you have:
  • Node.js and npm installed
  • A Composio account with API key
  • An OpenAI API key
2

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard and create an API key. You'll need credits to use the models, or you can connect to another model provider.
  • Keep the API key safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Navigate to your API settings and generate a new API key.
  • Store this key securely as you'll need it for authentication.
3

Install required dependencies

bash
npm install @ai-sdk/openai @ai-sdk/mcp @composio/core ai dotenv

First, install the necessary packages for your project.

What you're installing:

  • @ai-sdk/openai: Vercel AI SDK's OpenAI provider
  • @ai-sdk/mcp: MCP client for Vercel AI SDK
  • @composio/core: Composio SDK for tool integration
  • ai: Core Vercel AI SDK
  • dotenv: Environment variable management
4

Set up environment variables

bash
OPENAI_API_KEY=your_openai_api_key_here
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_user_id_here

Create a .env file in your project root.

What's needed:

  • OPENAI_API_KEY: Your OpenAI API key for GPT model access
  • COMPOSIO_API_KEY: Your Composio API key for tool access
  • COMPOSIO_USER_ID: A unique identifier for the user session
5

Import required modules and validate environment

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Composio } from "@composio/core";
import * as readline from "readline";
import { streamText, type ModelMessage, stepCountIs } from "ai";
import { createMCPClient } from "@ai-sdk/mcp";

const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!process.env.OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey,
});
What's happening:
  • We're importing all necessary libraries including Vercel AI SDK's OpenAI provider and Composio
  • The dotenv/config import automatically loads environment variables
  • The MCP client import enables connection to Composio's tool server
6

Create Tool Router session and initialize MCP client

typescript
async function main() {
  // Create a tool router session for the user
  const session = await composio.create(composioUserID!, {
    toolkits: ["metabase"],
  });

  const mcpUrl = session.mcp.url;
What's happening:
  • We're creating a Tool Router session that gives your agent access to Metabase tools
  • The create method takes the user ID and specifies which toolkits should be available
  • The returned mcp object contains the URL and authentication headers needed to connect to the MCP server
  • This session provides access to all Metabase-related tools through the MCP protocol
7

Connect to MCP server and retrieve tools

typescript
const mcpClient = await createMCPClient({
  transport: {
    type: "http",
    url: mcpUrl,
    headers: session.mcp.headers, // Authentication headers for the Composio MCP server
  },
});

const tools = await mcpClient.tools();
What's happening:
  • We're creating an MCP client that connects to our Composio Tool Router session via HTTP
  • The mcp.url provides the endpoint, and mcp.headers contains authentication credentials
  • The type: "http" is important - Composio requires HTTP transport
  • tools() retrieves all available Metabase tools that the agent can use
8

Initialize conversation and CLI interface

typescript
let messages: ModelMessage[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
console.log(
  "Ask any questions related to metabase, like summarize my last 5 emails, send an email, etc... :)))\n",
);

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: "> ",
});

rl.prompt();
What's happening:
  • We initialize an empty messages array to maintain conversation history
  • A readline interface is created to accept user input from the command line
  • Instructions are displayed to guide the user on how to interact with the agent
9

Handle user input and stream responses with real-time tool feedback

typescript
rl.on("line", async (userInput: string) => {
  const trimmedInput = userInput.trim();

  if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
    console.log("\nGoodbye!");
    rl.close();
    process.exit(0);
  }

  if (!trimmedInput) {
    rl.prompt();
    return;
  }

  messages.push({ role: "user", content: trimmedInput });
  console.log("\nAgent is thinking...\n");

  try {
    const stream = streamText({
      model: openai("gpt-5"),
      messages,
      tools,
      toolChoice: "auto",
      stopWhen: stepCountIs(10),
      onStepFinish: (step) => {
        for (const toolCall of step.toolCalls) {
          console.log(`[Using tool: ${toolCall.toolName}]`);
          }
          if (step.toolCalls.length > 0) {
            console.log(""); // Add space after tool calls
          }
        },
      });

      for await (const chunk of stream.textStream) {
        process.stdout.write(chunk);
      }

      console.log("\n\n---\n");

      // Get final result for message history
      const response = await stream.response;
      if (response?.messages?.length) {
        messages.push(...response.messages);
      }
    } catch (error) {
      console.error("\nAn error occurred while talking to the agent:");
      console.error(error);
      console.log(
        "\nYou can try again or restart the app if it keeps happening.\n",
      );
    } finally {
      rl.prompt();
    }
  });

  rl.on("close", async () => {
    await mcpClient.close();
    console.log("\n👋 Session ended.");
    process.exit(0);
  });
}

main().catch((err) => {
  console.error("Fatal error:", err);
  process.exit(1);
});
What's happening:
  • We use streamText instead of generateText to stream responses in real-time
  • toolChoice: "auto" allows the model to decide when to use Metabase tools
  • stopWhen: stepCountIs(10) allows up to 10 steps for complex multi-tool operations
  • onStepFinish callback displays which tools are being used in real-time
  • We iterate through the text stream to create a typewriter effect as the agent responds
  • The complete response is added to conversation history to maintain context
  • Errors are caught and displayed with helpful retry suggestions

Complete Code

Here's the complete code to get you started with Metabase and Vercel AI SDK:

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Composio } from "@composio/core";
import * as readline from "readline";
import { streamText, type ModelMessage, stepCountIs } from "ai";
import { createMCPClient } from "@ai-sdk/mcp";

const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!process.env.OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey,
});

async function main() {
  // Create a tool router session for the user
  const session = await composio.create(composioUserID!, {
    toolkits: ["metabase"],
  });

  const mcpUrl = session.mcp.url;

  const mcpClient = await createMCPClient({
    transport: {
      type: "http",
      url: mcpUrl,
      headers: session.mcp.headers, // Authentication headers for the Composio MCP server
    },
  });

  const tools = await mcpClient.tools();

  let messages: ModelMessage[] = [];

  console.log("Chat started! Type 'exit' or 'quit' to end the conversation.\n");
  console.log(
    "Ask any questions related to metabase, like summarize my last 5 emails, send an email, etc... :)))\n",
  );

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: "> ",
  });

  rl.prompt();

  rl.on("line", async (userInput: string) => {
    const trimmedInput = userInput.trim();

    if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
      console.log("\nGoodbye!");
      rl.close();
      process.exit(0);
    }

    if (!trimmedInput) {
      rl.prompt();
      return;
    }

    messages.push({ role: "user", content: trimmedInput });
    console.log("\nAgent is thinking...\n");

    try {
      const stream = streamText({
        model: openai("gpt-5"),
        messages,
        tools,
        toolChoice: "auto",
        stopWhen: stepCountIs(10),
        onStepFinish: (step) => {
          for (const toolCall of step.toolCalls) {
            console.log(`[Using tool: ${toolCall.toolName}]`);
          }
          if (step.toolCalls.length > 0) {
            console.log(""); // Add space after tool calls
          }
        },
      });

      for await (const chunk of stream.textStream) {
        process.stdout.write(chunk);
      }

      console.log("\n\n---\n");

      // Get final result for message history
      const response = await stream.response;
      if (response?.messages?.length) {
        messages.push(...response.messages);
      }
    } catch (error) {
      console.error("\nAn error occurred while talking to the agent:");
      console.error(error);
      console.log(
        "\nYou can try again or restart the app if it keeps happening.\n",
      );
    } finally {
      rl.prompt();
    }
  });

  rl.on("close", async () => {
    await mcpClient.close();
    console.log("\n👋 Session ended.");
    process.exit(0);
  });
}

main().catch((err) => {
  console.error("Fatal error:", err);
  process.exit(1);
});

Conclusion

You've successfully built a Metabase agent using the Vercel AI SDK with streaming capabilities! This implementation provides a powerful foundation for building AI applications with natural language interfaces and real-time feedback.

Key features of this implementation:

  • Real-time streaming responses for a better user experience with typewriter effect
  • Live tool execution feedback showing which tools are being used as the agent works
  • Dynamic tool loading through Composio's Tool Router with secure authentication
  • Multi-step tool execution with configurable step limits (up to 10 steps)
  • Comprehensive error handling for robust agent execution
  • Conversation history maintenance for context-aware responses

You can extend this further by adding custom error handling, implementing specific business logic, or integrating additional Composio toolkits to create multi-app workflows.
TOOLS

Supported Tools

Every Metabase action and event your agent gets out of the box.

Create Bookmark

Tool to create a new bookmark for a Metabase item (card, dashboard, collection, or dataset).

Create Bookmark

Tool to create a new bookmark for a Metabase item (card, dashboard, collection, or dataset).

Run Card Pivot Query

Tool to run a pivot table query on a Metabase card (question).

Run Card Query

Tool to run the query associated with a Card and return its results.

Copy Dashboard

Tool to create a copy of an existing Metabase dashboard.

Run Dashboard Pivot DashCard Query

Tool to run a pivot table query for a specific DashCard.

Save Dashboard to Collection

Tool to save a denormalized dashboard description into a collection.

Discard Database Field Values

Tool to discard all saved field values for a specific database.

Dismiss Database Sync Spinner

Tool to manually set the initial sync status of a Database and corresponding tables to complete.

Trigger Database Field Values Rescan

Tool to trigger a manual scan of field values for a Database.

Trigger Database Schema Sync

Tool to trigger a manual update of the schema metadata for a Database.

Search Dataset Parameter Values

Tool to search for parameter values in datasets when editing cards or dashboards.

Create Field Dimension

Tool to set the dimension for a field at the specified ID in Metabase.

Discard Field Values

Tool to discard the FieldValues belonging to a Metabase field.

Update Field Values

Tool 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 Card

Tool to unpersist a Metabase card/model.

Disable Database Model Persistence

Tool to disable model persistence for a Metabase database.

Discard Table Field Values

Tool to discard the FieldValues belonging to the Fields in a Metabase Table.

Rescan Table Field Values

Tool to manually trigger an update for FieldValues for Fields belonging to a specific Table.

Sync Table Schema

Tool to trigger a manual update of the schema metadata for a specific Table.

Delete Action

Tool to delete an Action from Metabase.

Delete Action

Tool to delete a Metabase action by its ID.

Delete Bookmark

Tool to delete a bookmark from a Metabase item (card, dashboard, or collection).

Delete API Cache

Tool to delete/clear cached data in Metabase for specific entities.

Delete Card

Tool to delete a Metabase card (question) by its ID.

Delete Dashboard

Tool to delete a Metabase dashboard by its ID.

Delete Model Index

Tool to delete a Metabase model index by its ID.

Delete Timeline Event

Tool to delete a timeline event by ID.

Delete Timeline

Tool to delete a timeline by ID.

Delete User Key-Value

Tool to delete a user key-value pair from Metabase.

Delete Bookmark

Tool to delete a bookmark by model and ID.

Delete Card

Tool to hard delete a Metabase card.

Delete Dashboard

Tool to hard delete a Metabase dashboard by its ID.

Delete User Subscriptions

Tool to delete all Alert and DashboardSubscription subscriptions for a User.

Delete Field Dimension

Tool to remove the dimension associated with a field at the specified ID.

Delete Glossary Entry

Tool to delete a glossary entry from Metabase.

Delete Glossary Item

Tool to delete a glossary item by ID.

Delete Model Index

Tool to delete a ModelIndex by ID from Metabase.

Delete Timeline

Tool to delete a Metabase timeline and cascade delete all its associated events.

Delete Timeline Event

Tool to delete a Metabase timeline event.

Delete User Key-Value Pair

Tool to delete a user key-value pair by namespace and key.

Delete User Subscriptions

Tool to delete all Alert and DashboardSubscription subscriptions for a User.

Get Action

Tool to retrieve a Metabase action by ID.

Get Action Execute Parameters

Tool to fetch values for filling in action execution parameters.

Get all Metabase actions

Tool to retrieve all actions available in the Metabase instance.

Get Popular Items

Tool to get the list of 5 popular items on the Metabase instance.

Get Recent Activity Views

Tool to retrieve recently viewed items in Metabase.

Get All Alerts

Tool to retrieve all alerts in Metabase.

Get Automagic Dashboard Candidates

Tool to retrieve automagic dashboard candidates for a specific database.

Get Automagic Dashboard Cell Analysis

Tool to return an automagic dashboard analyzing a specific cell in an entity's data.

Get Automagic Dashboard Cell Rule Analysis

Tool to fetch an automagic dashboard analyzing a specific cell using a template rule.

Get Automagic Dashboard Query Metadata

Tool to retrieve all metadata for an automagic dashboard for the specified entity type and ID.

Get Automagic Dashboard with Rule and Template

Tool to retrieve an automagic dashboard for a specified entity using a specific rule prefix and dashboard template.

Get User Bookmarks

Tool to retrieve all bookmarks for the authenticated user.

Get API Card

Tool to list all cards (questions) available to the authenticated user in Metabase.

Search Card Parameter Values

Tool to search for values of a specific parameter in a Metabase card.

Get Card by ID

Tool to retrieve a specific card (question) by its ID.

Get Card Dashboards

Tool to get a list of dashboards containing a specific card.

Get Card Series

Tool to retrieve series data for a specific card.

Get all collections

Tool to retrieve all collections that the current user has read permissions for.

Get Collection by ID

Tool to retrieve detailed information about a Metabase collection by its ID.

Get Collection Items

Tool to retrieve items from a specific Metabase collection.

Get Root Collection

Tool to fetch the Root Collection and its top-level objects.

Get Collection Tree

Tool to retrieve the collection tree structure from Metabase.

Get Dashboard Parameter Remapping

Tool to get parameter remapping for a dashboard parameter value.

Get Dashboard Parameter Values

Tool to fetch available values for a specific dashboard parameter.

Get Dashboard Related Entities

Tool to retrieve related entities for a Metabase dashboard.

Get All Databases

Tool to retrieve a list of all Database instances configured in Metabase.

Get Database Details

Tool to retrieve complete details for a specific database in Metabase.

Get Database Autocomplete Suggestions

Tool to retrieve autocomplete suggestions for table and field names in a database.

Get Database Card Autocomplete Suggestions

Tool to get card autocomplete suggestions for a specific database in Metabase.

Get Database Fields

Tool to retrieve all fields from a specific database in Metabase.

Check Database Health

Tool to check the health status of a specific database connection in Metabase.

Get Database Metadata

Tool to retrieve complete metadata for a specific database including all tables and fields.

Get Virtual Database Datasets

Tool to retrieve all datasets from a Metabase virtual database.

Get User Audit Info

Tool to get audit info for the current authenticated user.

Get Billing API Version

Tool to retrieve the billing API version information for the Metabase Enterprise Edition instance.

Get Resource Dependents

Tool to get dependents of a resource in Metabase's dependency graph.

Get Embedding Hub Checklist

Tool to retrieve the embedding hub checklist status for Metabase Enterprise Edition.

Get Current Remote Sync Task

Tool to retrieve the current remote sync task status in Metabase.

Get Stale Data By ID

Tool to retrieve stale data information by ID from Metabase Enterprise Edition.

Get Uploaded Tables

Tool to retrieve all uploaded tables in Metabase Enterprise Edition.

Get Field Related Entities

Tool to retrieve related entities for a Metabase field.

Search Field Values

Tool to search for field values in Metabase that start with a given string.

Get Field Values

Tool to retrieve distinct values for a Metabase field.

Get API Glossary

Tool to retrieve all glossary items from Metabase.

Get Current User Login History

Tool to retrieve login history for the currently authenticated user.

Get Model Index Values

Tool to retrieve indexed field values for a specific Metabase model.

Get Model Index Details

Tool to retrieve details of a specific model index by its ID.

Get all native query snippets

Tool to retrieve all native query snippets available in the Metabase instance.

Get Native Query Snippet by ID

Tool to retrieve a specific native query snippet by its ID.

Get Notifications

Tool to retrieve notifications from Metabase with optional filtering.

Get Public Card by UUID

Tool to fetch a publicly-accessible card by its public UUID and return card information including query definition, visualization settings, and parameters.

Get Public oEmbed Metadata

Tool to get oEmbed metadata for public Metabase resources.

Get Public Pivot Card Query

Tool to fetch a publicly-accessible pivot card and return query results including data rows, column metadata, and query status.

Get All Pulses

Tool to retrieve all pulses (scheduled reports/subscriptions) in Metabase.

Get Pulse Form Input Configuration

Tool to retrieve configuration information for creating or updating Pulses (scheduled email reports).

Get Pulse by ID

Tool to retrieve a specific pulse (subscription) by its ID.

Get Pulse Preview Card

Tool to retrieve the HTML preview of a Metabase card formatted for pulse emails.

Get Pulse Preview Card Info

Tool to retrieve preview information for a Metabase card formatted for pulse emails.

Get Pulse Preview Dashboard

Tool to retrieve the pulse preview for a specific dashboard by its ID.

Get Revision by ID and Entity

Tool to retrieve a specific revision by ID and entity type.

Get Entity Revision History

Tool to retrieve the revision history for a Metabase entity (dashboard, card, metric, or segment).

Search Metabase objects

Tool to search Cards, Dashboards, Collections, Tables, Databases, and Pulses for a substring.

Get Search Weights

Tool to retrieve the current search weight configuration for the Metabase instance.

Get All Segments

Tool to retrieve all segments from Metabase.

Validate Password Reset Token

Tool to validate a password reset token in Metabase.

Get Session Properties

Tool to retrieve all global session properties and their values that are public.

Get Card Table Foreign Keys

Tool to retrieve foreign key relationships for a card-based virtual table.

Get Card Virtual Table Query Metadata

Tool to retrieve metadata for a virtual table created from a card (saved question).

Get Table Foreign Keys

Tool to retrieve foreign key relationships for a Metabase table.

Get Table Query Metadata

Tool to retrieve metadata about a table useful for running queries.

Get Table Data by ID

Tool to retrieve data from a specific Metabase table by ID.

Get All Timelines

Tool to retrieve all timelines in Metabase.

Get Collection Timelines

Tool to retrieve timelines associated with a specific Metabase collection.

Get Root Collection Timelines

Tool to retrieve all timelines associated with the root collection.

Get Timeline Event

Tool to retrieve a timeline event by ID.

Get Timeline by ID

Tool to fetch a timeline by its ID from Metabase.

Get Current User

Tool to retrieve information about the currently authenticated user.

Get User by ID

Tool to retrieve a specific user by their ID.

Get User Key-Value by Namespace

Tool to retrieve all user key-value pairs for a specified namespace.

Get User Recipients

Tool to retrieve users for recipient selection.

Generate Random Security Token

Tool to generate a cryptographically secure random token for Metabase.

Get Automagic Dashboard

Tool to generate an automagic dashboard for a given entity.

Get Automagic Dashboard

Tool to retrieve an automagic dashboard for a specified entity with its ID.

Get Automagic Dashboard Cell Analysis

Tool to return an automagic dashboard analyzing a specific cell in an entity's data.

Get Automagic Dashboard Cell Rule

Tool to fetch an automagic dashboard analyzing a specific cell in a table or query.

Get Automagic Dashboards Compare

Tool to return an automagic comparison dashboard for entity with id compared with comparison-entity with comparison-entity-id-or-query.

Get Automagic Dashboard Query Metadata

Tool to retrieve all metadata for an automagic dashboard for a specific entity and ID.

Get automagic dashboard by rule

Tool to return an automagic dashboard for a specific entity using a dashboard template with rule prefix.

Get Card Dashboards

Tool to get a list of dashboards that a specific card appears in.

Search Card Parameter Values

Tool to fetch possible values for a card parameter that match a search query.

Get Card Query Metadata

Tool to get comprehensive query metadata for a Metabase card (saved question).

Get Card Series

Tool to fetch a list of cards compatible as series with a specified card.

Get Collection by ID

Tool to fetch a specific Metabase collection with standard details added.

Get Collection Items

Tool to fetch items from a specific Metabase collection.

Get Automagic Comparison Dashboard

Tool to retrieve an automagic comparison dashboard comparing a cell in one entity with another entity.

Get Dashboard by ID

Tool to retrieve details of a specific Metabase dashboard by ID.

Get Dashboard by ID

Tool to retrieve a dashboard by its ID from Metabase.

Search dashboard parameter values

Tool to search for dashboard parameter values in Metabase.

Get Dashboard Params Remapping

Tool to fetch the remapped value for a given dashboard parameter in Metabase.

Search Dashboard Parameter Values

Tool to fetch possible values of a dashboard parameter that contain the search query.

Get Dashboard Query Metadata

Tool to get all of the required query metadata for the cards on a dashboard.

Get Dashboard Related Entities

Tool to retrieve related entities for a Metabase dashboard.

Get Database Autocomplete Suggestions

Tool to get autocomplete suggestions for table and field names in a Metabase database.

Get Database By ID

Tool to retrieve a single database by ID from Metabase.

Get Database Card Autocomplete Suggestions

Tool to return a list of Card autocomplete suggestions for a given query in a given Database.

Get Database Datasets

Tool to retrieve tables (models and metrics) from a virtual database schema in Metabase.

Get Database Fields

Tool to retrieve all field metadata from a Metabase database.

Get Database Healthcheck

Tool to check if a Metabase database can currently connect.

Get Database Metadata

Tool to retrieve complete metadata for a specific database including all tables and fields.

Get Database Schemas

Tool to retrieve all schemas with tables for a specific database in Metabase.

Get Database Settings Available

Tool to get all database-local settings and their availability for a given database.

Get Database Syncable Schemas

Tool to retrieve all syncable schemas for a specific database in Metabase.

Get Stale Entities from Collection

Tool to retrieve stale entities (cards and dashboards) from a Metabase collection that haven't been used recently.

Get Field Remapping

Tool to fetch remapped field values for a specific field in Metabase.

Get Field Summary

Tool to get summary statistics for a Metabase field by its ID.

Get ModelIndex by ID

Tool to retrieve a ModelIndex by ID.

Get Most Recently Viewed Dashboard

Tool to retrieve the most recently viewed dashboard for the authenticated user.

Get Native Query Snippet by ID

Tool to retrieve a specific native query snippet by its ID.

Get Pulse Preview Card

Tool to get HTML rendering of a Metabase card by ID.

Get Pulse Preview Card Info

Tool to get JSON object containing HTML rendering of a card and additional information.

Get Dashboard HTML Preview

Tool to retrieve an HTML preview rendering of a dashboard.

Get Revision History by ID

Tool to retrieve the complete revision history for a Metabase entity by its ID.

Get Table By ID

Tool to retrieve basic table information by ID from Metabase.

Get Table Data

Tool to retrieve data from a specific table in Metabase.

Get Table Foreign Keys

Tool to get all foreign keys whose destination is a field that belongs to a specific table.

Get Table Query Metadata

Tool to get metadata about a Table useful for running queries.

Get Timeline by ID

Tool to fetch a timeline by its ID.

Get Collection Timelines

Tool to fetch timelines associated with a specific Metabase collection.

Get Timeline Event

Tool to fetch a timeline event by ID.

Get User by ID

Tool to fetch a Metabase user by their ID.

Get User Key-Value Setting

Tool to retrieve a user-specific key-value pair from Metabase storage.

Get All User Key-Values in Namespace

Tool to retrieve all key-value pairs in a given namespace for the current user.

Get User Key-Value Setting

Tool to retrieve a user-specific key-value pair from Metabase storage.

Record Recent Activity

Tool to record recent activity for a Metabase item.

Create Bookmark

Tool to create a bookmark for a Metabase item (card, dashboard, or collection).

Create Card

Tool to create a new Metabase card (question or model).

Execute Card Query

Tool to execute a query for a saved Metabase card/question and retrieve results.

Bulk Move Cards to Collection

Tool to bulk move multiple Metabase cards into a target collection or remove them from collections.

Copy Card

Tool to create a copy of an existing Metabase card (question) by its ID.

Execute Pivot Card Query

Tool to execute a pivot query on a Metabase card and return the results.

Get Card Dashboard Associations

Tool to retrieve dashboard associations for given card IDs.

Bulk Move Cards

Tool to bulk move cards to a collection or remove them from collections.

Create Collection

Tool to create a new Metabase collection for organizing content.

Create Dashboard

Tool to create a new Metabase dashboard.

Copy Dashboard

Tool to copy an existing Metabase dashboard.

Execute Dashboard Pivot Query

Tool to execute a pivot table query for a specific card on a dashboard.

Create Dashboard in Collection

Tool to create a new dashboard in a specific Metabase collection.

Discard Database Field Values

Tool to discard all saved field values for a specific database.

Dismiss Database Spinner

Tool to dismiss the spinner for a specific database.

Rescan Database Field Values

Tool to trigger a manual rescan of field values for a specific database.

Sync Database Schema

Tool to trigger a schema synchronization for a specific database.

Execute Dataset Query

Tool to execute a query against a Metabase database and retrieve results.

Convert Query to Native SQL

Tool to convert a Metabase query to native SQL format.

Remap Dataset Parameter Value

Tool to remap dataset parameter values in Metabase.

Get Dataset Parameter Values

Tool to fetch parameter values for dataset fields in Metabase.

Execute Pivot Table Query

Tool to execute a pivot table query and retrieve results.

Get Dataset Query Metadata

Tool to retrieve query metadata for a dataset query including databases, tables, fields, and snippets.

Check Snippet Dependencies

Tool to check dependencies for a native query snippet in Metabase Enterprise Edition.

Create Dashboard Subscription

Tool to create a dashboard subscription using Metabot tools.

Filter Records

Tool to filter records from a Metabase data source using metabot tools.

Generate Insights

Tool to generate insights for a table using Metabot tools.

Get Current User

Tool to retrieve information about the current authenticated user in a Metabase metabot conversation.

Get Dashboard Details

Tool to retrieve dashboard details for a Metabase metabot conversation.

Get Document Details via Metabot

Tool to retrieve document details using Metabase metabot tools.

Get Query Details

Tool to get query details using Metabot tools API.

Get Snippet Details

Tool to retrieve SQL snippet details via Metabase metabot tools.

Get Metabot Snippets

Tool to retrieve SQL snippets for a Metabase metabot conversation.

Get Table Details

Tool to retrieve comprehensive table details via Metabase metabot tools.

Query Datasource via Metabot

Tool to query a Metabase datasource using Metabot tools.

Metabot Search

Tool 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 Task

Tool to cancel the current active Remote Sync task in Metabase Enterprise Edition.

Translate Entity IDs

Tool to translate Metabase entity IDs (21-character strings) to their numeric IDs.

Discard Field Values

Tool to discard cached FieldValues for a specific field.

Rescan Field Values

Tool to manually trigger an update for the FieldValues for a specific field.

Create Glossary Entry

Tool to create a new glossary entry in Metabase.

Create Model Index

Tool to create a new model index in Metabase.

Create native query snippet

Tool to create a new native query snippet in Metabase.

Create Notification

Tool to create a new notification in Metabase.

Send Notification

Tool to trigger sending an unsaved notification in Metabase.

Unpersist Card

Tool to unpersist a Metabase card by its ID.

Unpersist Database

Tool to disable model persistence for a specific database.

Submit Product Feedback

Tool to submit product feedback to Metabase.

Create Pulse

Tool to create a new pulse (scheduled report/subscription) in Metabase.

Revert Entity to Previous Revision

Tool to revert a Metabase entity (card, dashboard, document, or segment) to a previous revision.

Send Password Reset Email

Tool to send a password reset email when user has forgotten their password.

Check Password Complexity

Tool to check if a password meets Metabase's configured password complexity rules.

Submit Bug Report to Slack

Tool to submit a bug report to Slack via Metabase's bug reporting endpoint.

Discard Table Field Values

Tool to discard cached FieldValues for all Fields belonging to a specific Table.

Rescan Table Field Values

Tool to trigger a manual rescan of field values for a specific table.

Sync Table Schema

Tool to trigger a manual update of the schema metadata for a specific Table.

Create Timeline

Tool to create a new timeline in Metabase.

Execute Dashboard Card Query

Tool to execute a query for a specific card within a dashcard on a dashboard.

Update Action by ID

Tool to update an existing Metabase action by its ID.

Update Bookmark Ordering

Tool to update the order of bookmarks for the authenticated user.

Update Card by ID

Tool to update a specific card (question) by its ID.

Update Collection by ID

Tool to update an existing Metabase collection by its ID.

Update Dashboard

Tool to update a Metabase dashboard by its ID.

Update Dashboard Cards

Tool to update dashboard cards and tabs.

Update Database Configuration

Tool to update a database configuration in Metabase.

Update Field Metadata

Tool to update a Metabase field by its ID.

Update Glossary Entry by ID

Tool to update an existing glossary entry in Metabase by its ID.

Update Native Query Snippet by ID

Tool to update an existing native query snippet by its ID.

Update Pulse by ID

Tool to update an existing pulse (scheduled report/subscription) by ID.

Update Search Weights

Tool to update search weights configuration in Metabase.

Update Table Metadata

Tool to update a Metabase table by its ID.

Update Table Metadata

Tool to update a Metabase table metadata by its ID.

Update Table Field Display Order

Tool to update the display order of fields in a Metabase table.

Update Timeline Event by ID

Tool to update an existing timeline event by its ID.

Update Timeline by ID

Tool to update an existing timeline by its ID.

Update User by ID

Tool to update an existing Metabase user by their ID.

Update Action

Tool to update an existing Action in Metabase.

Update Collection

Tool to update an existing Metabase collection.

Update Dashboard

Tool to update a Metabase dashboard by ID.

Update Dashboard Cards (Deprecated)

Tool to bulk update dashboard cards and tabs.

Update Database

Tool to update a Database in Metabase.

Update Field Metadata

Tool to update metadata for a Metabase field by its ID.

Update Glossary Entry

Tool to update an existing glossary entry in Metabase.

Update Native Query Snippet

Tool to update an existing native query snippet by ID.

Update Pulse

Tool to update an existing pulse (scheduled report/subscription) by ID.

Update Table by ID

Tool to update a Table in Metabase by its ID.

Update Table Fields Order

Tool to reorder fields in a Metabase table.

Update Timeline

Tool to update a Metabase timeline by its ID.

Update Timeline Event

Tool to update an existing Metabase timeline event by its ID.

FAQ

Frequently asked questions

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.

Yes, you can. Vercel AI SDK v6 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.

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.

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.

Start with Metabase.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Metabase tool your agent needs.Free to start.

Start building
Metabase MCP Integration with Vercel AI SDK | Composio