Mixpanel MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "MIXPANEL_PROJECT_ID=${MIXPANEL_PROJECT_ID}" mixpanel -- npx -y @t-campbell18/mcp-mixpanel
Required:MIXPANEL_PROJECT_ID+ 4 optional
README.md

Query events, funnels, retention, user profiles, and more via Mixpanel API.

@t-campbell18/mcp-mixpanel

An MCP (Model Context Protocol) server that wraps the Mixpanel REST API. Query events, funnels, retention, user profiles, and more — directly from any MCP-compatible AI agent.

Quick Start

npm install -g @t-campbell18/mcp-mixpanel

Set the required environment variables and run:

export MIXPANEL_PROJECT_ID="your-project-id"
export MIXPANEL_SERVICE_ACCOUNT_USERNAME="your-username"
export MIXPANEL_SERVICE_ACCOUNT_PASSWORD="your-password"
mcp-mixpanel

Environment Variables

Variable Required Description
MIXPANEL_PROJECT_ID Yes Your Mixpanel project ID
MIXPANEL_SERVICE_ACCOUNT_USERNAME One auth method Service account username
MIXPANEL_SERVICE_ACCOUNT_PASSWORD One auth method Service account password
MIXPANEL_API_SECRET One auth method Project API secret (legacy)
MIXPANEL_REGION No US (default) or EU

Authentication

At least one authentication method is required:

  1. Service Account (recommended): Set both MIXPANEL_SERVICE_ACCOUNT_USERNAME and MIXPANEL_SERVICE_ACCOUNT_PASSWORD. Service accounts support all query and export endpoints.
  2. API Secret (legacy): Set MIXPANEL_API_SECRET. Falls back to this if no service account is configured.

Tools

Query API

Tool Description Example Prompt
query_events Query event data with segmentation "How many signups happened last week?"
top_events Get the most common events "What are the top events today?"
event_properties Get top properties for an event "What properties does the Purchase event have?"
query_funnels Query a saved funnel "Show me conversion for funnel 12345"
list_funnels List all saved funnels "What funnels do we have?"
query_retention Query retention data "What's our 7-day retention for signups?"
frequency_report Get frequency/addiction report "How often do users perform the Search event?"
query_profiles Query user profiles "Find users who were last seen after Jan 1"
user_activity Get a user's event stream "Show me recent activity for user abc123"
query_insights Run a saved Insights report "Run insights report 67890"
run_jql Run a JQL script "Run this JQL to find power users"
segmentation_sum Sum a numeric property over time "What's total revenue this month?"
segmentation_average Average a numeric property over time "What's the average order value this week?"
list_cohorts List all cohorts "What cohorts do we have?"

Export API

Tool Description Example Prompt
export_events Export raw event data (NDJSON, max 5000) "Export all Purchase events from last week"

Annotations

Tool Description Example Prompt
list_annotations List annotations in a date range "Show annotations from this month"

Setup

Claude Code

claude mcp add mixpanel -- npx -y @t-campbell18/mcp-mixpanel

Set environment variables in your shell before running Claude Code.

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "mixpanel": {
      "command": "npx",
      "args": ["-y", "@t-campbell18/mcp-mixpanel"],
      "env": {
        "MIXPANEL_PROJECT_ID": "your-project-id",
        "MIXPANEL_SERVICE_ACCOUNT_USERNAME": "your-username",
        "MIXPANEL_SERVICE_ACCOUNT_PASSWORD": "your-password"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "mixpanel": {
      "command": "npx",
      "args": ["-y", "@t-campbell18/mcp-mixpanel"],
      "env": {
        "MIXPANEL_PROJECT_ID": "your-project-id",
        "MIXPANEL_SERVICE_ACCOUNT_USERNAME": "your-username",
        "MIXPANEL_SERVICE_ACCOUNT_PASSWORD": "your-password"
      }
    }
  }
}

VS Code

Add to your VS Code MCP settings (.vscode/mcp.json):

{
  "servers": {
    "mixpanel": {
      "command": "npx",
      "args": ["-y", "@t-campbell18/mcp-mixpanel"],
      "env": {
        "MIXPANEL_PROJECT_ID": "your-project-id",
        "MIXPANEL_SERVICE_ACCOUNT_USERNAME": "your-username",
        "MIXPANEL_SERVICE_ACCOUNT_PASSWORD": "your-password"
      }
    }
  }
}

OpenClaw

mcp_servers:
  - name: mixpanel
    command: npx
    args: ["-y", "@t-campbell18/mcp-mixpanel"]
    env:
      MIXPANEL_PROJECT_ID: "your-project-id"
      MIXPANEL_SERVICE_ACCOUNT_USERNAME: "your-username"
      MIXPANEL_SERVICE_ACCOUNT_PASSWORD: "your-password"

EU Region

If your Mixpanel project is in the EU data residency,

Tools (16)

query_eventsQuery event data with segmentation
top_eventsGet the most common events
event_propertiesGet top properties for an event
query_funnelsQuery a saved funnel
list_funnelsList all saved funnels
query_retentionQuery retention data
frequency_reportGet frequency/addiction report
query_profilesQuery user profiles
user_activityGet a user's event stream
query_insightsRun a saved Insights report
run_jqlRun a JQL script
segmentation_sumSum a numeric property over time
segmentation_averageAverage a numeric property over time
list_cohortsList all cohorts
export_eventsExport raw event data (NDJSON, max 5000)
list_annotationsList annotations in a date range

Environment Variables

MIXPANEL_PROJECT_IDrequiredYour Mixpanel project ID
MIXPANEL_SERVICE_ACCOUNT_USERNAMEService account username
MIXPANEL_SERVICE_ACCOUNT_PASSWORDService account password
MIXPANEL_API_SECRETProject API secret (legacy)
MIXPANEL_REGIONUS (default) or EU

Configuration

claude_desktop_config.json
{"mcpServers": {"mixpanel": {"command": "npx", "args": ["-y", "@t-campbell18/mcp-mixpanel"], "env": {"MIXPANEL_PROJECT_ID": "your-project-id", "MIXPANEL_SERVICE_ACCOUNT_USERNAME": "your-username", "MIXPANEL_SERVICE_ACCOUNT_PASSWORD": "your-password"}}}}

Try it

How many signups happened last week?
What are the top events today?
Show me conversion for funnel 12345
What's our 7-day retention for signups?
Export all Purchase events from last week

Frequently Asked Questions

What are the key features of Mixpanel MCP Server?

Query event data, funnels, and retention metrics. Access user profiles and activity streams. Run saved Insights reports and JQL scripts. Export raw event data in NDJSON format. List cohorts and annotations.

What can I use Mixpanel MCP Server for?

Analyzing user conversion funnels directly from an AI chat interface. Retrieving specific user activity streams for support troubleshooting. Generating automated reports on key business metrics like revenue or signups. Running complex JQL queries to identify power users without manual coding.

How do I install Mixpanel MCP Server?

Install Mixpanel MCP Server by running: npm install -g @t-campbell18/mcp-mixpanel

What MCP clients work with Mixpanel MCP Server?

Mixpanel MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Mixpanel MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare