Connect Metabase to Claude Code

Browse saved questions, dashboards and database metadata, run a saved card, and query a database. Add Toolspoke to Claude Code once and it can use 11 Metabase actions. Your Metabase credential stays in Toolspoke, and you choose which actions Claude Code may call.

Set it up in Claude Code

Three steps, the first one once for every toolkit you will ever add.

  1. Add Toolspoke to Claude Code

    Run it in your project, then /mcp to sign in

    claude mcp add --transport http toolspoke https://toolspoke.com/mcp

    The sign-in opens in your browser, and Toolspoke asks you to approve it.

  2. Install Metabase and connect it

    Add Metabase to a project in your Toolspoke workspace.

    API key. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

    API key
    Metabase → gear icon → Admin → Settings → Authentication → API keys → Create API key. The key inherits the permissions of the group you pick, so pick a group with the access you actually want to hand over, a read-only group is the usual answer. The key is shown once. Needs Metabase 0.49 or newer; earlier versions have no API keys at all.
    Instance URL
    The root URL of your Metabase, with no trailing /api, this connector adds that itself. Metabase Cloud and a self-hosted install are both fine.
  3. Choose what Claude Code may do

    All 11 actions start on. Switch off the one action that changes something in Metabase, and Claude Code gets a refusal if it tries.

What you can ask Claude Code for

A few of the Metabase actions that only read, so they are safe to try first.

  • List the databases this Metabase is connected to, with each one's id, name and engine
  • Run a saved question and return its result rows
  • List the dashboards in this Metabase with their ids and names

What Claude Code can do in Metabase

10 actions read and one writes.

Reads

  • List databases

    List the databases this Metabase is connected to, with each one's id, name and engine. Start here: the database id is what run_native_query and get_database_metadata take, and this is the cheapest call that proves the API key works and says what it can see, which is why it is the connection test. Connection details come back with secrets already masked by Metabase, and this connector adds no operation that could unmask them.

  • Get database metadata

    Fetch one database's full schema as Metabase understands it: every table, and for each table every field with its type, its semantic type and its display name. This is the map to read before writing SQL for run_native_query, because it names the tables and columns as they actually exist. It can be a very large response on a wide warehouse, pass skip_fields to get tables only, then use get_table_query_metadata for the one table you care about.

  • List tables

    List every table Metabase knows about, across all connected databases, with each one's id, name, schema and database. Use it to find a table id for get_table_query_metadata when you do not want to pull a whole database's metadata. On an instance connected to a large warehouse this is a long list, so prefer get_database_metadata with skip_fields when you already know which database you mean.

  • Get table query metadata

    Fetch one table's fields as they matter for querying: name, base type, semantic type, whether each field is a foreign key and what it points at. This is the precise version of get_database_metadata for a single table, and the right call before writing a join. Fields an admin marked sensitive are withheld unless include_sensitive_fields is set, which is Metabase's own choice about them and is left off by default here.

  • List cards

    List the saved questions in this Metabase, what its own API calls cards, with each one's id, name, collection, database and query definition. This is the catalogue of analysis somebody has already written and reviewed, and it is nearly always the better answer than writing new SQL. The id is what get_card and run_card_query take. `f` narrows the list; "mine" is the questions the API key's own user owns, which for a key is rarely what you want.

  • Get card

    Fetch one saved question by id, with its full query definition, its visualisation settings, its collection and the parameters it accepts. Read this before run_card_query so you know which parameter ids that question takes and what they mean. Ids come from list_cards or from search.

  • Run card query

    Run a saved question and return its result rows. This is a genuine read and is classified as one: the statement being executed was written and saved by a person in Metabase, the caller cannot change it, and all this operation supplies is values for the parameters that question already declares. That is the whole difference from run_native_query, which sends SQL a caller wrote and is a write. Reach for this first, a saved question is reviewed, cached and permissioned, and running one avoids writing SQL at all. Get the parameter ids from get_card; each entry needs the `id` of a parameter the card declares plus the `value` to use.

  • List dashboards

    List the dashboards in this Metabase with their ids and names. Metabase itself marks this route as kept only for backwards compatibility and no longer uses it in its own interface, so treat what it returns as a plain list and prefer search with models set to ["dashboard"] when you need collections, ownership or last-edited information alongside the names. Note that `f` here accepts only all, mine or archived, a much smaller set than list_cards takes.

  • Get dashboard

    Fetch one dashboard by id, with every card on it, how those cards are laid out, and the filters the dashboard declares. This is how you find which saved questions a dashboard is built from, take their ids and run them with run_card_query. Ids come from list_dashboards or from search.

  • Search

    Search everything in this Metabase by name, questions, dashboards, models, collections, tables and databases, and get back what each hit is, where it lives and its id. This is the fastest way from "the revenue dashboard" to an id, and it is the recommended way to list dashboards with their context. `models` narrows what kinds of thing come back and is repeated once per kind. Metabase pages this route with limit and offset, and defaults to 50 results when either is given.

Writes

  • Run native query

    Send a SQL statement to one of the connected databases and return the result rows. CLASSIFIED A WRITE ON PURPOSE, and this is not a mistake to correct later: /api/dataset is the same endpoint for SELECT, INSERT, UPDATE and DDL, Metabase offers no read-only mode to open the connection in, and nothing on this side can tell which of those a caller sent, the same reasoning that makes connectors/supabase.json's `query` and connectors/bigquery.json's run_query writes. If this install should only ever read, give its API key a Metabase group whose database permission is read-only; the classification stops a read-only grant reaching this at all. Prefer run_card_query when a saved question already answers the question. Always put a LIMIT in the statement, the rows come back verbatim. Call get_database_metadata first to get table and column names right.

Metabase in Claude Code: questions

Does Claude Code see my Metabase credential?

No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.

Can I stop Claude Code from changing things in Metabase?

Yes. Each of the 11 actions can be switched off for a project. Turn off the one that changes something and Claude Code can only read.

Will 11 actions crowd Claude Code's context?

No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Metabase action it needs when it needs it. Adding more toolkits does not add more tools to its list.

Can I add it once for every project?

Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.

What does it cost?

Tool calls are free on every plan, and a Metabase call does not run in a sandbox, so it bills nothing.

Try Metabase in Claude Code

Free to start, and tool calls cost nothing on any plan.