Skip to main content
Prerequisites Before you begin, create an account and get your API Key.

Getting started

Connect to Mixpanel to track events, analyze user behavior, and generate insights from your product analytics through AI agents.
  • API
  • UI
  • Open Source
1

Install the SDKs (optional)

pip install klavis
2

Create a Strata MCP Server with Mixpanel

from klavis import Klavis
from klavis.types import McpServerName

klavis_client = Klavis(api_key="YOUR_API_KEY")

# Create a Strata MCP server with Mixpanel
response = klavis_client.mcp_server.create_strata_server(
    servers=[McpServerName.MIXPANEL],
    user_id="user123"
)

API Reference

Full Strata API endpoints
3

Authenticate with Service Account Credentials

klavis_client.mcp_server.set_strata_auth(
    strata_id=response.strata_id,
    server_name=McpServerName.MIXPANEL,
    auth_data={
        "data": {
            "serviceaccount_username": "YOUR_MIXPANEL_SERVICE_ACCOUNT_USERNAME",
            "serviceaccount_secret": "YOUR_MIXPANEL_SERVICE_ACCOUNT_SECRET"
        }
    }
)
Get your Mixpanel service account credentials from your Mixpanel project settings. These credentials are required to access your analytics data.
🎉 Your Mixpanel MCP Server is ready! Once authentication is complete, you can use your MCP server URL with any MCP-compatible client.

Available Tools

Tool NameDescription
mixpanel_send_eventsSend events to Mixpanel using the /import endpoint with Service Account authentication
mixpanel_get_projectsGet all projects that are accessible to the current service account user
mixpanel_get_eventsGet event names for the given Mixpanel project
mixpanel_get_event_propertiesGet event properties for the given event and Mixpanel project
mixpanel_get_event_property_valuesGet event property values for the given event name, project, and property name
mixpanel_run_funnels_queryRun a funnel query to measure the conversion rate of a user journey
mixpanel_run_segmentation_queryRun a segmentation query to slice and dice your event stream for deeper insights
mixpanel_run_retention_queryRun a retention query to track user engagement over time and perform cohort analysis
mixpanel_run_frequency_queryRun a frequency query to analyze user engagement patterns and cohort behavior
For more details about tool input schema, use the get_tools API.

Next Steps

I