mixpanel-automation
Automate Mixpanel tasks via Rube MCP (Composio): events, segmentation, funnels, cohorts, user profiles, JQL queries. Always search tools first for current schemas.
Mixpanel Automation via Rube MCP
Automate Mixpanel product analytics through Composio's Mixpanel toolkit via Rube MCP.
Prerequisites
RUBE_MANAGE_CONNECTIONS with toolkit mixpanelRUBE_SEARCH_TOOLS first to get current tool schemasSetup
Get Rube MCP: Add https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
RUBE_SEARCH_TOOLS respondsRUBE_MANAGE_CONNECTIONS with toolkit mixpanelCore Workflows
1. Aggregate Event Data
When to use: User wants to count events, get totals, or track event trends over time
Tool sequence:
MIXPANEL_GET_ALL_PROJECTS - List projects to get project ID [Prerequisite]MIXPANEL_AGGREGATE_EVENT_COUNTS - Get event counts and aggregations [Required]Key parameters:
event: Event name or array of event names to aggregatefrom_date / to_date: Date range in 'YYYY-MM-DD' formatunit: Time granularity ('minute', 'hour', 'day', 'week', 'month')type: Aggregation type ('general', 'unique', 'average')where: Filter expression for event propertiesPitfalls:
where filter uses Mixpanel expression syntax (e.g., properties["country"] == "US")2. Run Segmentation Queries
When to use: User wants to break down events by properties for detailed analysis
Tool sequence:
MIXPANEL_QUERY_SEGMENTATION - Run segmentation analysis [Required]Key parameters:
event: Event name to segmentfrom_date / to_date: Date range in 'YYYY-MM-DD' formaton: Property to segment by (e.g., properties["country"])unit: Time granularitytype: Count type ('general', 'unique', 'average')where: Filter expressionlimit: Maximum number of segments to returnPitfalls:
on parameter uses Mixpanel property expression syntaxproperties["prop_name"] formatlimit3. Analyze Funnels
When to use: User wants to track conversion funnels and identify drop-off points
Tool sequence:
MIXPANEL_LIST_FUNNELS - List saved funnels to find funnel ID [Prerequisite]MIXPANEL_QUERY_FUNNEL - Execute funnel analysis [Required]Key parameters:
funnel_id: ID of the saved funnel to queryfrom_date / to_date: Date rangeunit: Time granularitywhere: Filter expressionon: Property to segment funnel bylength: Conversion window in daysPitfalls:
funnel_id is required; resolve via LIST_FUNNELS firstlength) defaults vary; set explicitly for accuracy4. Manage User Profiles
When to use: User wants to query or update user profiles in Mixpanel
Tool sequence:
MIXPANEL_QUERY_PROFILES - Search and filter user profiles [Required]MIXPANEL_PROFILE_BATCH_UPDATE - Update multiple user profiles [Optional]Key parameters:
where: Filter expression for profile properties (e.g., properties["plan"] == "premium")output_properties: Array of property names to include in resultspage: Page number for paginationsession_id: Session ID for consistent pagination (from first response)$distinct_id and property operationsPitfalls:
session_id from first response for consistent pagingwhere uses Mixpanel expression syntax for profile properties$set, $unset, $add, $append) to profiles5. Manage Cohorts
When to use: User wants to list or analyze user cohorts
Tool sequence:
MIXPANEL_COHORTS_LIST - List all saved cohorts [Required]Key parameters:
id, name, description, countPitfalls:
where expressions6. Run JQL and Insight Queries
When to use: User wants to run custom JQL queries or insight analyses
Tool sequence:
MIXPANEL_JQL_QUERY - Execute a custom JQL (JavaScript Query Language) query [Optional]MIXPANEL_QUERY_INSIGHT - Run a saved insight query [Optional]Key parameters:
script containing the JQL JavaScript codebookmark_id of the saved insightproject_id: Project context for the queryPitfalls:
bookmark_id must reference an existing saved insightCommon Patterns
ID Resolution
Project name -> Project ID:
1. Call MIXPANEL_GET_ALL_PROJECTS
Find project by name in results
Extract project id Funnel name -> Funnel ID:
1. Call MIXPANEL_LIST_FUNNELS
Find funnel by name
Extract funnel_id Mixpanel Expression Syntax
Used in where and on parameters:
properties["property_name"]properties["country"] == "US"properties["age"] > 25properties["is_premium"] == true"search_term" in properties["name"]properties["country"] == "US" and properties["plan"] == "pro"Pagination
page number and session_id for consistent resultsKnown Pitfalls
Date Formats:
Expression Syntax:
properties["name"] formatproperties["status"] == "active"properties["count"] > 10true / false (lowercase)Rate Limits:
Response Parsing:
data keyQuick Reference
| Task | Tool Slug | Key Params |
|---|---|---|
| List projects | MIXPANEL_GET_ALL_PROJECTS | (none) |
| Aggregate events | MIXPANEL_AGGREGATE_EVENT_COUNTS | event, from_date, to_date, unit |
| Segmentation | MIXPANEL_QUERY_SEGMENTATION | event, on, from_date, to_date |
| List funnels | MIXPANEL_LIST_FUNNELS | (none) |
| Query funnel | MIXPANEL_QUERY_FUNNEL | funnel_id, from_date, to_date |
| Query profiles | MIXPANEL_QUERY_PROFILES | where, output_properties, page |
| Batch update profiles | MIXPANEL_PROFILE_BATCH_UPDATE | (profile update objects) |
| List cohorts | MIXPANEL_COHORTS_LIST | (none) |
| JQL query | MIXPANEL_JQL_QUERY | script |
| Query insight | MIXPANEL_QUERY_INSIGHT | bookmark_id |