Perfetto
Enables natural language analysis of Perfetto traces to diagnose Android app performance issues like ANRs, jank, CPU hotspots, memory leaks, and lock contention without writing SQL queries.
What is Perfetto?
Perfetto is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables natural language analysis of perfetto traces to diagnose android app performance issues like anrs, jank, cpu hotspots, memory leaks, and lock contention without writing sql queries.
Enables natural language analysis of Perfetto traces to diagnose Android app performance issues like ANRs, jank, CPU hotspots, memory leaks, and lock contention without writing SQL queries.
This server falls under the Monitoring & Observability category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Enables natural language analysis of Perfetto traces to diag
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx perfetto-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Perfetto
Perfetto MCP is a Python-based MCP server that translates natural-language questions into Perfetto SQL queries and executes them against Android performance traces using the Perfetto trace_processor_shell. It enables developers to diagnose Application Not Responding (ANR) events, frame jank, CPU hot threads, memory leaks, Binder IPC bottlenecks, and lock contention without writing SQL by hand. Android engineers and performance specialists connect it to Claude or Cursor to interactively interrogate .perfetto-trace files captured from real devices or emulators.
Prerequisites
- Python 3.13 or higher (install via Homebrew: brew install [email protected] on macOS)
- uv or uvx package runner (brew install uv on macOS)
- A captured Perfetto trace file (.perfetto-trace) from an Android device or emulator
- An MCP-compatible client such as Claude Desktop, Claude Code, or Cursor
Capture a Perfetto trace
Record a trace from your Android device using Android Studio's profiler or the Perfetto web UI at ui.perfetto.dev. Save the .perfetto-trace file to a known absolute path on your machine.
Install perfetto-mcp via uvx
The recommended installation is through uvx, which downloads and caches the package automatically. No separate pip install step is required for typical use.
uvx perfetto-mcpConfigure your MCP client
Add the server to your client's MCP configuration file. The server requires no API keys — only the path to your trace file is supplied per-query.
(Optional) Set a local trace_processor_shell binary
If your environment blocks network downloads, point the server at a pre-downloaded trace_processor_shell binary using the PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH environment variable.
export PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH=/path/to/trace_processor_shellStart an analysis session
Open your MCP client and ask a natural-language question about your trace. Every tool call requires the absolute path to the trace file and the target process name.
Perfetto Examples
Client configuration
Add perfetto-mcp to Claude Desktop or Cursor using uvx. No environment variables are required for standard usage.
{
"mcpServers": {
"perfetto-mcp": {
"command": "uvx",
"args": ["perfetto-mcp"]
}
}
}Prompts to try
Ask Claude to analyze your trace using natural language. Supply the absolute path to your .perfetto-trace file and the app's process name in your prompt.
- "In the trace at /Users/me/traces/app.perfetto-trace for com.example.app, why is the FragmentManager taking 438 ms?"
- "Find any ANR events in /tmp/trace.perfetto-trace for com.example.app and explain what caused them"
- "Which CPU hotspots are consuming the most time for com.example.app in my trace at /traces/run1.perfetto-trace?"
- "Identify lock contention issues in /traces/run1.perfetto-trace for com.example.app"
- "Detect memory leak candidates in the trace at /home/dev/perf.perfetto-trace for com.myapp"Troubleshooting Perfetto
trace_processor_shell download fails or times out
Set the PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH environment variable to the absolute path of a pre-downloaded trace_processor_shell binary from the Perfetto releases page and restart your MCP client.
Python version error on startup
Perfetto MCP requires Python 3.13+. Run `python3 --version` to check. On macOS install the correct version with `brew install [email protected]` and ensure `uvx` uses it by running `uvx --python python3.13 perfetto-mcp`.
Tool returns no results or empty query output
Verify that the trace_path you supply is an absolute path to a valid .perfetto-trace file and that the process_name matches the exact package name visible in the Perfetto UI (e.g., com.example.app, not just 'example').
Frequently Asked Questions about Perfetto
What is Perfetto?
Perfetto is a Model Context Protocol (MCP) server that enables natural language analysis of perfetto traces to diagnose android app performance issues like anrs, jank, cpu hotspots, memory leaks, and lock contention without writing sql queries. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Perfetto?
Follow the installation instructions on the Perfetto GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Perfetto?
Perfetto works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Perfetto free to use?
Yes, Perfetto is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.
Perfetto Alternatives — Similar Monitoring & Observability Servers
Looking for alternatives to Perfetto? Here are other popular monitoring & observability servers you can use with Claude, Cursor, and VS Code.
Netdata
★ 78.9kReal-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Kubeshark
★ 11.9keBPF-powered network observability for Kubernetes. Indexes L4/L7 traffic with full K8s context, decrypts TLS without keys. Queryable by AI agents via MCP and humans via dashboard.
Mission Control
★ 4.9kSelf-hosted AI agent orchestration platform: dispatch tasks, run multi-agent workflows, monitor spend, and govern operations from one mission control dashboard.
Grafana
★ 3.0kThis MCP server enables natural-language querying of Grafana logs by automatically detecting log sources and service labels. It provides read-only access to log data with intelligent caching for efficient repeat queries.
Sentrux
★ 2.4kReal-time architectural sensor that helps AI agents close the feedback loop, enabling recursive self-improvement of code quality. Pure Rust.
OpenInference
★ 986OpenTelemetry Instrumentation for AI Observability
Browse More Monitoring & Observability MCP Servers
Explore all monitoring & observability servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Perfetto in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Perfetto?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.