A Model Context Protocol (MCP) server for integrating Mixpanel analytics into AI workflows. This server allows AI assistants like Claude to track events, page views, user signups, and update user profiles in Mixpanel.
Version 2.0.1 Note: Tool names now include the mixpanel_
prefix to prevent namespace collisions with other analytics MCP servers.
# Install globally
npm install -g mixpanel-mcp-server
# Or use directly with npx
npx mixpanel-mcp-server --token YOUR_MIXPANEL_TOKEN
# Clone the repository
git clone https://github.com/yourusername/mixpanel-mcp-server.git
cd mixpanel-mcp-server
# Install dependencies
npm install
# Run the server
node index.js --token YOUR_MIXPANEL_TOKEN
To start using the Mixpanel MCP server with Claude Desktop:
Make sure Claude Desktop is installed on your machine (download from claude.ai/download)
Create or edit the Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%AppData%\Claude\claude_desktop_config.json
Add the Mixpanel MCP server configuration:
{
"mcpServers": {
"mixpanel-analytics": {
"command": "npx",
"args": [
"-y",
"mixpanel-mcp-server",
"--token",
"YOUR_MIXPANEL_TOKEN"
]
}
}
}
After setting up the configuration file as shown in the Quick Start section, you can use the Mixpanel analytics capabilities directly in your conversations with Claude.
Examples of prompts you can use:
Claude will use the appropriate Mixpanel MCP tool based on your request.
This server uses the standard Model Context Protocol and can be integrated with any MCP client:
Start the server:
npx mixpanel-mcp-server --token YOUR_MIXPANEL_TOKEN
Connect your MCP client to the server using stdio transport
The client can discover and use the available tools (mixpanel_track_event, mixpanel_track_pageview, mixpanel_track_signup, mixpanel_set_user_profile)
The Mixpanel MCP server provides the following tools:
Tracks a custom event in Mixpanel.
Parameters:
event_name
(string, required): The name of the event to trackdistinct_id
(string, optional): User identifier. Defaults to 'anonymous'properties
(object, optional): Additional properties to track with the eventExample:
{
"event_name": "button_clicked",
"distinct_id": "user123",
"properties": {
"button_id": "submit_form",
"page": "checkout"
}
}
Tracks a page view event in Mixpanel.
Parameters:
page_name
(string, required): The name of the page vieweddistinct_id
(string, optional): User identifier. Defaults to 'anonymous'referrer
(string, optional): The referring pageExample:
{
"page_name": "homepage",
"distinct_id": "user123",
"referrer": "google.com"
}
Tracks a signup event and creates a user profile in Mixpanel.
Parameters:
user_name
(string, required): User's full nameemail
(string, required): User's email addressplan
(string, optional): Signup plan. Defaults to 'free'Example:
{
"user_name": "John Doe",
"email": "john@example.com",
"plan": "premium"
}
Updates a user's profile properties in Mixpanel.
Parameters:
distinct_id
(string, required): User identifierproperties
(object, required): Profile properties to setExample:
{
"distinct_id": "user123",
"properties": {
"$name": "John Doe",
"$email": "john@example.com",
"plan": "premium",
"company": "Acme Inc"
}
}
Here are some practical examples of using the Mixpanel MCP server with Claude:
You: Can you track an event in Mixpanel when a user clicks the submit button?
Claude: I'll track that event for you. Let me use the Mixpanel analytics tool.
[Claude uses the mixpanel_track_event tool with appropriate parameters]
Claude: I've successfully tracked the 'button_clicked' event in Mixpanel with the properties you specified.
You: Create a new user profile in Mixpanel for Sarah Johnson who signed up with sarah@example.com on the premium plan.
Claude: I'll create that user profile in Mixpanel.
[Claude uses the mixpanel_track_signup tool with appropriate parameters]
Claude: I've successfully tracked the signup for Sarah Johnson and created a profile in Mixpanel with the premium plan.
Server not starting:
Claude Desktop not showing Mixpanel tools:
Events not appearing in Mixpanel:
To run the server in debug mode for more verbose logging:
npx mixpanel-mcp-server --token YOUR_MIXPANEL_TOKEN --debug
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
{
"mcpServers": {
"mixpanel-analytics": {
"env": {},
"args": [
"-y",
"mixpanel-mcp-server",
"--token",
"YOUR_MIXPANEL_TOKEN"
],
"command": "npx"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.