← Back to directory
P

Perfetto MCP Server

Community
Turn natural language into powerful Perfetto trace analysis
GitHub source repository ↗
★ 214 Stars Category · Dev Tools Popular
63FMRS · C

A comprehensive Android performance-analysis MCP server that turns natural-language prompts into 12 specialized Perfetto tools covering ANR, CPU, frame performance, contention, Binder IPC, and memory analysis. Stdio transport only; requires Python 3.13+ and uv; community-maintained under Apache-2.0, not official.

Reliability
8/20
Security and permissions
14/20
Maintenance
12/20
Documentation
15/20
Setup experience
14/20
Read the FMRS scoring method →

Perfetto MCP Server is a Model Context Protocol (MCP) server that transforms natural-language prompts into focused Perfetto analyses. It explains jank, diagnoses ANRs, spots CPU hot threads, uncovers lock contention, and finds memory leaks without writing SQL. Every tool requires trace_path (absolute path to a Perfetto trace) and process_name (target process/app name). All tools return structured JSON with summary, details, and metadata.

Tools

find_slices
Survey slice names and locate hot paths
execute_sql_query
Run custom PerfettoSQL for advanced analysis
detect_anrs
Find ANR events with severity classification
anr_root_cause_analyzer
Deep-dive ANR causes with ranked likelihood
cpu_utilization_profiler
Profile thread-level CPU usage and scheduling
main_thread_hotspot_slices
Find longest-running main thread operations
detect_jank_frames
Identify frames missing deadlines
frame_performance_summary
Summarize overall frame health metrics
thread_contention_analyzer
Find synchronization bottlenecks
binder_transaction_profiler
Analyze Binder IPC performance
memory_leak_detector
Find sustained memory growth patterns
heap_dominator_tree_analyzer
Identify memory-hogging classes

Setup

Requires Python 3.13+ and uv (on macOS: brew install [email protected], brew install uv). Add the MCP server to Cursor, Claude Code, VS Code, or Codex with command 'uvx perfetto-mcp'. Alternatively pip3 install perfetto-mcp and run python3 -m perfetto_mcp. If your network blocks downloads, set PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH to the absolute path of a local trace_processor_shell binary. For development, run uv sync and uv run mcp dev src/perfetto_mcp/dev.py inside the perfetto-mcp-server directory.

claude_desktop_config.json
{"mcpServers":{"perfetto-mcp":{"command":"uvx","args":["perfetto-mcp"]}}}

Fit and risk

Best for

  • Android developers analyzing Perfetto traces
  • Engineers who want jank, ANR, contention, and memory analysis without writing SQL
  • Clients supporting stdio MCP such as Cursor, Claude Code, VS Code, and Codex

Not for

  • Users who do not analyze Perfetto traces
  • Scenarios where an absolute trace_path and process_name cannot be provided
  • Environments that cannot run Python MCP servers via uvx or pip

Required permissions

  • Needs read access to local Perfetto trace files (absolute path passed as trace_path)
  • May download trace_processor_shell on first run (or use a local binary via PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH)

Risks and side effects

  • Traces contain application and system runtime details; sharing them may expose sensitive information
  • Default behavior may download an external binary; restricted networks should configure a local path
  • Queries are generated by an LLM and results should be verified

Troubleshooting

  1. Verify trace_path is an absolute path to a .perfetto-trace file
  2. Confirm process_name matches the process in the trace (e.g. com.example.app)
  3. If trace_processor_shell download fails, set PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH to a local binary
  4. Ensure Python 3.13+ and uv are installed
  5. Be explicit in prompts, e.g. 'Use perfetto trace /absolute/path for process com.example.app'

Use cases

Explain why FragmentManager takes 438ms to execute
Detect and analyze ANR root causes
Find CPU hot threads and main-thread hotspot slices
Detect janky frames above 16.67ms and summarize frame performance
Locate lock contention and slow Binder transactions
Detect memory-leak signals and analyze heap dominator classes

Supported clients

CursorFull support
Claude CodeFull support
VS CodeFull support
CodexFull support