Skip to main content

At a glance

  • Availability: Experimental (how to enable).
  • Authentication: Basic auth.
  • Connection: HTTP Basic auth with MIXPANEL_SERVICE_ACCOUNT_USERNAME as the username and MIXPANEL_SERVICE_ACCOUNT_SECRET as the password.
  • Provider documentation: Authentication reference.

Credentials

Set these per environment. See Connect an integration.

Setup

Step 1: Create a Service Account

  1. Log in to Mixpanel and open Organization Settings > Service Accounts (https://mixpanel.com/settings/org#serviceaccounts)
  2. Create a service account with access to your project (Analyst role or higher is sufficient for queries)
  3. Copy the service account username and secret shown at creation time
  4. Add them to your .env file as MIXPANEL_SERVICE_ACCOUNT_USERNAME and MIXPANEL_SERVICE_ACCOUNT_SECRET

Step 2: Get Your Project ID

  1. In Mixpanel project settings URL, your Project ID is the number in the URL
  2. Format: https://mixpanel.com/project/YOUR_PROJECT_ID/settings
  3. Copy this ID and add it as MIXPANEL_PROJECT_ID in your .env file; query tools require it as the project_id parameter

Step 3: (Optional) Get Your Project Token

  1. Under Project Settings, find your Project Token
  2. 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_id parameter 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 as mixpanel__query_events with arguments for your account. Confirm that the result comes from the intended account or workspace before enabling write tools.