# Mixpanel setup for PopMCP

A Mixpanel service account username and secret, the numeric project ID and your data region, plus an optional project token and GDPR OAuth token.

- Auth: API credentials
- Setup time: 6 min
- API base URL: https://mixpanel.com/api
- Credentials screen: https://mixpanel.com/settings/org#serviceaccounts
- Provider docs: https://developer.mixpanel.com/reference/service-accounts

## Approval required before this works

No one reviews anything, but Mixpanel's Query API (funnels, insights, segmentation, retention, profile event activity) is sold only with the Growth or Enterprise plan - a Free-plan project cannot call it however valid the service account is.

- Typical wait: None - upgrading is self-serve in Mixpanel's billing settings and takes effect immediately
- Cost: Mixpanel does not publish a flat price for Query API access. The Free plan covers up to 1M events/month and excludes the Query API. Growth is usage-based, advertised as 'Starts at $0' and priced by monthly event volume - use Mixpanel's own pricing calculator on mixpanel.com/pricing for a figure, since the published rate changes. Enterprise is custom-quoted by sales.
- Blocked until approved: On the Free plan the Query API endpoints are not included in the plan, so you cannot programmatically pull formatted report data - Insights, Funnels, Retention, Segmentation or profile event activity. Mixpanel's docs state plainly that 'Users with a Growth or Enterprise plan can use our Query API to export formatted report data.' Free users are left exporting reports from the UI. Free does include ingestion and raw export API access.
- Works meanwhile: Everything else works on Free with a service account created in seconds: event ingestion via the /track and /import endpoints, the Raw Event Export API, the Engage (user profiles) API, Lexicon/schema endpoints and the Identity APIs - the Free plan's feature list includes 'Ingestion & export API access'. If your connector only needs raw events and profiles, nothing is gated.

## Before you begin

- Mixpanel account with Owner or Admin permissions on the organization, because Analysts and Consumers cannot create service accounts
- The project you want PopMCP to read, since the connection is locked to one project ID
- Know your data residency: US by default, or EU or India

## Get your credentials

### 1. Open Organization Settings and the Service Accounts tab

Click the gear icon at the bottom of the left nav and choose Organization Settings, then select Service Accounts from the settings menu. EU residency orgs do this on `eu.mixpanel.com` and India orgs on `in.mixpanel.com`.

Screen: https://mixpanel.com/settings/org#serviceaccounts

### 2. Add the service account

Click Add Service Account, name it `popmcp`, and pick an Organization Role. Tick the projects it may reach and leave Expiration empty.

### 3. Copy the username and secret

Copy both the generated username and the secret before you close the dialog. The username ends in `.mp-service-account`.

### 4. Find the numeric project ID

Open Project Settings and read the Project ID on the Overview tab. It is also the number in any Mixpanel URL, such as `mixpanel.com/project/3210987/`.

Screen: https://mixpanel.com/settings/project

### 5. Copy the Project Token only if PopMCP will write events

Open Project Settings and the Access Keys tab, then copy the Project Token. Skip this step if PopMCP only queries data.

Screen: https://mixpanel.com/settings/project

### 6. Paste everything into PopMCP

Enter the username, secret and project ID, then set Region to `us`, `eu` or `in`. Leave GDPR OAuth Token blank unless you need the data deletion and retrieval endpoints.

## Fields PopMCP asks for

- Service Account username (serviceAccountUsername) [required]: Mixpanel → Organization Settings → Service Accounts → Create. You must be an Owner or Admin. Choose the role + projects it can access. Copy the username shown after creation. Stored encrypted.
- Service Account secret (serviceAccountSecret) [required]: Shown only once when the service account is created, so save it immediately. If you lost it, delete the service account and create a new one. Stored encrypted.
- Project ID (projectId) [required]: The numeric project id. Find it in Mixpanel → Project Settings → Overview (or in any Mixpanel URL: mixpanel.com/project/<PROJECT_ID>/…). The connection is locked to this one project.
- Data region (us, eu, or in) (region): Where your Mixpanel data is hosted: us (default), eu (EU Data Residency), or in (India Data Residency). Requests must hit the matching regional host. Pick wrong and calls 401/return no data.
- Project Token (optional) (projectToken): Optional. Project Settings → Access Keys → Project Token. Only needed to send live events/profiles (track, engage, groups) or evaluate feature flags. It's auto-injected so those tools work without you passing it. Batch /import works with just the service account. Stored encrypted.
- GDPR OAuth Token (optional) (oauthToken): Optional. Only the GDPR API (data deletions & retrievals) requires this. It uses an OAuth bearer token (Organization Settings → generate a GDPR/OAuth token), not the service account. Leave blank if you don't need GDPR endpoints. Stored encrypted.

## Verify

PopMCP shows the connector as Connected and names your project, and a test segmentation query returns event counts rather than a 401 Invalid credentials error.

## Troubleshooting

### 401 Invalid credentials

Cause: Wrong regional host, or the username was pasted without its full .mp-service-account suffix.

Fix: Copy the whole username string and set Region to us, eu or in to match the project's residency.

### Queries succeed but return no data

Cause: The credentials are valid but aimed at the wrong regional host, so the project looks empty.

Fix: Check whether you sign in at mixpanel.com, eu.mixpanel.com or in.mixpanel.com and set Region to match.

### 403 on one specific project

Cause: That project was not ticked under Granted Projects when the service account was created.

Fix: Delete and recreate the service account with the project selected, or create a project-level service account instead.

### You lost the secret

Cause: Mixpanel displays the secret only on the creation dialog.

Fix: Delete the service account under Organization Settings, Service Accounts, and create a new one.

### Ingestion tools fail with a missing token error

Cause: The track, engage and groups endpoints need the Project Token, which is a separate credential.

Fix: Copy the Project Token from Project Settings, Access Keys, into the optional Project Token field.

### Credentials stopped working after a few months

Cause: An expiration date was set when the service account was created.

Fix: Create a replacement service account with no expiration and rotate it on your own schedule.

### The Service Accounts tab is not visible

Cause: Your organization role is below Admin.

Fix: Ask an Owner or Admin to create the service account and hand you the username and secret.

---

Source: https://www.docs.popmcp.com/docs/integrations/mixpanel/