Mixpanel ACTION
Track Event
Send a single event to Mixpanel, attributing it to a user. To query analytics (event counts, funnels, retention, user profiles), connect the separate Mixpanel (Service Account) app, since Mixpanel's query APIs do not accept a project token. See the documentation
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Mixpanel account once, then configure and run Track Event from your backend or agent.
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-emit-event-to",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
mixpanel: { authProvisionId: "apn_xxxxxxx" },
event_name: "Event Name",
distinct_id: "Distinct ID",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "mixpanel-emit-event-to",
"configured_props": {
"mixpanel": { "authProvisionId": "apn_xxxxxxx" },
"event_name": "Event Name",
"distinct_id": "Distinct ID"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "mixpanel-emit-event-to",
arguments: {
event_name: "Event Name",
distinct_id: "Distinct ID",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
event_name Event Name | string | The name of the event, for example Sign Up, Button Click, or Item Purchased. Event names are case-sensitive, and reusing an existing name is what groups events together in reports. Required |
distinct_id Distinct ID | string | The Mixpanel distinct_id of the user who performed the event, for example user_123. Use the same stable identifier you send with your other Mixpanel events so that repeat events attribute to the same profile. Required |
properties Properties | object | Additional properties to attach to the event, describing either the user or the event itself. Example: {"plan": "pro", "source": "onboarding"}. Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- mixpanel-emit-event-to
- Version
- 0.4.0
- App
- Mixpanel
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗