home / mcp / mixpanel mcp server

Mixpanel MCP Server

MCP server for Mixpanel Analytics integration with AI assistants. Enables Claude and other MCP clients to track events, pageviews, and user profiles through conversational interfaces.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "moonbirdai-mixpanel-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "mixpanel-mcp-server",
        "--token",
        "YOUR_MIXPANEL_TOKEN"
      ]
    }
  }
}

You run a Mixpanel MCP Server to connect Mixpanel analytics with AI workflows. It lets AI assistants track events, page views, signups, and update user profiles in Mixpanel, enabling richer insights and automated analytics within your conversations and automated tasks.

How to use

Use the Mixpanel MCP Server with an MCP client to enable seamless analytics in AI conversations. You can track custom events, page views with referrer information, signups, and user profile updates from your assistant. The server is designed to work with standard MCP clients via a simple stdio transport, so you can connect from Claude Desktop or other MCP-enabled tools and start issuing analytics commands as part of your prompts.

How to install

Prerequisites you need before starting:

- Node.js 16 or higher

- A Mixpanel project token

Install and run the MCP server locally

# Install globally (recommended)
npm install -g mixpanel-mcp-server

# Or run directly with npx
npx mixpanel-mcp-server --token YOUR_MIXPANEL_TOKEN

Configuration for Claude Desktop

Configure Claude Desktop to connect to the Mixpanel MCP Server by adding an MCP server entry to its config. This enables Claude to dispatch Mixpanel analytics commands during conversations.

{
  "mcpServers": {
    "mixpanel-analytics": {
      "command": "npx",
      "args": [
        "-y",
        "mixpanel-mcp-server",
        "--token",
        "YOUR_MIXPANEL_TOKEN"
      ]
    }
  }
}

Detailed usage with MCP clients

The server uses the standard MCP transport and can be connected from Claude Desktop or other MCP clients. You can start using these capabilities in your prompts: track a custom event, track a page view, create a user profile on signup, or update an existing user profile.

Tool reference

Tools exposed by the Mixpanel MCP Server include the following actions you can perform from your MCP client:

Examples

Practical scenarios include tracking a button click, creating a user profile for a new signup, and updating user profile properties from within AI-assisted workflows.

Troubleshooting

Common issues include server startup problems, Claude Desktop not showing Mixpanel tools, and events not appearing in Mixpanel. Check that you provided a valid Mixpanel token, ensure Node.js is the correct version, verify the client configuration, and allow a few minutes for events to appear in Mixpanel if needed.

Security notes

Store your Mixpanel token securely and limit access to the configuration file. Consider using environment variables for sensitive values in production and be aware that events are sent directly to Mixpanel’s API.

Contributing

Contributions are welcome. You can submit improvements, fix issues, or add new analytics capabilities that integrate with Mixpanel.

License

This project is licensed under the MIT License.

Available tools

mixpanel_track_event

Tracks a custom event in Mixpanel with a name, optional distinct_id, and optional properties to attach to the event.

mixpanel_track_pageview

Tracks a page view in Mixpanel, including the page name, optional distinct_id, and an optional referrer.

mixpanel_track_signup

Tracks a signup event and creates a user profile with provided user information and plan details.

mixpanel_set_user_profile

Updates a user's Mixpanel profile with specified properties such as name, email, plan, and company.