Perfetto

v1.0.0Monitoring & Observabilitystable

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.

android-tracingmcpmodel-context-protocolperfetto
Share:
185
Stars
0
Downloads
0
Weekly
0/5

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

Analyze Android app performance using natural language queries.
Diagnose ANRs, jank, CPU hotspots, and memory issues.
Debug performance without writing complex SQL queries.
antarikshc

Maintainer

LicenseApache 2.0
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx perfetto-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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.

2

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-mcp
3

Configure 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.

4

(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_shell
5

Start 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.

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.

Quick Config Preview

{ "mcpServers": { "perfetto-mcp": { "command": "npx", "args": ["-y", "perfetto-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides