SuperAPI AI Directory

perfetto-mcp-rs

Perfetto trace analysis: run PerfettoSQL queries on trace files, with Chrome tools for page loads, scroll jank, main-thread hotspots and stdlib discovery.

Open website

About this tool

perfetto-mcp-rs is an MCP (Model Context Protocol) server that lets LLMs analyze Perfetto trace files. Point Claude Code (or any MCP client) at a trace file (supports .pftrace / .perfetto-trace / .bin, etc., identified via content sniffing) and ask questions in natural language. The server runs PerfettoSQL under the hood, powered by trace_processor_shell, which is downloaded automatically on first run, with no manual Perfetto installation required.

Main capabilities: built-in specialized tools carrying curated SQL; for custom analysis, the agent can write PerfettoSQL and is guided to use the correct stdlib modules. Dedicated tools are provided for Chrome traces to avoid the agent hand-writing SQL; each tool marks row/string truncation in its metadata, including chrome_scroll_jank_summary (scroll jank summary), chrome_page_load_resource_summary (page load resource summary), chrome_page_load_resource_pipeline (a single slow URL), chrome_page_load_resource_hotspots (slice drill-down), chrome_page_load_script_hotspots (post-resource JS and style/layout work), etc.

Usage: driven through an MCP client (Claude Code, Claude Desktop, Codex, Cursor, etc.). The install script downloads a prebuilt binary and automatically registers the MCP server when Claude Code and/or Codex is detected; restart the client and it's ready to use. You can ask questions in natural language, for example "load ~/traces/scroll_jank.pftrace and tell me the main causes of scroll jank". After the agent calls load_trace and identifies a Chrome trace, it will use the dedicated chrome_scroll_jank_summary tool; when a question goes beyond the scope of the dedicated tools, it falls back to execute_sql to run raw PerfettoSQL. For a single trace, other tools by default act on the most recently loaded trace; for multiple traces, pass paths when calling load_trace, keep the trace_id returned for each file, and pass the corresponding id in each tool call bound to a trace.

Suitable scenarios: agent clients (Claude Code, Codex, Claude Desktop, Cursor) are the best fit, because they can chain multi-turn tool calls and follow the server's error hints; non-agent clients can see the same tools and error hints, but will not automatically chain the guided workflow. Chrome trace analysis, other trace (Android, general) analysis, and multi-trace comparative analysis are all applicable.

Limitations and caveats: MCP tool annotations are client-facing intent and safety hints, not server-side authorization or execution boundaries. On privacy, tool results enter the LLM context, and real traces may contain URLs, headers, cookies, and local paths; execute_sql and the dedicated Chrome tools mask sensitive user and credential-like values by default while keeping the diagnostic structure visible; for raw forensics, start the server with PERFETTO_MCP_REDACT_STRINGS_DEFAULT=false, and load_trace will report the current policy in its summary. On precision, the dedicated Chrome tools preserve full string cells by default; use max_string_len only when you explicitly want to trade detail for a smaller response. Server settings are read at startup, with CLI flags taking precedence over environment variables. Supported platforms: linux amd64/arm64, macOS amd64/arm64, Windows amd64. Upgrades require explicitly running the update subcommand; there is no auto-update daemon; uninstalling deregisters from Claude Code and Codex, deletes the binary, and cleans up the cached trace_processor_shell. Building from source requires the Rust toolchain and protoc. Dual-licensed under Apache License 2.0 or MIT.