npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@andrew_eragon/mcp-mixpanel

v0.0.10

Published

SaaS-ready Mixpanel MCP server with connection pooling, multi-tenant support, and automatic retry logic

Readme

Mixpanel MCP Server

npm version License: MIT

🚀 SaaS-ready Mixpanel MCP server with enterprise-grade features: connection pooling, multi-tenant support, automatic retry logic, and graceful shutdown.

Query your Mixpanel events data directly from any MCP client like Claude Desktop, Cursor, or AI frameworks like Agno. Perfect for on-demand analytics like: "What's the weekly retention for users in the Feb 1 cohort?"

Features

🏢 Enterprise SaaS Architecture

  • Connection Pooling - Reuses connections, reduces auth overhead by ~70%
  • Multi-Tenant Support - Per-request credential isolation, concurrent users
  • Automatic Retry Logic - 3 retries with exponential backoff + jitter
  • Timeout Protection - 30-second timeout on all requests
  • Idle Connection Cleanup - 30min timeout, 5min cleanup interval
  • Graceful Shutdown - Proper cleanup on SIGINT/SIGTERM
  • Comprehensive Logging - Pool statistics and performance metrics

See SAAS_ARCHITECTURE.md for detailed documentation.

Prerequisites

  1. A Mixpanel account with a Service Account
  2. Your service account username and password
  3. Your Mixpanel project ID (found in Project Settings)
  4. Node.js >= 18.0.0

Installation

Method 1: Direct npx (Recommended)

The simplest way to use this server:

npx -y @andrew_eragon/mcp-mixpanel <USERNAME> <PASSWORD> <PROJECT_ID>

Method 2: Global Installation

npm install -g @andrew_eragon/mcp-mixpanel
mcp-mixpanel <USERNAME> <PASSWORD> <PROJECT_ID>

Method 3: From Source

git clone https://github.com/andrew_eragon/mcp-mixpanel.git
cd mcp-mixpanel
npm install
npm run build
node build/index.js <USERNAME> <PASSWORD> <PROJECT_ID>

Usage

With Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "mixpanel": {
      "command": "npx",
      "args": [
        "-y",
        "@andrew_eragon/mcp-mixpanel",
        "YOUR_SERVICE_ACCOUNT_USERNAME",
        "YOUR_SERVICE_ACCOUNT_PASSWORD",
        "YOUR_PROJECT_ID"
      ]
    }
  }
}

Or with environment variables:

{
  "mcpServers": {
    "mixpanel": {
      "command": "npx",
      "args": ["-y", "@andrew_eragon/mcp-mixpanel"],
      "env": {
        "MIXPANEL_USERNAME": "YOUR_SERVICE_ACCOUNT_USERNAME",
        "MIXPANEL_PASSWORD": "YOUR_SERVICE_ACCOUNT_PASSWORD",
        "MIXPANEL_PROJECT_ID": "YOUR_PROJECT_ID"
      }
    }
  }
}

With Cursor

Go to Settings → Cursor Settings → Features → MCP Servers → + Add

Select Type: command and paste:

npx -y @andrew_eragon/mcp-mixpanel YOUR_USERNAME YOUR_PASSWORD YOUR_PROJECT_ID

With Agno Framework (Python)

from agno.tools.mcp import MCPTools

mixpanel = MCPTools(
    stdio={
        "command": "npx",
        "args": [
            "-y",
            "@andrew_eragon/mcp-mixpanel",
            "YOUR_SERVICE_ACCT_USERNAME",
            "YOUR_SERVICE_ACCT_PASSWORD",
            "YOUR_MIXPANEL_PROJECT_ID"
        ]
    }
)

# Or using environment variables (recommended):
import os

mixpanel = MCPTools(
    stdio={
        "command": "npx",
        "args": ["-y", "@andrew_eragon/mcp-mixpanel"],
        "env": {
            "MIXPANEL_USERNAME": os.getenv("MIXPANEL_USERNAME"),
            "MIXPANEL_PASSWORD": os.getenv("MIXPANEL_PASSWORD"),
            "MIXPANEL_PROJECT_ID": os.getenv("MIXPANEL_PROJECT_ID")
        }
    }
)

With Cline or Other MCP Clients

Use the stdio transport with the npx command:

{
  "command": "npx",
  "args": ["-y", "@andrew_eragon/mcp-mixpanel", "USERNAME", "PASSWORD", "PROJECT_ID"]
}

Available Tools

The server provides 30+ Mixpanel API tools:

Event Management & Discovery

  • mixpanel_get_projects - Get all accessible projects
  • mixpanel_send_events - Send events with automatic deduplication (up to 2000 events)
  • mixpanel_get_events - Get all event names for a project
  • mixpanel_get_event_properties - Get properties for a specific event
  • mixpanel_get_event_property_values - Get values for an event property

Query & Analysis Tools

  • mixpanel_run_segmentation_query - Flexible event stream analysis
  • mixpanel_run_funnels_query - Conversion funnel analysis
  • mixpanel_run_retention_query - User retention and cohort analysis
  • mixpanel_run_frequency_query - User engagement pattern analysis

Legacy Query Tools (also available)

  • get_today_top_events - Today's most active events
  • get_top_events - Most common events (last 31 days)
  • aggregate_event_counts - Event data over time periods
  • profile_event_activity - Individual user journeys
  • query_retention_report - User retention analysis (D7, W12, M6, etc.)
  • query_funnel_report - Conversion funnel data
  • query_segmentation_report - Event segmentation by properties
  • custom_jql - Run custom JQL queries
  • query_profiles - User profile queries
  • And 10+ more...

Example Queries

Ask your AI assistant:

  • "What are the top 10 events today?"
  • "Show me D7 retention for users from February"
  • "What's the conversion rate for my signup funnel?"
  • "How many users completed the checkout event this week?"
  • "Show me the profile for user ID abc123"

Configuration

Environment Variables

The server supports these environment variable patterns:

# Primary (recommended)
export MIXPANEL_USERNAME="your_service_account_username"
export MIXPANEL_PASSWORD="your_service_account_password"
export MIXPANEL_PROJECT_ID="your_project_id"

# Alternative (legacy)
export SERVICE_ACCOUNT_USER_NAME="your_service_account_username"
export SERVICE_ACCOUNT_PASSWORD="your_service_account_password"
export DEFAULT_PROJECT_ID="your_project_id"

SaaS Features

The server automatically handles:

  • Connection pooling (30min idle timeout)
  • Automatic retries (3 attempts with exponential backoff)
  • Request timeouts (30 seconds)
  • Multi-tenant isolation
  • Graceful shutdown with statistics

Monitor via logs:

╔════════════════════════════════════════════════════════════╗
║  MIXPANEL MCP SERVER v2.0.0 - SaaS Ready                  ║
╠════════════════════════════════════════════════════════════╣
║  Features:                                                  ║
║  ✓ Connection Pooling                                       ║
║  ✓ Multi-Tenant Support                                     ║
║  ✓ Automatic Retry Logic (3 retries, exponential backoff) ║
║  ✓ Timeout Protection (30s)                                ║
║  ✓ Idle Connection Cleanup (30min timeout, 5min interval)  ║
║  ✓ Graceful Shutdown                                        ║
╚════════════════════════════════════════════════════════════╝

Architecture

See SAAS_ARCHITECTURE.md for detailed documentation on:

  • Connection pooling strategy
  • Multi-tenant isolation
  • Retry logic and timeouts
  • Performance benchmarks
  • Monitoring and observability

Performance

v2.0.0 (SaaS-ready):

  • ⚡ 75% latency reduction for cached requests (150-300ms vs 700-1000ms)
  • 🚀 4x throughput increase (~400 req/min per user)
  • 🛡️ 8x reduction in failure rate (<1% vs ~8%)
  • 💾 Zero memory leaks with automatic cleanup

Development

# Install dependencies
npm install

# Build
npm run build

# Run locally
node build/index.js USERNAME PASSWORD PROJECT_ID

# Watch mode (for development)
npm run build -- --watch

Troubleshooting

Server won't start

  • Check Node.js version: node --version (must be >= 18.0.0)
  • Verify credentials are correct
  • Check Mixpanel service account has proper permissions

Slow requests

  • Normal for first request (connection establishment)
  • Subsequent requests should be fast (cached connection)
  • Check network latency to Mixpanel API

Connection errors

  • Verify service account credentials
  • Check Mixpanel API status
  • Review error logs for details

Contributing

Contributions welcome! Please open an issue or PR.

License

MIT

Links

Credits

Built with ❤️ for the MCP community. Enhanced with enterprise SaaS architecture for production use.