home / mcp / perfetto mcp server
This is a Model Context Protocol (MCP) server that gets answers from your Perfetto Traces. It turns natural‑language prompts into focused Perfetto analyses.
Configuration
View docs{
"mcpServers": {
"antarikshc-perfetto-mcp": {
"command": "uvx",
"args": [
"perfetto-mcp"
],
"env": {
"PYTHONPATH": "src"
}
}
}
}Perfetto MCP Server turns natural-language prompts into focused Perfetto analyses, enabling you to ask in plain language for ANR detection, CPU profiling, jank insights, memory leak clues, and thread contention results without writing SQL. It helps you quickly diagnose performance issues directly from Perfetto traces and share findings with your team.
To start analyzing Perfetto traces, you interact with an MCP client and point it at a trace file and target process. You should clearly specify the trace path and the process name in your prompts to ensure the analysis runs on the correct data.
Example prompt structure you can use in your client: Use perfetto trace \/absolute\/path\/to\/trace.perfetto-trace for process \\com.example.app\\``. This makes the tool fetch the right trace and focus the analysis on the specified process.
You can refine analyses with additional filters. Provide a time range and any thresholds your analysis should respect.
Survey available trace slices to identify hot paths and map them to meaningful sections in your Perfetto trace.
Run custom PerfettoSQL queries to correlate threads, frames, and events for advanced analysis.
Locate ANR events within the trace and classify their severity for quick triage.
Deep-dive ANR causes with ranked likelihoods to help pinpoint root issues.
Profile CPU usage by thread and identify hottest threads and scheduling patterns.
List long-running main-thread operations to uncover UI or app slow paths.
Identify frames that miss deadlines and surface the worst offenders.
Provide an overview of frame health, including jank rate and P99 CPU time.
Find synchronization bottlenecks and show the worst waits across time ranges.
Analyze Binder IPC performance to highlight slow interactions.
Detect patterns of sustained memory growth and leaks over a window.
Identify memory-hogging classes by analyzing heap dominators and top offenders.