Skip to main content

Overview

Mixpanel provides a hosted Model Context Protocol (MCP) server that gives AI assistants direct access to your Mixpanel data. Once connected, you can query events, funnels, flows, retention, session replays, and more using natural language — no dashboard navigation required. A typical workflow looks like:
  1. Discover: Find your projects, events, and properties
  2. Query: Run insights, funnels, flows, or retention analyses
  3. Create: Build dashboards, organize Lexicon, or manage data quality issues
  4. Iterate: Refine with follow-up questions in the same conversation

Available Tools

Experiments and Feature Flags tools are in open beta and available to all users. Audience targeting and cohort editing are not yet supported via MCP — use the Mixpanel UI instead.

MCP Server URLs

Permissions & Access

Admin setup required. An organization admin must enable MCP in Settings → Org → Overview before anyone can connect. Changes can take up to 15 minutes to take effect.
Once enabled, any Mixpanel user in your organization can connect. Users authenticate with their own Mixpanel credentials, so all existing project permissions and roles apply — users can only see data from projects they already have access to.

Connecting to the MCP Server

Mixpanel’s MCP server supports two authentication methods:
  • OAuth — Users sign in through a browser with their Mixpanel credentials. Best for interactive use in AI assistants like Claude, ChatGPT, or Cursor.
  • Service Accounts (Beta) — A static credential header with no browser login required. Best for CI/CD pipelines, automated agents, and shared team setups.
Choose the method that fits your use case below.

Connecting with OAuth

Claude

Add Mixpanel to Claude and complete the Mixpanel OAuth flow. For EU or IN regions, use Settings → Connectors → Add Custom Connector instead, and enter your MCP Server URL.

Claude Code

Claude Code MCP docs
Then authenticate by running /mcp inside Claude Code and completing the Mixpanel OAuth flow in your browser.

ChatGPT

Add Mixpanel to ChatGPT and complete the Mixpanel OAuth flow. For EU or IN regions, or to publish the connector to your workspace so teammates can use it:
  1. Go to Settings → Connectors → Advanced and enable Developer Mode
  2. Add a new connector — set the MCP Server URL to your regional endpoint and Authentication to OAuth
  3. Complete the Mixpanel OAuth flow
  4. Optionally publish the connector to your workspace so teammates can use it

Codex

  1. Go to Settings → MCP Servers → + Add Server
  2. Provide a name (e.g. Mixpanel) and select Streamable HTTP
  3. Enter your MCP Server URL and click Save

Codex CLI

Add the following to ~/.codex/config.toml (use the EU or IN URL if needed):
Then authorize:

Notion

  1. Create a new Agent from the Agents section in the Notion sidebar
  2. In the Agent’s Settings, go to Tools and Access → + Add Connection
  3. Select Mixpanel and complete the OAuth flow

Gemini CLI

Or edit ~/.gemini/settings.json manually and add:

Cursor

  1. Go to Settings → Tools & MCP → New MCP Server to open ~/.cursor/mcp.json
  2. Add the following (use the EU or IN URL if needed):
  1. Save the file — Cursor will prompt you to authorize with Mixpanel on first connect

Microsoft Copilot (JSON-configured clients)

Any client that supports the MCP JSON config format, including Microsoft Copilot, can connect using the same JSON snippet from the Cursor section above. The first time it connects it will prompt you to authorize with Mixpanel.

Connecting with Service Accounts

Beta. Service account authentication for MCP is in beta. The interface may change.
Service accounts are non-human Mixpanel users designed for scripts, back-end services, and automated workflows. They authenticate via a static header — no browser-based login is required. Use service accounts when you need a headless MCP connection, such as CI/CD pipelines, automated agents, or shared team setups. The service account’s project permissions apply: it can only access projects it has been added to.

Prerequisites

  1. Create a service account in your Organization settings or Project settings. You need Owner or Admin permissions to do this.
  2. Save the username and secret — you won’t be able to view the secret again after creation.
  3. Ensure the service account has access to the projects you want to query via MCP.
  4. MCP must be enabled by an org admin in Settings → Org → Overview.

Generating the Authorization Header

Encode the service account credentials as a base64 string and construct the authorization header:
This outputs a base64-encoded string. The full header value is:
For example, if your username is my-sa.abc123.mp-service-account and your secret is my-secret, run:
The header would be: Authorization: Bearer Basic bXktc2EuYWJjMTIzLm1wLXNlcnZpY2UtYWNjb3VudDpteS1zZWNyZXQ=
Treat the base64-encoded credentials like a password. Use environment variables or secret managers instead of hardcoding them in config files.

Claude

Claude Desktop MCP docs Open your config file via Settings → Developer → Edit Config and add the following (use the EU or IN URL if needed):
Restart Claude Desktop after saving the file.

Claude Code

Claude Code MCP docs
Or add it to your .mcp.json file using an environment variable:
Set MIXPANEL_SA_TOKEN to your base64-encoded credentials before starting Claude Code.

Codex

  1. Go to Settings → MCP Servers → + Add Server
  2. Provide a name (e.g. Mixpanel) and select Streamable HTTP
  3. Enter your MCP Server URL
  4. Add the authorization header and click Save

Codex CLI

Add the following to ~/.codex/config.toml (use the EU or IN URL if needed):

Notion

Service accounts are not supported through the Notion agent connector. Use Cursor or another client that supports custom headers instead.

Gemini CLI

Or edit ~/.gemini/settings.json manually and add (use the EU or IN URL if needed):

Cursor

Cursor MCP docs
  1. Go to Settings → Tools & MCP → New MCP Server to open ~/.cursor/mcp.json
  2. Add the following (use the EU or IN URL if needed):
  1. Set the MIXPANEL_SA_TOKEN environment variable to your base64-encoded credentials

Microsoft Copilot (JSON-configured clients)

Any client that supports the MCP JSON config format, including Microsoft Copilot, can connect using the same JSON snippet from the Cursor section above — adding the headers object with the authorization header.

Example Queries

Once connected, try asking your AI assistant: Understand your data
  • “What projects do I have access to?”
  • “What are the most fired events this week?”
  • “Which properties on checkout_completed are marked as PII?”
Query & analyze
  • “How many sign ups did we have in February?”
  • “What’s our signup-to-purchase conversion rate this month vs last month?”
  • “Show 7-day retention for users who completed onboarding in Q1”
  • “Which acquisition channels have the best 30-day retention?”
Create & build
  • “Create a board of purchase metrics”
  • “Build a weekly growth dashboard with signups, activations, and churn”
Automate Lexicon work
  • “Add descriptions to any events that don’t have one”
  • “Tag all checkout-related events with ‘Checkout’”
  • “Hide any events that haven’t fired in the last 90 days”
  • “Find all properties that look like PII but aren’t flagged yet”
Triage data quality
  • “Show me all open data quality issues for the Signup event”
  • “Dismiss all issues for events we deprecated last quarter”
Test & ship
  • “Create an experiment to test whether showing a progress indicator during onboarding increases activation rate”
  • “Create a feature flag for our new AI-powered search”
  • “How did our checkout experiment perform? Did it reach significance?”
Investigate users
  • “This user reported a bug — what happened in their last 3 sessions?”
  • “Walk me through what [user ID] did before they churned”

Security Considerations

The MCP server does not currently support HIPAA requirements. Mixpanel’s Business Associate Agreement (BAA) does not cover this feature.
When connected, the AI assistant can both read and write to Mixpanel on your behalf. Your Mixpanel data is also sent to whichever AI provider you’re using (Claude, ChatGPT, etc.), so review that provider’s data handling policies before connecting. Access controls
  • MCP must be explicitly enabled by an org admin. It is off by default
  • Users can only access projects they already have permission to view in Mixpanel
  • All existing roles and project-level permissions remain in effect
Other considerations
  • Check applicable compliance requirements (GDPR, CCPA, etc.) before connecting to projects with personal data
  • If using a shared AI environment (e.g., a team workspace), be aware that conversation history may be visible to others

Troubleshooting

  • “MCP access is not enabled for this project”: Ask your org admin to enable MCP in Settings → Org → Overview.
  • “Missing scope” error: Your cached auth token was created with an outdated scope list. Delete the .mcp-auth folder in the directory where you ran the authorization command, then re-authorize.
  • Authorization fails: Ensure your Mixpanel account has access to at least one project and that MCP is enabled at the org level.
  • Desktop app doesn’t pick up config changes: Restart the application after editing the config file.

Rate Limits

  • A maximum of 600 MCP requests/hour per user

Building Custom Integrations (OAuth)

If you’re building a third-party MCP client or custom integration, use the following OAuth configuration.

OAuth Discovery

Mixpanel’s MCP server supports OAuth discovery via two well-known endpoints, following RFC 8414 and RFC 9728: Protected Resource Metadata (RFC 9728): Discover which authorization servers can issue tokens for this resource:
Authorization Server Metadata (RFC 8414): Discover authorization, token, and registration endpoints:
The following endpoints are deprecated but still available:

Dynamic Client Registration

Authorization Code Flow with PKCE

Mixpanel uses Authorization Code + PKCE (S256):
  • Authorization endpoint: https://{mixpanel_domain}/oauth/authorize
  • Token endpoint: https://{mixpanel_domain}/oauth/token/
  • Grant types: authorization_code, refresh_token
  • Code challenge method: S256
  • Token endpoint auth methods: none, client_secret_basic, client_secret_post

Required OAuth Scopes

Mandatory:
Optional:
To request a specific subset of scopes, pass --static-oauth-client-metadata '{ "scope": "..." }' to npx mcp-remote. Otherwise all available scopes are requested automatically.