Skip to main content
Glama
Mixpanel MCP

Mixpanel MCP

by mendeel

Mixpanel MCP Server

npm version License: MIT

A Model Context Protocol (MCP) server that provides AI assistants with comprehensive access to Mixpanel analytics data. This server enables AI tools like Claude Desktop, Continue.dev, VS Code, Cursor, and other MCP-compatible clients to retrieve and work with Mixpanel data seamlessly.

🚀 Key Features

  • Event Analytics: Get today's top events, event counts, and event properties

  • User Profiles: Query user profiles and analyze individual user journeys

  • Retention Analysis: Analyze user retention patterns and cohort behavior

  • Funnel Analysis: Retrieve and analyze conversion funnels

  • Segmentation: Segment events and users by properties

  • Custom Queries: Run custom JQL (JSON Query Language) scripts

  • Multi-Region Support: Works with both US and EU Mixpanel instances

🌍 Important: If you use eu.mixpanel.com, make sure to add --region eu or -r eu to your commands!

Related MCP server: Mixpanel MCP Server

📦 Quick Start

The fastest way to get started - no installation required!

# Basic usage with required credentials
npx @mendeel/mcp-mixpanel --username YOUR_USERNAME --password YOUR_PASSWORD --project-id YOUR_PROJECT_ID

# Short form
npx @mendeel/mcp-mixpanel -u YOUR_USERNAME -p YOUR_PASSWORD -i YOUR_PROJECT_ID

# EU region
npx @mendeel/mcp-mixpanel -u YOUR_USERNAME -p YOUR_PASSWORD -i YOUR_PROJECT_ID -r eu

# Using environment variables
export MIXPANEL_SERVICE_ACCOUNT_USERNAME=your_username
export MIXPANEL_SERVICE_ACCOUNT_PASSWORD=your_password
export MIXPANEL_PROJECT_ID=your_project_id
npx @mendeel/mcp-mixpanel

🎯 Try it now: Run npx @mendeel/mcp-mixpanel --help to see all options!

🔧 Command Line Options

mcp-mixpanel [options]

Options:
  --username, -u <username>       Mixpanel service account username
  --password, -p <password>       Mixpanel service account password
  --project-id, -i <project_id>   Default Mixpanel project ID
  --region, -r <region>           Mixpanel region (us or eu) - default: us
  --help, -h                      Show help message  
  --version, -v                   Show version information

Environment Variables:
  MIXPANEL_SERVICE_ACCOUNT_USERNAME    Mixpanel service account username
  MIXPANEL_SERVICE_ACCOUNT_PASSWORD    Mixpanel service account password
  MIXPANEL_PROJECT_ID                  Default Mixpanel project ID
  MIXPANEL_REGION                      Mixpanel region (us or eu) - default: us

Examples:
  npx @mendeel/mcp-mixpanel --help
  npx @mendeel/mcp-mixpanel --version
  npx @mendeel/mcp-mixpanel -u myuser -p mypass -i 12345
  npx @mendeel/mcp-mixpanel -u myuser -p mypass -i 12345 -r eu
  MIXPANEL_PROJECT_ID=12345 npx @mendeel/mcp-mixpanel -u myuser -p mypass -r us

🔑 Mixpanel Setup

📝 Getting Your Credentials (2 minutes)

  1. Go to Mixpanel Organization Settings:

    • Visit your Mixpanel dashboard

    • Go to Organization Settings → Service Accounts

  2. Create Service Account:

    • Click "Create Service Account"

    • Give it a name like "MCP Server"

    • Copy the username and password - you won't see them again!

  3. Get Your Project ID:

    • Go to Project Settings

    • Copy your Project ID from the project information

  4. Note Your Region:

    • US Region: Use -r us (default) for mixpanel.com

    • EU Region: Use -r eu for eu.mixpanel.com

    • If you access Mixpanel at eu.mixpanel.com, you MUST use -r eu

🚀 Using Your Credentials

Method 1: Command Line (Quick testing)

# US region (default)
npx @mendeel/mcp-mixpanel --username your_username --password your_password --project-id your_project_id

# EU region (if you use eu.mixpanel.com)
npx @mendeel/mcp-mixpanel --username your_username --password your_password --project-id your_project_id --region eu

Method 2: Environment Variables (Recommended)

# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export MIXPANEL_SERVICE_ACCOUNT_USERNAME=your_username
export MIXPANEL_SERVICE_ACCOUNT_PASSWORD=your_password
export MIXPANEL_PROJECT_ID=your_project_id
export MIXPANEL_REGION=us  # or 'eu' for EU region

# Then simply run:
npx @mendeel/mcp-mixpanel

🛠️ Editor Integration

VS Code Integration

Method 1: Using Continue Extension

  1. Install Continue Extension:

    • Open VS Code

    • Go to Extensions (Ctrl+Shift+X)

    • Search for "Continue" and install it

  2. Configure MCP Server:

    • Open Command Palette (Ctrl+Shift+P)

    • Type "Continue: Configure" and select it

    • Add this configuration to your settings:

{
  "continue.server": {
    "mcpServers": {
      "mixpanel": {
        "command": "npx",
        "args": ["@mendeel/mcp-mixpanel", "--username", "your_username", "--password", "your_password", "--project-id", "your_project_id", "--region", "us"]
      }
    }
  }
}

Method 2: Using Claude Extension

  1. Install Claude Extension:

    • Search for "Claude" in VS Code extensions

    • Install the official Claude extension

  2. Configure MCP Server:

    • Add to your VS Code settings.json:

{
  "claude.mcpServers": {
    "mixpanel": {
      "command": "npx",
      "args": ["@mendeel/mcp-mixpanel"],
      "env": {
        "MIXPANEL_SERVICE_ACCOUNT_USERNAME": "your_username",
        "MIXPANEL_SERVICE_ACCOUNT_PASSWORD": "your_password",
        "MIXPANEL_PROJECT_ID": "your_project_id",
        "MIXPANEL_REGION": "us"
      }
    }
  }
}

Cursor Integration

Method 1: Global Configuration

  1. Open Cursor Settings:

    • Go to Settings (Cmd/Ctrl + ,)

    • Search for "MCP" or "Model Context Protocol"

  2. Add MCP Server Configuration:

{
  "mcpServers": {
    "mixpanel": {
      "command": "npx",
              "args": ["@mendeel/mcp-mixpanel", "--username", "your_username", "--password", "your_password", "--project-id", "your_project_id"]
    }
  }
}

Method 2: Workspace Configuration

Create a .cursorrules file in your project root:

{
  "mcpServers": {
    "mixpanel": {
      "command": "npx",
      "args": ["@mendeel/mcp-mixpanel"],
      "env": {
        "MIXPANEL_SERVICE_ACCOUNT_USERNAME": "your_username",
        "MIXPANEL_SERVICE_ACCOUNT_PASSWORD": "your_password",
        "MIXPANEL_PROJECT_ID": "your_project_id",
        "MIXPANEL_REGION": "us"
      }
    }
  }
}

Claude Desktop Integration

Add to your Claude Desktop configuration (~/.config/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "mixpanel": {
      "command": "npx",
              "args": ["@mendeel/mcp-mixpanel", "--username", "your_username", "--password", "your_password", "--project-id", "your_project_id"]
    }
  }
}

Or with environment variables:

{
  "mcpServers": {
    "mixpanel": {
      "command": "npx",
      "args": ["@mendeel/mcp-mixpanel"],
      "env": {
        "MIXPANEL_SERVICE_ACCOUNT_USERNAME": "your_username",
        "MIXPANEL_SERVICE_ACCOUNT_PASSWORD": "your_password",
        "MIXPANEL_PROJECT_ID": "your_project_id",
        "MIXPANEL_REGION": "us"
      }
    }
  }
}

Continue.dev Integration

  1. Install Continue.dev:

  2. Configure MCP Server:

    • Open Continue.dev

    • Go to Settings → MCP Servers

    • Add new server:

{
  "name": "mixpanel",
  "command": "npx",
          "args": ["@mendeel/mcp-mixpanel", "--username", "your_username", "--password", "your_password", "--project-id", "your_project_id"]
}

🎯 Usage Examples

Getting Today's Top Events

Ask your AI assistant:

"Show me today's top events from Mixpanel"

The AI can now access real-time event data and identify trending activities.

Analyzing User Behavior

Ask your AI assistant:

"Get the event activity for user ID 12345 from last week"

The AI can retrieve detailed user journey data and analyze behavior patterns.

Retention Analysis

Ask your AI assistant:

"What's the 7-day retention for users who signed up in January?"

The AI can generate retention reports and provide insights on user engagement.

🛠️ Available Tools

The MCP server provides these tools for AI assistants:

Event Tools

  • get_today_top_events - Get today's most active events

  • get_top_events - Get top events over the last 31 days

  • aggregate_event_counts - Get event counts over time periods

  • aggregated_event_property_values - Analyze specific event properties

User Profile Tools

  • profile_event_activity - Get individual user event activity

  • query_profiles - Query user profiles with filtering

Analytics Tools

  • query_retention_report - Analyze user retention

  • query_funnel_report - Get funnel conversion data

  • list_saved_funnels - List available funnels

  • list_saved_cohorts - List user cohorts

Advanced Tools

  • custom_jql - Run custom JQL queries

  • query_segmentation_report - Segment events by properties

  • query_insights_report - Get saved insights reports

Example Tool Usage

// These tools can be called by AI assistants via MCP protocol

// Get today's top events
{
  "tool": "get_today_top_events",
  "arguments": { "limit": 5 }
}

// Get user activity
{
  "tool": "profile_event_activity",
  "arguments": { 
    "distinct_ids": "[\"user123\"]",
    "from_date": "2024-01-01",
    "to_date": "2024-01-07"
  }
}

// Analyze retention
{
  "tool": "query_retention_report", 
  "arguments": { 
    "from_date": "2024-01-01",
    "to_date": "2024-01-31",
    "born_event": "sign_up"
  }
}

🐛 Troubleshooting

Common Issues

"Authentication failed" errors:

# Solution: Check your service account credentials
npx @mendeel/mcp-mixpanel --username your_username --password your_password --project-id your_project_id

"Command not found" errors:

# Solution: Install Node.js 18+ and ensure npx is available
node --version  # Should be 18+
npx --version   # Should work

"Project not found" errors:

# Check your project ID in Mixpanel Project Settings
# Make sure the service account has access to the project

Network/proxy issues:

# Set proxy if needed
export HTTP_PROXY=http://your-proxy:8080
export HTTPS_PROXY=http://your-proxy:8080
npx mcp-mixpanel

Editor not recognizing MCP server:

# Verify the server is running
npx @mendeel/mcp-mixpanel --help

# Check your editor's MCP configuration
# Ensure the command and args are correct

Debug Mode

Enable verbose logging:

# Set debug environment variable
DEBUG=* npx @mendeel/mcp-mixpanel --username your_username --password your_password --project-id your_project_id

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

📞 Support

⭐ Acknowledgments

  • Mixpanel for the powerful analytics platform

  • Anthropic for the Model Context Protocol specification

  • The open source community for inspiration and contributions


Made with ❤️ for the MCP community

Star ⭐ this repo if you find it helpful!

Available Tools

13 tools
aggregated_event_property_valuesB

Analyze specific event properties and their values. Useful for understanding property distributions and identifying common values.

Inputs: event (required), property (required), from_date (required), to_date (required), +2 more.

aggregate_event_countsB

Get event counts over time periods. Useful for analyzing event volume trends and identifying patterns in user activity over time.

Inputs: event (required), from_date (required), to_date (required), project_id, +1 more.

custom_jqlB

Run custom JQL (JSON Query Language) queries. Useful for advanced analytics and custom data analysis beyond standard reports.

Inputs: script (required), project_id.

get_today_top_eventsB

Get today's top events from Mixpanel. Useful for quickly identifying the most active events happening today, spotting trends, and monitoring real-time user activity.

Inputs: project_id, type, limit.

get_top_eventsB

Get a list of the most common events over the last 31 days. Useful for identifying key user actions, prioritizing feature development, and understanding overall platform usage patterns.

Inputs: project_id, type, limit.

list_saved_cohortsB

List user cohorts in the project. Useful for discovering existing user segments and getting cohort IDs for analysis.

Inputs: project_id.

list_saved_funnelsB

List available saved funnels in the project. Useful for discovering existing funnel analyses and getting funnel IDs for further analysis.

Inputs: project_id.

profile_event_activityB

Get data for a profile's event activity. Useful for understanding individual user journeys, troubleshooting user-specific issues, and analyzing behavior patterns of specific users.

Inputs: distinct_ids (required), from_date (required), to_date (required), project_id, +1 more.

query_funnel_reportC

Get funnel conversion data. Useful for analyzing conversion rates through multi-step user flows and identifying drop-off points.

Inputs: from_date (required), to_date (required), events (required), project_id, +2 more.

query_insights_reportC

Get saved insights reports. Useful for accessing pre-configured analytics reports and dashboards.

Inputs: report_id (required), project_id, from_date, to_date.

query_profilesB

Query user profiles with filtering. Useful for finding users based on profile properties and analyzing user segments.

Inputs: project_id, where, select, limit.

query_retention_reportC

Analyze user retention patterns. Useful for understanding how well you retain users over time and identifying cohort behavior.

Inputs: from_date (required), to_date (required), born_event (required), project_id, +5 more.

query_segmentation_reportC

Segment events by properties. Useful for analyzing how different user segments behave and comparing event patterns across groups.

Inputs: event (required), from_date (required), to_date (required), on (required), +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 13 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific Mixpanel features like events, cohorts, funnels, profiles, and reports, with clear boundaries. However, some overlap exists between 'get_today_top_events' and 'get_top_events' (both focus on top events but differ in timeframes), which could cause minor confusion without careful reading of descriptions.

    Naming Consistency4/5

    The naming follows a consistent pattern with descriptive verb_noun combinations like 'list_saved_cohorts', 'query_funnel_report', and 'aggregate_event_counts', making them readable and predictable. There are minor deviations such as 'get_today_top_events' and 'get_top_events' using 'get' instead of 'query' or 'list', but overall the conventions are well-maintained.

    Tool Count5/5

    With 13 tools, this server is well-scoped for Mixpanel analytics, covering key areas like event analysis, user profiling, funnel tracking, and report queries. Each tool serves a specific function in the domain, and the count is neither too sparse nor overwhelming, fitting typical MCP server ranges.

    Completeness5/5

    The tool set provides comprehensive coverage of Mixpanel's core analytics capabilities, including event aggregation, user segmentation, funnel analysis, retention tracking, and custom queries. It supports full lifecycle workflows from data retrieval to advanced analysis, with no obvious gaps for typical agent tasks in this domain.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants like Claude to interact with Mixpanel analytics, allowing them to track events, page views, user signups, and update user profiles directly through natural language requests.
      50 npm
      5
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that provides access to the Mixpanel REST API, enabling AI agents to query events, funnels, retention data, and user profiles. It allows users to perform complex analytics tasks and export raw event data through natural language prompts.
      16
      19 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Open-source MCP server for Claude AI that connects Stripe and Supabase to enable natural language SaaS analytics, including churn analysis, subscription tracking, and revenue insights.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server that provides product and web analytics capabilities, allowing AI coding assistants to query funnels, retention, trends, feature flags, A/B tests, and more in natural language.
      4
      MIT