First-party app
Mixpanel Mixpanel

Mixpanel

Query Mixpanel product analytics and write events and user profiles into it — saved reports, segmentation, retention, cohorts, raw export, and deduplicated event import.

stable Analytics & BIMarketing

About

Mixpanel ships in the w6w first-party pack. It declares 13 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.mixpanel
Version
0.1.2
Author
w6w
Licence
MIT
Categories
Analytics & BI · Marketing

Overview

Mixpanel is where product usage gets tracked and reported on, and this app lets a workflow do both sides of that: pull the numbers a saved report or ad-hoc query already shows, and write new events and user-profile changes back into the same project.

For writing, it deliberately skips Mixpanel’s best-known ingestion endpoint — that one accepts anything, including a completely wrong project token, and answers success either way, so a workflow using it could never learn its data wasn’t arriving. Instead, events go in through Mixpanel’s validating import endpoint, each carrying the identifier Mixpanel uses to avoid double-counting when a workflow retries. Profile updates support all of Mixpanel’s actual update semantics — overwrite, set-once, increment, list union and append — rather than only the common case, because those aren’t interchangeable and picking the wrong one either loses history or silently duplicates it.

For reading, running an existing saved report is favoured over rebuilding its logic from raw segmentation calls, since the saved report already encodes whatever definition of “active user” the rest of the company already agreed on. Retention, cohorts and raw event export round out the read side, alongside the property and event-name lookups that make writing an ad-hoc query possible in the first place.

Build with Mixpanel

Three routes to the same 13 actions. The Workflow tab is generated from Mixpanel's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

List a user's activity

activity-list

One or more users' events in order over a date range — the query for 'what did this person actually do', rather than a metric.

List cohorts

cohort-list

Saved cohorts with their ids and sizes — the agreed definitions a workflow should filter by rather than re-deriving.

Export raw events

event-export

Raw events with every property, as JSONL from Mixpanel's export hosts. Dates are UTC here and project-local everywhere else — which matters at a day boundary.

Import events

event-import

Write events through the authenticated import endpoint. Every event needs an `$insert_id`, which is what makes a retry safe — and what /track cannot offer.

List event names

event-name-list

The event names in this project. Mixpanel matches names exactly, and a query for an event that does not exist returns zeros rather than an error.

List a property's values

event-property-values

What values one property takes on one event, with counts — the lookup that makes a filter expression writable, and that reveals the four spellings of `pro`.

Query a saved report

insights-query

Run a saved Insights report by id and get exactly the numbers the dashboard shows — rather than re-deriving them from raw parameters.

List Lexicon schemas

lexicon-schema-list

The project's documented event and property definitions — descriptions, types, and which events are hidden or deprecated. Not a query, so it costs nothing from the hourly budget.

Delete user profiles

profile-delete

Delete profile records. Their EVENTS remain in the project — this is not a GDPR erasure, which needs Mixpanel's separate deletion API.

Query user profiles

profile-query

Find people by property expression or by saved cohort. Paging reuses Mixpanel's session id so the result set does not shift underneath it.

Update user profiles

profile-update

Set, increment, append to or remove properties on user profiles. Needs the connection's project token, which only /engage requires.

Query retention

retention-query

Of the people who did one thing, how many came back. The cohort event and the return event are separate, and the retention type changes the shape of the answer.

Segment an event

segmentation-query

Counts for one event over a date range, optionally broken down by a property. Choose carefully between counting events and counting people.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Mixpanel's real ids.

{
  "manifestVersion": "2",
  "name": "mixpanel-example",
  "steps": [
    {
      "id": "activity-list",
      "uses": {
        "app": "io.w6w.mixpanel",
        "action": "activity-list",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "distinctIds": "<distinctIds>",
        "fromDate": "<fromDate>",
        "toDate": "<toDate>"
      }
    }
  ]
}

Here are some of the things you can do

  • List a user's activity

    read
    activity-list
  • List cohorts

    read
    cohort-list
  • Export raw events

    read
    event-export
  • Import events

    perform
    event-import
  • List event names

    read
    event-name-list

+8 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Mixpanel, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Mixpanel. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "activity-list",
  payload: {
    distinctIds: "<value>",
    fromDate: "<value>",
    toDate: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action activity-list --payload '{"distinctIds":"<value>","fromDate":"<value>","toDate":"<value>"}'

Give an AI agent Mixpanel — without giving it Mixpanel's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.mixpanel#activity-list",
    "input": {
      "distinctIds": "<distinctIds>",
      "fromDate": "<fromDate>",
      "toDate": "<toDate>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Mixpanel connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Mixpanel's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Mixpanel itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Mixpanel declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Mixpanel platform status

This project's region, split by capability: querying, ingestion and raw export fail independently, so one being out is degraded rather than down.

quota

Query allowance