KosmoKrator

analytics

Mixpanel Analytics CLI for AI Agents

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

Mixpanel Analytics CLI Setup

Mixpanel Analytics can be configured headlessly with `kosmokrator integrations:configure mixpanel`.

Install, configure, and verify
# 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 mixpanel --set api_key="$MIXPANEL_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor mixpanel --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
api_key MIXPANEL_API_KEY Secret secret yes API Key
url MIXPANEL_URL URL url no Mixpanel URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call mixpanel.mixpanel_get_cohort '{"id":"example_id"}' --json
Provider shortcut
kosmo integrations:mixpanel mixpanel_get_cohort '{"id":"example_id"}' --json

Discovery

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

Discovery commands
kosmo integrations:docs mixpanel --json
kosmo integrations:docs mixpanel.mixpanel_get_cohort --json
kosmo integrations:schema mixpanel.mixpanel_get_cohort --json
kosmo integrations:search "Mixpanel Analytics" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

mixpanel.mixpanel_get_cohort

Retrieve detailed information for a Mixpanel cohort by its ID. Returns cohort membership data and behavioral criteria.

Read read
Parameters
id
Generic call
kosmo integrations:call mixpanel.mixpanel_get_cohort '{"id":"example_id"}' --json
Shortcut
kosmo integrations:mixpanel mixpanel_get_cohort '{"id":"example_id"}' --json

mixpanel.mixpanel_get_current_user

Get the currently authenticated Mixpanel user. Returns account details for the API key owner — useful for verifying credentials and checking permissions.

Read read
Parameters
none
Generic call
kosmo integrations:call mixpanel.mixpanel_get_current_user '{}' --json
Shortcut
kosmo integrations:mixpanel mixpanel_get_current_user '{}' --json

mixpanel.mixpanel_get_event

Retrieve analytics data for a specific Mixpanel event by name. Returns event counts and breakdowns over time.

Read read
Parameters
name, type, unit, from, to
Generic call
kosmo integrations:call mixpanel.mixpanel_get_event '{"name":"example_name","type":"example_type","unit":"example_unit","from":"example_from","to":"example_to"}' --json
Shortcut
kosmo integrations:mixpanel mixpanel_get_event '{"name":"example_name","type":"example_type","unit":"example_unit","from":"example_from","to":"example_to"}' --json

mixpanel.mixpanel_get_funnel

Retrieve detailed conversion data for a Mixpanel funnel by its ID. Returns step-by-step conversion rates and drop-off analytics.

Read read
Parameters
id
Generic call
kosmo integrations:call mixpanel.mixpanel_get_funnel '{"id":"example_id"}' --json
Shortcut
kosmo integrations:mixpanel mixpanel_get_funnel '{"id":"example_id"}' --json

mixpanel.mixpanel_list_cohorts

List all behavioral cohorts in the Mixpanel project. Returns cohort names, IDs, and sizes.

Read read
Parameters
none
Generic call
kosmo integrations:call mixpanel.mixpanel_list_cohorts '{}' --json
Shortcut
kosmo integrations:mixpanel mixpanel_list_cohorts '{}' --json

mixpanel.mixpanel_list_events

List events from Mixpanel Analytics. Optionally filter by event type, time unit, or date range. Returns the most recent events matching the criteria.

Read read
Parameters
type, unit, from, to, limit
Generic call
kosmo integrations:call mixpanel.mixpanel_list_events '{"type":"example_type","unit":"example_unit","from":"example_from","to":"example_to","limit":1}' --json
Shortcut
kosmo integrations:mixpanel mixpanel_list_events '{"type":"example_type","unit":"example_unit","from":"example_from","to":"example_to","limit":1}' --json

mixpanel.mixpanel_list_funnels

List all funnels configured in the Mixpanel project. Returns funnel names, IDs, and basic configuration.

Read read
Parameters
none
Generic call
kosmo integrations:call mixpanel.mixpanel_list_funnels '{}' --json
Shortcut
kosmo integrations:mixpanel mixpanel_list_funnels '{}' --json

Function Schemas

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

mixpanel.mixpanel_get_cohort 1 parameters
Schema command
kosmo integrations:schema mixpanel.mixpanel_get_cohort --json
ParameterTypeRequiredDescription
id string yes The Mixpanel cohort ID.
mixpanel.mixpanel_get_current_user 0 parameters
Schema command
kosmo integrations:schema mixpanel.mixpanel_get_current_user --json
ParameterTypeRequiredDescription
No parameters.
mixpanel.mixpanel_get_event 5 parameters
Schema command
kosmo integrations:schema mixpanel.mixpanel_get_event --json
ParameterTypeRequiredDescription
name string yes The event name to retrieve data for.
type string no Event type: "general" or "unique" (default: "general").
unit string no Time unit: "hour", "day", "week", "month" (default: "day").
from string no Start date in YYYY-MM-DD format.
to string no End date in YYYY-MM-DD format.
mixpanel.mixpanel_get_funnel 1 parameters
Schema command
kosmo integrations:schema mixpanel.mixpanel_get_funnel --json
ParameterTypeRequiredDescription
id string yes The Mixpanel funnel ID.
mixpanel.mixpanel_list_cohorts 0 parameters
Schema command
kosmo integrations:schema mixpanel.mixpanel_list_cohorts --json
ParameterTypeRequiredDescription
No parameters.
mixpanel.mixpanel_list_events 5 parameters
Schema command
kosmo integrations:schema mixpanel.mixpanel_list_events --json
ParameterTypeRequiredDescription
type string no Event type: "general" or "unique" (default: "general").
unit string no Time unit: "hour", "day", "week", "month" (default: "day").
from string no Start date in YYYY-MM-DD format.
to string no End date in YYYY-MM-DD format.
limit integer no Maximum number of events to return (default: 100).
mixpanel.mixpanel_list_funnels 0 parameters
Schema command
kosmo integrations:schema mixpanel.mixpanel_list_funnels --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.