At a glance
- Availability: Experimental (how to enable).
- Authentication: Basic auth.
- Connection: HTTP Basic auth with
MIXPANEL_SERVICE_ACCOUNT_USERNAMEas the username andMIXPANEL_SERVICE_ACCOUNT_SECRETas the password. - Provider documentation: Authentication reference.
Credentials
Set these per environment. See Connect an integration.Setup
Step 1: Create a Service Account
- Log in to Mixpanel and open Organization Settings > Service Accounts (https://mixpanel.com/settings/org#serviceaccounts)
- Create a service account with access to your project (Analyst role or higher is sufficient for queries)
- Copy the service account username and secret shown at creation time
- Add them to your .env file as
MIXPANEL_SERVICE_ACCOUNT_USERNAMEandMIXPANEL_SERVICE_ACCOUNT_SECRET
Step 2: Get Your Project ID
- In Mixpanel project settings URL, your Project ID is the number in the URL
- Format: https://mixpanel.com/project/YOUR_PROJECT_ID/settings
- Copy this ID and add it as
MIXPANEL_PROJECT_IDin your .env file; query tools require it as the project_id parameter
Step 3: (Optional) Get Your Project Token
- Under Project Settings, find your Project Token
- Add it as
MIXPANEL_PROJECT_TOKEN; it is only needed for local event-tracking (ingestion), not for queries
Step 4: Set Up Environment Variables
Add these to your.env file:
Step 5: Test the Integration
Run the List Cohorts or List Funnels tool with your project_id to verify the service account works.Important Notes
- Service accounts authenticate via HTTP Basic auth (username + secret) and are Mixpanel’s recommended method for the Query and Export APIs
- Every query tool requires the
project_idparameter when authenticating with a service account - If your project stores data in the EU or India, set MIXPANEL_HOST and MIXPANEL_EXPORT_HOST to the matching hosts (eu.mixpanel.com / data-eu.mixpanel.com, or in.mixpanel.com / data-in.mixpanel.com)
- Project Token is used only for tracking events (ingestion)
- Keep credentials secure and never commit them to version control
Useful Resources
Tools
Verify the connection
Call a read tool such asmixpanel__query_events with arguments for your account. Confirm that the result comes from the intended account or workspace before enabling write tools.