KosmoKrator

analytics

Metabase CLI for AI Agents

Use the Metabase CLI from KosmoKrator to call Metabase tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

8 functions 8 read 0 write Username and password auth

Metabase CLI Setup

Metabase can be configured headlessly with `kosmokrator integrations:configure metabase`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure metabase --set hostname="$METABASE_HOSTNAME" --set username="$METABASE_USERNAME" --set password="$METABASE_PASSWORD" --enable --read allow --write ask --json
kosmokrator integrations:doctor metabase --json
kosmokrator integrations:status --json

Credentials

Authentication type: Username and password basic. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
hostname METABASE_HOSTNAME URL url yes Metabase URL
username METABASE_USERNAME Text string yes Username
password METABASE_PASSWORD Secret secret yes Password

Call Metabase Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call metabase.metabase_list_dashboards '{}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:metabase metabase_list_dashboards '{}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs metabase --json
kosmo integrations:docs metabase.metabase_list_dashboards --json
kosmo integrations:schema metabase.metabase_list_dashboards --json
kosmo integrations:search "Metabase" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Metabase.

metabase.metabase_list_dashboards

Read read

List all dashboards available in Metabase. Returns dashboard IDs, names, and basic metadata. Use metabase_get_dashboard to retrieve the full dashboard with cards.

Parameters
none

Generic CLI call

kosmo integrations:call metabase.metabase_list_dashboards '{}' --json

Provider shortcut

kosmo integrations:metabase metabase_list_dashboards '{}' --json

metabase.metabase_get_dashboard

Read read

Get a single Metabase dashboard by ID, including all cards (questions), layout, and parameters. Use metabase_list_dashboards to find dashboard IDs.

Parameters
id

Generic CLI call

kosmo integrations:call metabase.metabase_get_dashboard '{"id":1}' --json

Provider shortcut

kosmo integrations:metabase metabase_get_dashboard '{"id":1}' --json

metabase.metabase_list_cards

Read read

List all cards (questions/saved questions) in Metabase. Returns card IDs, names, collection info, and display types. Use metabase_get_card for full definitions or metabase_query_card to run a card.

Parameters
none

Generic CLI call

kosmo integrations:call metabase.metabase_list_cards '{}' --json

Provider shortcut

kosmo integrations:metabase metabase_list_cards '{}' --json

metabase.metabase_get_card

Read read

Get the full definition of a Metabase card (question) by ID, including the query, display settings, and parameters. Use metabase_list_cards to find card IDs.

Parameters
id

Generic CLI call

kosmo integrations:call metabase.metabase_get_card '{"id":1}' --json

Provider shortcut

kosmo integrations:metabase metabase_get_card '{"id":1}' --json

metabase.metabase_query_card

Read read

Execute a saved Metabase card (question) and return the query results as rows. Use metabase_list_cards or metabase_get_card to find card IDs. The card must be a question (not a model or metric).

Parameters
id

Generic CLI call

kosmo integrations:call metabase.metabase_query_card '{"id":1}' --json

Provider shortcut

kosmo integrations:metabase metabase_query_card '{"id":1}' --json

metabase.metabase_list_databases

Read read

List all databases connected to Metabase. Returns database IDs, names, engine types, and metadata. Use metabase_get_database to retrieve tables and fields for a specific database.

Parameters
none

Generic CLI call

kosmo integrations:call metabase.metabase_list_databases '{}' --json

Provider shortcut

kosmo integrations:metabase metabase_list_databases '{}' --json

metabase.metabase_get_database

Read read

Get detailed metadata for a Metabase database by ID, including its tables, fields, and schema information. Use metabase_list_databases to find database IDs.

Parameters
id

Generic CLI call

kosmo integrations:call metabase.metabase_get_database '{"id":1}' --json

Provider shortcut

kosmo integrations:metabase metabase_get_database '{"id":1}' --json

metabase.metabase_get_current_user

Read read

Get the currently authenticated Metabase user profile, including name, email, and group memberships. Useful for verifying which account the integration is using.

Parameters
none

Generic CLI call

kosmo integrations:call metabase.metabase_get_current_user '{}' --json

Provider shortcut

kosmo integrations:metabase metabase_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

metabase.metabase_list_dashboards

List all dashboards available in Metabase. Returns dashboard IDs, names, and basic metadata. Use metabase_get_dashboard to retrieve the full dashboard with cards.

Operation
Read read
Schema command
kosmo integrations:schema metabase.metabase_list_dashboards --json
ParameterTypeRequiredDescription
No parameters.

metabase.metabase_get_dashboard

Get a single Metabase dashboard by ID, including all cards (questions), layout, and parameters. Use metabase_list_dashboards to find dashboard IDs.

Operation
Read read
Schema command
kosmo integrations:schema metabase.metabase_get_dashboard --json
ParameterTypeRequiredDescription
id integer yes The dashboard ID.

metabase.metabase_list_cards

List all cards (questions/saved questions) in Metabase. Returns card IDs, names, collection info, and display types. Use metabase_get_card for full definitions or metabase_query_card to run a card.

Operation
Read read
Schema command
kosmo integrations:schema metabase.metabase_list_cards --json
ParameterTypeRequiredDescription
No parameters.

metabase.metabase_get_card

Get the full definition of a Metabase card (question) by ID, including the query, display settings, and parameters. Use metabase_list_cards to find card IDs.

Operation
Read read
Schema command
kosmo integrations:schema metabase.metabase_get_card --json
ParameterTypeRequiredDescription
id integer yes The card (question) ID.

metabase.metabase_query_card

Execute a saved Metabase card (question) and return the query results as rows. Use metabase_list_cards or metabase_get_card to find card IDs. The card must be a question (not a model or metric).

Operation
Read read
Schema command
kosmo integrations:schema metabase.metabase_query_card --json
ParameterTypeRequiredDescription
id integer yes The card (question) ID to execute.

metabase.metabase_list_databases

List all databases connected to Metabase. Returns database IDs, names, engine types, and metadata. Use metabase_get_database to retrieve tables and fields for a specific database.

Operation
Read read
Schema command
kosmo integrations:schema metabase.metabase_list_databases --json
ParameterTypeRequiredDescription
No parameters.

metabase.metabase_get_database

Get detailed metadata for a Metabase database by ID, including its tables, fields, and schema information. Use metabase_list_databases to find database IDs.

Operation
Read read
Schema command
kosmo integrations:schema metabase.metabase_get_database --json
ParameterTypeRequiredDescription
id integer yes The database ID.

metabase.metabase_get_current_user

Get the currently authenticated Metabase user profile, including name, email, and group memberships. Useful for verifying which account the integration is using.

Operation
Read read
Schema command
kosmo integrations:schema metabase.metabase_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.