antarikshc avatar

Perfetto

antarikshc/perfetto-mcp

Wraps Perfetto's trace processor Python API to turn natural language queries into PerfettoSQL analysis. You can ask it to detect ANRs, find CPU hotspots, analyze frame jank, or spot memory leaks without writing SQL by hand. It connects to local Perfetto trace files and exposes tools for main thread profiling, lock contention analysis, Binder IPC performance, and heap dominator trees. Reach for this when you're debugging Android performance issues and want to interrogate traces conversationally instead of crafting complex queries in the Perfetto UI.

GitHub stars
178
tools
12
last updated
Mar 8, 2026

Tools

12 tools

Public tool metadata for what this MCP can expose to an agent.

find_slicesSurvey slice names and locate hot paths

Survey slice names and locate hot paths

No parameter schema in public metadata yet.

execute_sql_queryRun custom PerfettoSQL for advanced analysis

Run custom PerfettoSQL for advanced analysis

No parameter schema in public metadata yet.

detect_anrsFind ANR events with severity classification

Find ANR events with severity classification

No parameter schema in public metadata yet.

anr_root_cause_analyzerDeep-dive ANR causes with ranked likelihood

Deep-dive ANR causes with ranked likelihood

No parameter schema in public metadata yet.

cpu_utilization_profilerThread-level CPU usage and scheduling

Thread-level CPU usage and scheduling

No parameter schema in public metadata yet.

main_thread_hotspot_slicesFind longest-running main thread operations

Find longest-running main thread operations

No parameter schema in public metadata yet.

detect_jank_framesIdentify frames missing deadlines

Identify frames missing deadlines

No parameter schema in public metadata yet.

frame_performance_summaryOverall frame health metrics

Overall frame health metrics

No parameter schema in public metadata yet.

thread_contention_analyzerFind synchronization bottlenecks

Find synchronization bottlenecks

No parameter schema in public metadata yet.

binder_transaction_profilerAnalyze Binder IPC performance

Analyze Binder IPC performance

No parameter schema in public metadata yet.

memory_leak_detectorFind sustained memory growth patterns

Find sustained memory growth patterns

No parameter schema in public metadata yet.

heap_dominator_tree_analyzerIdentify memory-hogging classes

Identify memory-hogging classes

No parameter schema in public metadata yet.

Sponsors

Readme

showcase

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

showcase

πŸ“‹ Prerequisites

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

πŸš€ Getting Started

Cursor

View the full README on GitHub

Details

Repository
github.com/antarikshc/perfetto-mcp