Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Mixpanel MCP server

Vendor MCP
Open markdown

The Mixpanel MCP connector routes your AI agent's tool calls to Mixpanel's own MCP server through Scalekit. Each user signs in to Mixpanel once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 66 tools.

Tools
66
What they doRead · write · destructive
37 · 23 · 637 read23 write6 destructive
Users sign in with
OAuth app
Your own Mixpanel MCP server app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Mixpanel MCP connection

    In AgentKit > Connections, create a Mixpanel MCP connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    Mixpanel MCP server connections use your own OAuth app. Register one with Mixpanel MCP server and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the Mixpanel MCP connection.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'mixpanelmcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Mixpanel MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'mixpanelmcp_describe_cohort_schema',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • mixpanelmcp_describe_cohort_schemaReturn the JSON schema for the `definition` field used by Create-Cohort and Update-Cohort.Read-only

    Describe Cohort Schema

    Return the JSON schema for the `definition` field used by Create-Cohort and Update-Cohort. Call this before writing a cohort definition for the first time in a session, so you know which fields are required for the grouped format versus the lower-level selector format. The response has three parts: - `definition`: the CohortDefinition JSON schema (the grouped/selector union). - `grouped_filter_types`: per-type schemas and worked examples for the entries inside the grouped format's `groups[].filters[]` array (property, behavioral, and cohort_membership filters), which the base schema leaves opaque. - `notes`: gotchas worth reading before authoring a definition.

    Inputs

    This tool takes no inputs.

  • mixpanelmcp_display_queryDisplay the interactive chart widget for a previously-run query.Read-only

    Display Query

    Display the interactive chart widget for a previously-run query. Takes a query_id returned by Run-Query and render results in the MCP App visualization widget.

    Inputs

    project_idintegerrequired
    The Mixpanel project the query was run against.
    query_idstringrequired
    The query_id returned by a previous Run-Query call.
    workspace_idstring
    Optional workspace the query was scoped to.
  • mixpanelmcp_explain_experiment_health_checkDiagnose why one of an experiment's automated health checks is failing (or confirm it is passing) and get a recommended next action.Read-only

    Explain Experiment Health Check

    Diagnose why one of an experiment's automated health checks is failing (or confirm it is passing) and get a recommended next action. Covers two kinds of check, selected with health_check_kind. Sample Ratio Mismatch (health_check_kind="srm") detects when the observed traffic split deviates from the configured allocation. First call Get Experiment with compute_exposures set to true, then pass p_value from the experiment's live SRM analysis (pass it through as null if SRM has not been computed yet — the tool returns a clear "SRM unavailable" message instead of an error), live_exposures (the per-variant exposure counts), and target_allocations (the configured per-variant traffic split). Retrospective A/A bias check (health_check_kind="retro_a_a") runs per-metric statistical tests over the pre-experiment window to catch randomization or measurement bias. First call Get Experiment with compute_metrics set to true, then pass retro_aa_verdict (the live retro A/A block from that response, or null if it has not been computed yet, which is typical right after an experiment starts) and metric_names (a map of metric ID to display name, so the diagnosis can name the affected metrics instead of showing raw IDs). The response explains what is failing (or confirms nothing is), lists likely causes ordered from most to least probable, and recommends a next action — for example pausing the experiment, investigating exposure tracking, restarting with bot filtering, enabling CUPED, or simply continuing. It also cites the relevant statistical trustworthiness principle (Kohavi's for SRM, Twyman's Law for retro A/A) when a check is failing.

    Inputs

    health_check_kindstring
    No description.one of srmretro_a_adefault srm
    live_exposuresstring
    No description.
    metric_namesstring
    No description.
    p_valuestring
    No description.
    retro_aa_verdictstring
    No description.
    target_allocationsstring
    No description.
  • mixpanelmcp_find_duplicate_groupsFind groups of duplicate or near-duplicate names in a Mixpanel project — both events and event properties.Read-only

    Find Duplicate Groups

    Find groups of duplicate or near-duplicate names in a Mixpanel project — both events and event properties. Returns clusters a user might want to merge in Lexicon (e.g. 'Add to Cart', 'add_to_cart', 'addToCart'; or 'from_date', 'from-date'). Returns a FormattedTable with columns: - suggested_name: the most-popular variant in the cluster — use this as the merge target. - entity_names: every variant in the group, in popularity order (includes suggested_name as the first entry). - entity_type: 'events' or 'event_properties'. Pass this value back to Merge-Group / Dismiss-Duplicate-Group. Groups already merged or dismissed by the user are filtered out by the server. Empty `rows` means there is nothing actionable.

    Inputs

    project_idintegerrequired
    The Mixpanel project to scan for duplicate or near-duplicate event and property names.
  • mixpanelmcp_get_business_contextCall this FIRST, before any other Mixpanel tool whenever ANY of these are true: 1.Read-only

    Get Business Context

    Call this FIRST, before any other Mixpanel tool whenever ANY of these are true: 1. It is the first substantive turn of the conversation about this org or project. 2. The user references a name, acronym, product, team, project nickname, event, property, or concept whose org-specific meaning you cannot verify just from the tool list. Examples that should trigger this: "show me MCP data", "how is ingest doing?", "the onboarding funnel", "Project Atlas". 3. You are about to guess which project_id, event name, or property to use based on a name in the user's request. Example: User: "what project has sales data?" ❌ Wrong: jump to Get-Projects and pattern-match against project names. ✅ Right: call Get-Business-Context first, the org likely defines what "sales data" refers to (a product area, an internal acronym, a specific project). Once you have called this in the current conversation for a given organization (and project, if applicable), do NOT call it again. The result is stable for the session; reuse the previously returned context on every subsequent turn — including follow-ups, drill-downs, refinements, and new questions about the same project. Re-call ONLY if: - The user asks about a different project_id whose context you have not yet fetched this conversation. - The user explicitly asks you to refresh or reload business context. - You called Update-Business-Context this conversation and need the new content. What you get back: - Specialized instructions on how to query data in this org - How projects, events, and other entities are organized and named - Business vocabulary and definitions (acronyms, internal product names, etc.) Params: - project_id (int, optional): If provided, returns context for the project AND its organization. organization_id is not required in this case — the org is derived from the project. - organization_id (int, optional): Required when project_id is NOT provided. Call List-Organizations FIRST to obtain it. If List-Organizations returns exactly one org, use its id directly; if it returns more than one, ASK the user which org they mean before calling this tool.

    Inputs

    organization_idstring
    Mixpanel organization ID. Required when project_id is not provided — call List-Organizations first to obtain it; if it returns exactly one org, use its id directly, otherwise ask the user which org they mean.
    project_idstring
    Mixpanel project ID. If provided, returns context for the project and its organization; organization_id is not required in this case.
  • mixpanelmcp_get_cohortRetrieve a single Mixpanel cohort by ID.Read-only

    Get Cohort

    Retrieve a single Mixpanel cohort by ID. Returns the cohort's metadata (name, description, member count, visibility, creator, and last-updated time) along with its filter criteria in the structured CohortDefinition format. Mixpanel tracks only the last-updated time; there is no creation timestamp for cohorts. If the cohort's underlying definition contains filter shapes this tool does not yet model, the structured `definition` field is omitted (`null`), `unmodeled_clause_kinds` lists the unsupported shapes, and `definition_raw` returns the wire-format definition so you can still inspect the cohort's structure. `workspace_id` is required here, unlike List-Cohorts, which lists cohorts project-wide when `workspace_id` is omitted.

    Inputs

    cohort_idintegerrequired
    No description.
    project_idintegerrequired
    No description.
    workspace_idintegerrequired
    No description.
  • mixpanelmcp_get_custom_propertyGet a custom property by id, including its full definition (behavior or display_formula + composed_properties).Read-only

    Get Custom Property

    Get a custom property by id, including its full definition (behavior or display_formula + composed_properties). Use this before Update-Custom-Property to see the current definition. Custom property ids come from List-Properties (custom properties are named '$custom_property:<id>').

    Inputs

    custom_property_idintegerrequired
    No description.
    project_idintegerrequired
    No description.
    workspace_idstring
    No description.
  • mixpanelmcp_get_dashboardSet include_layout=True to get full layout with cell/row IDs (needed for Update-Dashboard).Read-only

    Get Dashboard

    Set include_layout=True to get full layout with cell/row IDs (needed for Update-Dashboard). Layout format: [[row_id, [[cell_id, type, extra], ...]], ...].

    Inputs

    dashboard_idintegerrequired
    No description.
    project_idintegerrequired
    No description.
    include_layoutboolean
    No description.default false