Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Mixpanel Analytics

Scalekit connector
Open markdown

The Mixpanel Analytics connector lets your AI agent work with Mixpanel Analytics. You connect it once with a service account, and Scalekit authenticates every call, so your agent never handles credentials. It comes with 51 tools.

Tools
51
What they doRead · write · destructive
32 · 11 · 832 read11 write8 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Mixpanel Analytics connection

    In AgentKit > Connections, create a Mixpanel Analytics connection. The name you give it is the connection_name your code passes. See Configure connections.

    Console steps with screenshots

    Register your Mixpanel Service Account username and secret with Scalekit so it can authenticate and proxy requests on behalf of your users. Mixpanel uses HTTP Basic Auth — the Service Account username is the username and the secret is the password. There is no redirect URI or OAuth flow.

    1. Find your Mixpanel data residency region

      Mixpanel hosts projects in three separate data residency regions. Before generating a Service Account, confirm which region your project lives in:

      RegionAPI host
      United States (default)mixpanel.com/api
      European Unioneu.mixpanel.com/api
      Indiain.mixpanel.com/api
    2. Create a Service Account

      • Sign in to Mixpanel and go to Settings → Project → Service Accounts.

      • Click Add Service Account, give it a name (for example, Agent Auth), and choose a role.

      • Copy the generated Username and Secret immediately — Mixpanel shows the secret only once.

        Mixpanel Add Service Account modal showing the generated Username and Secret fields

    3. Create a connection in Scalekit

      • In the Scalekit dashboard, go to AgentKit → Connections → Create Connection.
      • Search for Mixpanel Analytics and click Create.
      • Note the Connection name — use this as connection_name in your code (e.g., mixpanelanalytics).
    4. Add a connected account

      Connected accounts link a specific user identifier in your system to a Mixpanel Service Account and region. Add one in the dashboard to test. In production, each user adds their own through the authorization link: they enter their credentials on the page it opens.

      In the dashboard, to test

      • Open the connection and click the Connected Accounts tab → Add account.
      • Fill in Your User’s ID, the Username, Secret, and select the matching Data Residency.
      • Click Save.

      From your backend, if your app already has the credentials

      For example, when users enter them on a settings page in your app:

      import { ConnectorStatus } from '@scalekit-sdk/node'
      // Upsert the account, then make sure it is ACTIVE before the first tool call.
      async function connectUser(connectionName, identifier, details) {
      const authorizationDetails = { details: { case: 'staticAuth', value: { details } } }
      let { connectedAccount } = await scalekit.actions.upsertConnectedAccount({
      connectionName,
      identifier,
      authorizationDetails,
      })
      if (connectedAccount?.status !== ConnectorStatus.ACTIVE) {
      ;({ connectedAccount } = await scalekit.actions.upsertConnectedAccount({
      connectionName,
      identifier,
      authorizationDetails,
      }))
      }
      return connectedAccount
      }
      // US region (default) — omit `domain` or set it to 'mixpanel.com/api'
      await connectUser('mixpanelanalytics', 'user_123', {
      username: 'your-service-account-username',
      password: 'your-service-account-secret',
      domain: 'mixpanel.com/api',
      })
      // EU region
      await connectUser('mixpanelanalytics', 'user_123', {
      username: 'your-eu-service-account-username',
      password: 'your-eu-service-account-secret',
      domain: 'eu.mixpanel.com/api',
      })

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • mixpanelanalytics_activity_streamGet the raw event stream (activity feed) for one or more specific users over a date range — every event each user did, in order.Read-only

    Get User Activity Stream

    Get the raw event stream (activity feed) for one or more specific users over a date range — every event each user did, in order. Useful for inspecting an individual user's journey rather than aggregate analytics. Rate limited to 60 queries/hour and 5 concurrent queries.

    Inputs

    distinct_idsarrayrequired
    The user distinct_ids to fetch activity for, as a JSON array of strings.
    from_datestringrequired
    Start date of the query range, in yyyy-mm-dd format (inclusive).
    project_idintegerrequired
    Your Mixpanel numeric Project ID (Project Settings > Overview). Required when authenticating with a Service Account; not needed with a legacy Project Secret.
    to_datestringrequired
    End date of the query range, in yyyy-mm-dd format (inclusive).
    workspace_idinteger
    The numeric ID of the Mixpanel workspace to query, for projects with multiple workspaces. Omit to use the project's default workspace.
  • mixpanelanalytics_annotation_getGet a single annotation by its numeric id, including its date, description, tags, and creator.Read-only

    Get Annotation

    Get a single annotation by its numeric id, including its date, description, tags, and creator. Use 'mixpanelanalytics_annotations_list' to find the id.

    Inputs

    annotation_idstringrequired
    The numeric id of the annotation to fetch. Find it via 'mixpanelanalytics_annotations_list'.
    project_idstringrequired
    Your numeric Mixpanel Project ID, required to authenticate Service Account requests. Find it in Mixpanel under Project Settings > Overview.
  • mixpanelanalytics_annotation_tags_listList every annotation tag defined in a Mixpanel project, including whether each tag is currently attached to any annotations.Read-only

    List Annotation Tags

    List every annotation tag defined in a Mixpanel project, including whether each tag is currently attached to any annotations. Use with 'mixpanelanalytics_annotation_create' or 'mixpanelanalytics_annotation_update' to attach a tag by id.

    Inputs

    project_idstringrequired
    Your numeric Mixpanel Project ID, required to authenticate Service Account requests. Find it in Mixpanel under Project Settings > Overview.
  • mixpanelanalytics_annotations_listList annotations in a Mixpanel project, optionally filtered to a date range.Read-only

    List Annotations

    List annotations in a Mixpanel project, optionally filtered to a date range. Use 'mixpanelanalytics_annotation_get' to fetch a single annotation by id, or 'mixpanelanalytics_annotation_create' to add a new one.

    Inputs

    project_idstringrequired
    Your numeric Mixpanel Project ID, required to authenticate Service Account requests. Find it in Mixpanel under Project Settings > Overview.
    from_datestring
    Only return annotations on or after this date, in yyyy-mm-dd format (inclusive). Omit to return annotations from the start of the project's data.
    to_datestring
    Only return annotations on or before this date, in yyyy-mm-dd format (inclusive). Omit to return annotations up to the most recent.
  • mixpanelanalytics_cohorts_listList every saved cohort in a Mixpanel project, including each cohort's numeric id, name, member count, description, and creation date.Read-only

    List Saved Cohorts

    List every saved cohort in a Mixpanel project, including each cohort's numeric id, name, member count, description, and creation date. Use the id with 'mixpanelanalytics_profiles_query' (filter_by_cohort) to fetch the profiles in a cohort.

    Inputs

    project_idintegerrequired
    Your Mixpanel numeric Project ID (Project Settings > Overview). Required when authenticating with a Service Account; not needed with a legacy Project Secret.
    workspace_idinteger
    The numeric ID of the Mixpanel workspace to query, for projects with multiple workspaces. Omit to use the project's default workspace.
  • mixpanelanalytics_event_propertiesGet a time series broken down by the values of a single event property, e.g.Read-only

    Query Event Property Values Over Time

    Get a time series broken down by the values of a single event property, e.g. purchase count per day segmented by product_category. Similar to segmentation, but focused on exploring one property's values rather than an arbitrary 'on' expression.

    Inputs

    eventstringrequired
    The single event name to get data for, e.g. "purchase". Not an array.
    namestringrequired
    The name of the event property to analyze, e.g. "product_category".
    project_idintegerrequired
    Your Mixpanel numeric Project ID (Project Settings > Overview). Required when authenticating with a Service Account; not needed with a legacy Project Secret.
    typestringrequired
    The analysis type: 'general' for total count, 'unique' for distinct user count, or 'average' for count per unique user.one of generaluniqueaverage
    unitstringrequired
    The time bucket granularity: 'minute', 'hour', 'day', 'week', or 'month'.one of minutehourdayweekmonth
    from_datestring
    Start date of the query range, in yyyy-mm-dd format (inclusive). Required unless 'interval' is set.
    intervalinteger
    Number of time units (see 'unit') to return, counting back from now. Alternative to 'from_date'/'to_date'.
    limitinteger
    Maximum number of property values to return.default 255
    to_datestring
    End date of the query range, in yyyy-mm-dd format (inclusive). Required unless 'interval' is set.
    valuesarray
    A specific list of property values to return data for, as a JSON array. Omit to return the top values automatically.
    workspace_idinteger
    The numeric ID of the Mixpanel workspace to query, for projects with multiple workspaces. Omit to use the project's default workspace.
  • mixpanelanalytics_event_top_propertiesList the property names most commonly sent with a given event, along with how many times each appears.Read-only

    Top Properties for an Event

    List the property names most commonly sent with a given event, along with how many times each appears. Useful for discovering what properties are available before writing a segmentation query or property-values lookup.

    Inputs

    eventstringrequired
    The single event name to get property data for, e.g. "purchase". Not an array.
    project_idintegerrequired
    Your Mixpanel numeric Project ID (Project Settings > Overview). Required when authenticating with a Service Account; not needed with a legacy Project Secret.
    limitinteger
    Maximum number of properties to return.default 10
    workspace_idinteger
    The numeric ID of the Mixpanel workspace to query, for projects with multiple workspaces. Omit to use the project's default workspace.
  • mixpanelanalytics_event_top_property_valuesList the most common values seen for a given event property, e.g.Read-only

    Top Values for an Event Property

    List the most common values seen for a given event property, e.g. the top product_category values sent with the 'purchase' event. Useful for discovering what filter/segment values are available before writing a query.

    Inputs

    eventstringrequired
    The single event name to get data for, e.g. "purchase". Not an array.
    namestringrequired
    The name of the event property to list values for, e.g. "product_category".
    project_idintegerrequired
    Your Mixpanel numeric Project ID (Project Settings > Overview). Required when authenticating with a Service Account; not needed with a legacy Project Secret.
    limitinteger
    Maximum number of values to return.default 255
    workspace_idinteger
    The numeric ID of the Mixpanel workspace to query, for projects with multiple workspaces. Omit to use the project's default workspace.