Data & Analytics

Mixpanel MCP

Query Mixpanel analytics, manage dashboards, cohorts, metrics, feature flags, experiments, Lexicon events and properties, tracking plans, annotations and automations through Mixpanel's hosted MCP server.

Tools

This is a reference catalogue. Tools cannot be configured or run from this page.

  • Create annotation

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create an annotation on a project's charts, e.g. to mark a deploy or campaign launch. Run List-Annotations first to avoid duplicates. Parameters: - project_id (int): the project. - date (str): when the annotated event happened; see date formats below. - description (str): up to 512 characters. - tags (list[str], optional): tag names; missing tags are created. - workspace_id (int, optional): create it in one workspace. Dates accept 'YYYY-MM-DD', 'YYYY-MM-DD HH:MM:SS' or ISO 8601 ('YYYY-MM-DDTHH:MM:SS', optionally with 'Z' or a UTC offset, which is converted to the project's timezone). Values without an offset are project-local time. Returned dates are ISO 8601 (YYYY-MM-DDTHH:MM:SS) in the project's timezone.

  • Create automation

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create an Automation for the current user. It is saved as a draft and does not run or notify anyone until it is activated, either with Activate-Automation or by a later Update-Automation call (see there). Only create when the user asks. An Automation (also called an agent flow or KPI Monitor, type metric_monitor) analyzes one metric with an AI agent, on a schedule or when the metric meets a threshold condition, and delivers a digest of its findings by email or Slack. Automations are personal: each user sees and edits only their own. Ask the user for these instead of inventing them: - name. - trigger.method: a schedule ('scheduled', e.g. "send me a weekly digest") or a threshold ('threshold', e.g. "alert me when signups drop"). Don't assume. - trigger.frequency: offer daily, weekly or monthly; don't pick one silently. For a schedule it is the cadence; for a threshold it caps how often it may fire, so ask "at most once per ...?". - trigger.schedule: scheduled only, and only for a non-default recurrence. - trigger.condition: threshold only, including the bucket it judges (comparison_unit). It judges one calendar bucket, never a rolling total, so ask which bucket the level applies to ("above 1,000 per day, or per week?") separately from the frequency. It always judges the monitored metric; there is no separate trigger metric to ask for. - metric_analysis.query_id: which metric to monitor. Run it with Run-Query and pass its query_id: one insights, funnels or retention metric, without a formula or cumulative or rolling analysis. query_ids expire 3 hours after Run-Query. - metric_analysis.analysis_window_days: offer the look-back options for the chosen frequency. - metric_analysis.user_instructions: how to interpret the metric and write the digest; omit if the user gives none. - notifications: where to send results (email or Slack), or confirm none, so runs show only on the Automations page. Where the user has no preference, say which default applies. Confirm the assembled config with the user before creating. Params: - project_id (int, required): Mixpanel project. - name (str, required): The Automation's name. - trigger (object, required): What fires it: method, frequency, and a schedule (scheduled only) or condition (threshold only). Omitted fields take defaults; {} is a daily schedule. - metric_analysis (object, required): query_id (required), analysis_window_days and user_instructions. - notifications (list, optional): Where results go. Email: {"channel": "email", "recipient": "pm@example.com"}. Slack needs slack_channel_id, slack_channel_name and slack_team_id, which no tool looks up, so ask the user for them. Omit to show runs only on the Automations page. - description (str, optional): The Automation's description.

  • Create cohort

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create a new Mixpanel cohort. A cohort is a saved group of users matching a set of criteria. Pass a `definition` dict matching the CohortDefinition schema (grouped or selector format). Call Describe-Cohort-Schema first to retrieve the full JSON schema, including the required fields per format (grouped uses a `groups[]` filters grammar; selector uses the lower-level `behaviors{}` + compound `selector` AST for cohorts that embed funnel or retention report behaviors). For the grouped format, each group's `event` is the anchor cohort the filters narrow down — almost always `{"resourceType": "cohort", "value": "$all_users"}`. To anchor on members of an existing cohort instead, pass that cohort's integer id as `value`. `workspace_id` is required (unlike List-Cohorts, which lists project-wide when it is omitted).

  • Create custom property

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create a formula-based custom property (a computed event or user property) in a project. Define it with a `display_formula` expression that references named `composed_properties` variables (_A, _B, ...). Every property used in the formula must be mapped in `composed_properties` — use List-Properties to find the properties to compose. `resource_type` is 'events' or 'people'. The created property appears in Lexicon and is usable in reports.

  • Create dashboard

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create a Mixpanel dashboard that combines multiple reports and text into a single view. Use when the user asks for a "dashboard," "board", or requests to save several reports grouped together. For a single report request, prefer Run-Query. Requires query_id(s) from prior Run-Query calls (use skip_results=true to chain multiple queries). query_ids expire 3 hours after Run-Query, so create the dashboard soon after running the queries. Limits: - title: up to 255 characters. description: up to 400 characters. - Up to 30 rows per dashboard, 1-4 items per row (text cards or reports). - Text card html_content: no newlines (they are stripped; each HTML element is its own line). Allowed tags: a, blockquote, br, code, em, h1, h2, h3, hr, li, mark, ol, p, s, strong, u, ul. Other tags are stripped. - Dashboard filters: time_filter and property filters only (no cohort filters, no parameters). Row schema: {'additionalProperties': False, 'description': 'A row to add to a dashboard.', 'properties': {'contents': {'items': {'oneOf': [{'additionalProperties': False, 'description': 'Text content for a dashboard cell.', 'properties': {'type': {'const': 'text', 'default': 'text', 'title': 'Type', 'type': 'string'}, 'html_content': {'description': 'HTML content for the text card. Allowed tags: a, blockquote, br, code, em, h1, h2, h3, hr, li, mark, ol, p, s, strong, u, ul. Other tags are stripped. Do not include newlines; Each html element means a new line.', 'maxLength': 5000000, 'title': 'Html Content', 'type': 'string'}}, 'required': ['html_content'], 'title': 'TextContent', 'type': 'object'}, {'additionalProperties': False, 'description': 'Report content for a dashboard row.', 'properties': {'type': {'const': 'report', 'default': 'report', 'title': 'Type', 'type': 'string'}, 'query_id': {'description': 'query_id from Run-Query', 'title': 'Query Id', 'type': 'string'}, 'name': {'maxLength': 255, 'minLength': 1, 'title': 'Name', 'type': 'string'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}], 'default': None, 'title': 'Description'}}, 'required': ['query_id', 'name'], 'title': 'ReportCreateContent', 'type': 'object'}]}, 'maxItems': 4, 'minItems': 1, 'title': 'Contents', 'type': 'array'}}, 'required': ['contents'], 'title': 'DashboardRow', 'type': 'object'} Optional time_filter sets the board date range for all reports. Time filter schema: {dateRange: {type: 'in the last', window: {unit: 'hour | day | week | month', value: 'integer'}} | {type: 'between', from: 'string | $start_of_current_day | $start_of_previous_day | $start_of_week | $start_of_month | $start_of_quarter | $start_of_year | $start_of_previous_week | $start_of_previous_month | $start_of_previous_quarter | $start_of_previous_year', to: 'string | $end_of_current_day | $end_of_previous_day | $end_of_previous_week | $end_of_previous_month | $end_of_previous_quarter | $end_of_previous_year'} | {type: 'since', from: 'string | $start_of_current_day | $start_of_previous_day | $start_of_week | $start_of_month | $start_of_quarter | $start_of_year | $start_of_previous_week | $start_of_previous_month | $start_of_previous_quarter | $start_of_previous_year'} | {type: 'on', from: 'string', to: 'string'}, displayText: 'string'} Dates are YYYY-MM-DD. Today is {type: 'between', from: '$start_of_current_day', to: '$end_of_current_day'}. Optional filters apply board-level property filters (e.g. Country equals US) to all reports. Each filter is one of: {type: 'string', propertyName: 'string' | ['string'], propertyType: 'string | list', resource: 'event | user', operator: 'equals | contains | does not equal | does not contain', value: 'string'} | {type: 'string', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'is set | is not set'} | {type: 'number_array', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'is between', value: ['number']} | {type: 'number', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'is at least | is equal to | is not equal to | is greater than | is less than | is at most', value: 'number'} | {type: 'boolean', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'true | false', value: 'boolean'} | {type: 'datetime', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'was on | was before | was since', value: 'string'} | {type: 'list-of-objects', propertyName: 'string', resource: 'event | user', listItemFilters: [{type: 'string', propertyName: 'string' | ['string'], propertyType: 'string | list', resource: 'event | user', operator: 'equals | contains | does not equal | does not contain', value: 'string'} | {type: 'string', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'is set | is not set'} | {type: 'number_array', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'is between', value: ['number']} | {type: 'number', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'is at least | is equal to | is not equal to | is greater than | is less than | is at most', value: 'number'} | {type: 'boolean', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'true | false', value: 'boolean'} | {type: 'datetime', propertyName: 'string' | ['string'], propertyType: 'string | number | boolean | datetime | list', resource: 'event | user', operator: 'was on | was before | was since', value: 'string'}], listQuantifier: 'any | all', listInclusion: 'all | matching', propertyObjectKey: ['string']}

  • Create experiment

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create an experiment (in DRAFT status) in the current project. For setup decisions (hypothesis writing, metric selection, sample sizing, testing model, end condition, advanced features like CUPED/Winsorization/ multiple testing correction) call Get-Experiment-Setup-Guidance first — it is the single source of truth for what makes a sound experiment. `project_id` and `experiment.workspaceId` are auto-injected from the caller's session — pass any int (or omit workspaceId) and the values you supply will be replaced before the call reaches the server. Do not ask the user for them or call other tools to discover them. Mechanics (NOT best-practice advice — see setup guidance for that): - For duration-based experiments, set endCondition="days" and endAfterDays; for sample-size-based, set endCondition="sample_size" and sampleSize. - Metrics: pass saved metrics via primaryMetricIds/guardrailMetricIds/ secondaryMetricIds (find IDs with List-Metrics), or define inline via the metrics array with eventName and metricType. - Optional `variants` array — only include when the user explicitly states variant keys/values/splits. Otherwise the system creates a default 50/50 control/treatment flag. - The server always runs the seven deterministic pre-launch pitfall checks before creation, deriving most inputs (arm count, sample size, metric counts, stats toggles) from the experiment itself. Optional `validationContext` supplies the few externals it can't derive (baseline rate, MDE, expected exposures, cohort size, primary-metric measurement types). Blocker pitfalls (under-half-required exposures, cohort too small) short-circuit the create and are surfaced as an actionable error; warnings and fyi findings ride along on the created experiment as `validationFindings`. After creation, use Update-Experiment with action="launch" to start the experiment.

  • Create feature flag

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create a feature flag in the current project. `project_id` and `workspace_id` are auto-injected from the caller's session — pass any int and the values you supply will be replaced before the call reaches the server. Do not ask the user for them. For routing (Feature Gate vs Dynamic Config vs Experiment), input gathering, naming/keying conventions, and per-flagType variant rules, call `Get-Feature-Flag-Setup-Guidance` first. Mechanics: flag key is auto-derived from name when omitted; flag starts disabled (use Update-Feature-Flag to enable, or call Get-Feature-Flag-Lifecycle-Guidance for rollout decisions); rolloutPercentage defaults to 1.0 (100% of targeted traffic). Configure cohort targeting in the Mixpanel UI via the URL in the response.

  • Create lookup table

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create a lookup table from rows. Pass `rows` as a list of {column: value} objects; one column is the primary key (`primary_key_column`, default "Primary Key") used to join the table to event/user data. The table appears in Lexicon and can then be mapped to a property in the UI.

  • Create metric

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create a saved metric (behavior or formula) for reuse across experiments. Types: - "metric": Single event behavior (count, unique users, DAU, etc.) - "formula": Combines multiple metrics with mathematical expressions Definition schema: { "displayOptions": { "chartType": "line | bar" }, "sections": { "events": [ { "event": "string", "math": "unique | total | session | dau | wau | mau", "filters": [ [ { "type": "string", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | list", "resource": "event | user", "operator": "equals | contains | does not equal | does not contain", "value": "string" }, { "type": "string", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "is set | is not set" }, { "type": "number_array", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "is between", "value": [ "number" ] }, { "type": "number", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "is at least | is equal to | is not equal to | is greater than | is less than | is at most", "value": "number" }, { "type": "boolean", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "true | false", "value": "boolean" }, { "type": "datetime", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "was on | was before | was since", "value": "string" }, { "type": "list-of-objects", "propertyName": "string", "resource": "event | user", "listItemFilters": [ [ { "type": "string", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | list", "resource": "event | user", "operator": "equals | contains | does not equal | does not contain", "value": "string" }, { "type": "string", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "is set | is not set" }, { "type": "number_array", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "is between", "value": [ "number" ] }, { "type": "number", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "is at least | is equal to | is not equal to | is greater than | is less than | is at most", "value": "number" }, { "type": "boolean", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "true | false", "value": "boolean" }, { "type": "datetime", "propertyName": [ "string", [ "string" ] ], "propertyType": "string | number | boolean | datetime | list", "resource": "event | user", "operator": "was on | was before | was since", "value": "string" } ] ], "listQuantifier": "any | all", "listInclusion": "all | matching", "propertyObjectKey": [ "string" ] } ] ] } ] } } Returns metric with ID for use in Create-Experiment with primaryMetricIds. For complex definitions, use Get-Metric on existing metrics as templates, then rebuild the definition in this schema: a read can carry fields this tool does not accept (`formula`, `anyOf`, `funnel`, filter lists and date units).

  • Create tag

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create a tag for organizing events and properties in Lexicon.

  • Create tracking plan

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Save a new tracking plan in a project. A tracking plan is a named, project-scoped list of the events a team intends to send. Each member event resolves to the project's event definition by name; a name with no definition yet gets one created with status 'planned', which flips to 'live' once Mixpanel receives that event. Tracking plans have no page in the Mixpanel web app, so there is no link to give for a plan itself. A member event does have one: call Get-Lexicon-URL with the event name to get its Lexicon detail path, which has the shape /project/{project_id}/view/{workspace_id}/app/lexicon/transformations/events/{name}. Do not assemble that path yourself. The workspace id has to be resolved, the event name has to be URL-encoded, and custom events use a different route. Design the plan before calling this — the tool persists what you give it and does not generate events. A project holds at most 100 plans and a plan at most 1,000 events. A plan name already in use is rejected. Call List-Tracking-Plans to find the existing plan and Update-Tracking-Plan with its id instead. Params: - project_id (int, required): Mixpanel project the plan belongs to. - name (str, required): Plan name, 1-255 characters, unique within the project. - description (str, optional): Plan description. - events (list, optional): The plan's events. Each entry takes `name` (required, the event name) plus optional `description`, `properties` (a property map keyed by property name, e.g. {"plan_tier": {"type": "string", "description": "..."}}) and `metadata`. Names must be unique within the list and are matched case-sensitively, so "checkout" and "Checkout" are two events. An existing event definition keeps its status and is updated in place; the properties listed on an event are created, linked or updated and the ones not listed are left alone.

  • Duplicate dashboard

    Required tools: Get-Business-Context (call it once per conversation, before this tool). Create a copy of an existing dashboard with all its contents. Optionally override the title and description of the new dashboard.