251
All tools

Run a query

Runs an ad-hoc insights, funnels, flows or retention query on the project's events and returns the results.

Updated Sep 29, 2026

run-query.md

Run a query

Runs an ad-hoc insights, funnels, flows or retention query on the project's events and returns the results.

Note: Call Get-Query-Schema first for the full JSON schema of a query.

Set up

Use the first option your agent supports.

MCP (official, remote)

Add this server to your agent's MCP settings, then sign in when asked.

{ "mcpServers": { "mixpanel": { "url": "https://mcp.mixpanel.com/mcp" } } }

Call the MCP tool Run-Query.

Server URL: https://mcp.mixpanel.com/mcp

Note: An organization admin enables MCP in Settings > Org > Overview first. EU and India projects use https://mcp-eu.mixpanel.com/mcp and https://mcp-in.mixpanel.com/mcp.

Before anything else, confirm access with the cheapest read-only call, like a list or a search. Never send or change anything to test access.

Rules

  • Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
  • Never print API keys.

Ways in

RouteSourceCallRequiredDocs
MCPOfficial · remoteRun-QueryOAuthDocs

Workflows using Run a query