CONNECT APP
Build with Mixpanel (Service Account)
Data Analytics
- API key
MCP
Give your agent Mixpanel (Service Account) tools
Every Mixpanel (Service Account) action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Mixpanel (Service Account) account for each tool call — you store no tokens.
// 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_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",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"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_service_account",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Aggregate Event Counts:
result = await session.call_tool("mixpanel_service_account-aggregate-event-counts", {
"eventNames": ["Event Names"],
"analysisType": "Analysis Type",
})API PROXY
Call the Mixpanel (Service Account) API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Mixpanel (Service Account) API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.example.com/v1/me",
})
// Any allowed Mixpanel (Service Account) endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# 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"SDK
Run Mixpanel (Service Account) actions from your backend
Connect a user's Mixpanel (Service Account) account once, then run Aggregate Event Counts on their behalf from your own code — TypeScript, Python, or plain HTTP.
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",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="mixpanel_service_account-aggregate-event-counts",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"mixpanel_service_account": {"authProvisionId": "apn_xxxxxxx"},
"eventNames": ["Event Names"],
"analysisType": "Analysis Type",
},
)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_service_account-aggregate-event-counts",
"configured_props": {
"mixpanel_service_account": { "authProvisionId": "apn_xxxxxxx" },
"eventNames": ["Event Names"],
"analysisType": "Analysis Type"
}
}'TOOLS
Mixpanel (Service Account) actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Aggregate Event Counts
actionCount 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 someone already built, use Query Insights Report instead. See the documentationRead-onlyv0.0.1 -
Get Profile Event Activity
actionGet 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 exactdistinct_idvalues; it cannot search by email. Note that Mixpanel has placed the underlying/stream/queryendpoint in maintenance mode. See the documentationRead-onlyv0.0.1 -
List Event Properties
actionList 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 awhereoronexpression. See the documentationRead-onlyv0.0.1 -
List Event Property Values
actionList the most common values a single property takes on a single event. Use this to find the exact literal to compare against in awhereoronexpression, rather than guessing at spellings or casing. See the documentationRead-onlyv0.0.1 -
List Events
actionList 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 documentationRead-onlyv0.0.1 -
List Saved Cohorts
actionList the cohorts saved in this Mixpanel project, with each cohort's ID, name, description, and current member count. See the documentationRead-onlyv0.0.1 -
List Saved Funnels
actionList the funnels saved in this Mixpanel project, returning each funnel'sfunnel_idand name. See the documentationRead-onlyv0.0.1 -
Query Funnel Report
actionGet 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 Funnels report in the Mixpanel UI and read it with Query Insights Report instead. See the documentationRead-onlyv0.0.1 -
Query Insights Report
actionFetch 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 report exists, use Aggregate Event Counts instead. See the documentationRead-onlyv0.0.1 -
Query Profiles
actionLook up user profiles and their stored properties. Results are paginated: when the number of results equalspage_size, call again with the returnedsession_idand the nextpagenumber. See the documentationRead-onlyv0.0.1 -
Query Retention Report
actionRun 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 afirstcount and acountsarray, one entry per interval. See the documentationRead-onlyv0.0.1
EVENTS
Mixpanel (Service Account) triggers
Event sources your backend can deploy for users and receive through a webhook.
No Mixpanel (Service Account) triggers are available yet.
REFERENCE
App details
Reference metadata for the Mixpanel (Service Account) connector in the Pipedream registry.
- App slug
- mixpanel_service_account
- Authentication
- API key
- Categories
- Data Analytics
- Actions
- 11
- Triggers
- 0
- API proxy
- Available