# Mixpanel (Service Account) — Pipedream Connect

> Powerful, self-serve product analytics to help you convert, engage, and retain more users.

- API slug: `mixpanel_service_account` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Data Analytics
- Website: https://mixpanel.com
- This page (HTML): https://pipedream.com/apps/mixpanel-service-account
- Tools: 11 actions · 0 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: mixpanel_service_account`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "mixpanel_service_account",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Aggregate Event Counts:
const result = await mcp.callTool({
  name: "mixpanel_service_account-aggregate-event-counts",
  arguments: {
    eventNames: ["Event Names"],
    analysisType: "Analysis Type",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Mixpanel (Service Account) endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.example.com/v1/me

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vdjEvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "mixpanel_service_account-aggregate-event-counts",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mixpanel_service_account: { authProvisionId: "apn_xxxxxxx" },
    eventNames: ["Event Names"],
    analysisType: "Analysis Type",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (11)

### `mixpanel_service_account-aggregate-event-counts` — Aggregate Event Counts (Read-only)

Count how many times one or more events happened over a date range, bucketed by minute, hour, day, week, or month. This is the tool for ad-hoc questions such as "how many signups this week?" - it needs no report to be saved in Mixpanel first. If the answer should come from an Insights report…

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/aggregate-event-counts.md

### `mixpanel_service_account-get-profile-event-activity` — Get Profile Event Activity (Read-only)

Get the chronological event feed for one or more specific users - what they did, when, and with which event properties. This is the "what has this user been doing?" tool. Requires exact distinct_id values; it cannot search by email. Note that Mixpanel has placed the underlying /stream/query…

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/get-profile-event-activity.md

### `mixpanel_service_account-list-event-properties` — List Event Properties (Read-only)

List the property names most frequently sent with a single event, together with how many times each was seen. Use this to discover what an event can be filtered or broken down by before writing a where or on expression. See the documentation

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/list-event-properties.md

### `mixpanel_service_account-list-event-property-values` — List Event Property Values (Read-only)

List the most common values a single property takes on a single event. Use this to find the exact literal to compare against in a where or on expression, rather than guessing at spellings or casing. See the documentation

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/list-event-property-values.md

### `mixpanel_service_account-list-events` — List Events (Read-only)

List the names of the events tracked in this Mixpanel project over the last 31 days, ordered by how often they were fired. Start here when you do not already know the exact event name a question refers to - most other tools need an exact, case-sensitive name. See the documentation

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/list-events.md

### `mixpanel_service_account-list-saved-cohorts` — List Saved Cohorts (Read-only)

List the cohorts saved in this Mixpanel project, with each cohort's ID, name, description, and current member count. See the documentation

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/list-saved-cohorts.md

### `mixpanel_service_account-list-saved-funnels` — List Saved Funnels (Read-only)

List the funnels saved in this Mixpanel project, returning each funnel's funnel_id and name. See the documentation

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/list-saved-funnels.md

### `mixpanel_service_account-query-funnel-report` — Query Funnel Report (Read-only)

Get conversion numbers for a funnel that has already been saved in the Mixpanel UI: step counts, conversion rates, and average time between steps. Note that Mixpanel has placed the Funnels Query API in maintenance mode and recommends against new use of it - to build a new integration, save a…

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/query-funnel-report.md

### `mixpanel_service_account-query-insights-report` — Query Insights Report (Read-only)

Fetch the computed numbers behind an Insights report that has already been saved in the Mixpanel UI, exactly as the report renders them. Use this when the question maps to a metric the team has already defined and you want their definition rather than your own. For ad-hoc counts where no saved…

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/query-insights-report.md

### `mixpanel_service_account-query-profiles` — Query Profiles (Read-only)

Look up user profiles and their stored properties. Results are paginated: when the number of results equals page_size, call again with the returned session_id and the next page number. See the documentation

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/query-profiles.md

### `mixpanel_service_account-query-retention-report` — Query Retention Report (Read-only)

Run a cohort retention analysis: of the users who first did one event, how many came back and did another over the following intervals. Answers questions like "what does week-4 retention look like for users who signed up in June?". The response maps each cohort date to a first count and a counts…

Full schema: https://pipedream.com/apps/mixpanel-service-account/actions/query-retention-report.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
