Perfetto

Developer tools

This is a Model Context Protocol (MCP) server that gets answers from your Perfetto Traces. It turns natural‑language prompts into focused Perfetto analyses.

Your AI app calls the Perfetto MCP server, which does the developer tools work and sends the result back to the chat.

About Perfetto

Perfetto is a community MCP server from antarikshc, filed in our directory under developer tools. This is a Model Context Protocol (MCP) server that gets answers from your Perfetto Traces. It turns natural‑language prompts into focused Perfetto analyses.

Perfetto runs on your own machine: your AI app starts it with the command uvx perfetto-mcp and talks to it over standard input and output.

At a glance

Publisher
antarikshc (community)
Runs
Locally on your machine
Install from
Python package on PyPI: perfetto-mcp
Written in
Python
License
Apache-2.0
GitHub stars
224

How to set up Perfetto

  1. Install uv on the machine that runs your AI app, because Perfetto starts with uvx and fetches its Python package on first run.
  2. Check the Perfetto README for keys or settings; the registry lists none that Perfetto requires.
  3. Add Perfetto to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Perfetto tools to confirm the connection.
  5. Run one read-only task with Perfetto first, and keep your app asking before each tool call until the results look right.

Perfetto compared with similar servers

  • LeanKG by FreePeak has fewer GitHub stars than Perfetto (222 against 224); both are community servers, and both run locally.
  • Glif by glifxyz has more GitHub stars than Perfetto (225 against 224); both are community servers, and Glif runs as a remote server and Perfetto runs on your own machine.
  • Utcp by universal-tool-calling-protocol has fewer GitHub stars than Perfetto (222 against 224); both are community servers, and both run locally.

Before you connect Perfetto

  • Give Perfetto its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Perfetto tool call until you trust what it does with them.
  • Treat text that Perfetto fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Perfetto on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Perfetto

How marketing and sales teams put Perfetto to work, by company size. Pick the size closest to yours and start Perfetto on one use case.

Small business

  • A small business with a developer can use Perfetto to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Perfetto to explain and fix a marketing site issue without context switching between tools.
  • Perfetto runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Perfetto to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Perfetto to keep scripts and automations documented and versioned as they change.
  • Start Perfetto on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Perfetto with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Perfetto so web and marketing engineering share one reviewed way of working with AI.
  • Perfetto is a community server, so have security review the code and pin a version before Perfetto touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Perfetto README

From antarikshc/perfetto-mcp on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

Perfetto MCP

Turn natural language into powerful Perfetto trace analysis

A Model Context Protocol (MCP) server that transforms natural-language prompts into focused Perfetto analyses. Quickly explain jank, diagnose ANRs, spot CPU hot threads, uncover lock contention, and find memory leaks – all without writing SQL.

✨ Features

  • Natural Language → SQL: Ask questions in plain English, get precise Perfetto queries
  • ANR Detection: Automatically identify and analyze Application Not Responding events
  • Performance Analysis: CPU profiling, frame jank detection, memory leak detection
  • Thread Contention: Find synchronization bottlenecks and lock contention
  • Binder Profiling: Analyze IPC performance and slow system interactions

📋 Prerequisites

  • Python 3.13+ (macOS/Homebrew):
    brew install python@3.13
    
  • uv (recommended):
    brew install uv
    

🚀 Getting Started

Cursor

Or add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):

{
  "mcpServers": {
    "perfetto-mcp": {
      "command": "uvx",
      "args": ["perfetto-mcp"]
    }
  }
}
Claude Code

Run this command. See Claude Code MCP docs for more info.

# Add to user scope
claude mcp add perfetto-mcp --scope user -- uvx perfetto-mcp

Or edit ~/claude.json (macOS) or %APPDATA%\Claude\claude.json (Windows):

{
  "mcpServers": {
    "perfetto-mcp": {
      "command": "uvx",
      "args": ["perfetto-mcp"]
    }
  }
}
VS Code

or add to .vscode/mcp.json (project) or run "MCP: Add Server" command:

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

Enable in GitHub Copilot Chat's Agent mode.

Codex

Edit ~/.codex/config.toml:

[mcp_servers.perfetto-mcp]
command = "uvx"
args = ["perfetto-mcp"]
Optional: Use a Local trace_processor_shell Binary

If your network environment blocks downloads, set PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH to an absolute path of a local trace_processor_shell binary.

When this env var is set, perfetto-mcp uses that binary directly. When it is not set, default perfetto Python behavior is unchanged.

Example (mcp.json):

{
  "mcpServers": {
    "perfetto-mcp": {
      "command": "uvx",
      "args": ["perfetto-mcp"],
      "env": {
        "PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH": "D:/tools/perfetto/trace_processor_shell.exe"
      }
    }
  }
}

Example (~/.codex/config.toml):

[mcp_servers.perfetto-mcp]
command = "uvx"
args = ["perfetto-mcp"]
[mcp_servers.perfetto-mcp.env]
PERFETTO_MCP_TRACE_PROCESSOR_BIN_PATH = "D:/tools/perfetto/trace_processor_shell.exe"
Local Install (development server)
cd perfetto-mcp-server
uv sync
uv run mcp dev src/perfetto_mcp/dev.py
Local MCP
{
  "mcpServers": {
    "perfetto-mcp-local": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/git/repo/perfetto-mcp",
        "run",
        "-m",
        "perfetto_mcp"
      ],
      "env": { "PYTHONPATH": "src" }
    }
  }
}
Using pip
pip3 install perfetto-mcp
python3 -m perfetto_mcp

📖 How to Use

Example starting prompt:

In the perfetto trace, I see that the FragmentManager is taking 438ms to execute. Can you figure out why it's taking so long?

Required Parameters

Every tool needs these two inputs:

Parameter Description Example
trace_path Absolute path to your Perfetto trace /path/to/trace.perfetto-trace
process_name Target process/app name com.example.app
In Your Prompts

Be explicit about the trace and process, prefix your prompt with:

"Use perfetto trace /absolute/path/to/trace.perfetto-trace for process com.example.app"

Optional Filters

Many tools support additional filtering (but let your LLM handle that):

  • time_range: {start_ms: 10000, end_ms: 25000}
  • Tool-specific thresholds: min_block_ms, jank_threshold_ms, limit

🛠️ Available Tools

🔎 Exploration & Discovery
Tool Purpose Example Prompt
find_slices Survey slice names and locate hot paths "Find slice names containing 'Choreographer' and show top examples"
execute_sql_query Run custom PerfettoSQL for advanced analysis "Run custom SQL to correlate threads and frames in the first 30s"
🚨 ANR Analysis

Note: Helpful if the recorded trace contains ANR

Tool Purpose Example Prompt
detect_anrs Find ANR events with severity classification "Detect ANRs in the first 10s and summarize severity"
anr_root_cause_analyzer Deep-dive ANR causes with ranked likelihood "Analyze ANR root cause around 20,000 ms and rank likely causes"
🎯 Performance Profiling
Tool Purpose Example Prompt
cpu_utilization_profiler Thread-level CPU usage and scheduling "Profile CPU usage by thread and flag the hottest threads"
main_thread_hotspot_slices Find longest-running main thread operations "List main-thread hotspots >50 ms during 10s–25s"
📱 UI Performance
Tool Purpose Example Prompt
detect_jank_frames Identify frames missing deadlines "Find janky frames above 16.67 ms and list the worst 20"
frame_performance_summary Overall frame health metrics "Summarize frame performance and report jank rate and P99 CPU time"
🔒 Concurrency & IPC
Tool Purpose Example Prompt
thread_contention_analyzer Find synchronization bottlenecks "Find lock contention between 15s–30s and show worst waits"
binder_transaction_profiler Analyze Binder IPC performance "Profile slow Binder transactions and group by server process"
💾 Memory Analysis
Tool Purpose Example Prompt
memory_leak_detector Find sustained memory growth patterns "Detect memory-leak signals over the last 60s"
heap_dominator_tree_analyzer Identify memory-hogging classes "Analyze heap dominator classes and list top offenders"
Output Format

All tools return structured JSON with:

  • Summary: High-level findings
  • Details: Tool-specific results
  • Metadata: Execution context and any fallbacks used

📚 Resources

📄 License

Apache 2.0 License. See LICENSE for details.

GitHub • Issues • Documentation (github.com/antarikshc/perfetto-mcp/blob/main)

Questions about Perfetto

What is the 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. Perfetto is maintained by antarikshc on GitHub at antarikshc/perfetto-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Perfetto MCP server?

Add Perfetto to your AI app's MCP config with the command uvx perfetto-mcp. In Claude Code, run claude mcp add --transport stdio perfetto -- uvx perfetto-mcp. To run Perfetto this way you need uv installed.

Does Perfetto need an API key?

The registry lists no required keys for Perfetto. Check the Perfetto README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Perfetto an official MCP server?

No. Perfetto is a community server maintained by antarikshc. Community servers can be excellent; read the code and the open issues before you give Perfetto access to company data.

What license is Perfetto under?

Perfetto is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Perfetto; the service it connects to has its own terms.