
通过MCP进行Perfetto跟踪分析——PerfettoSQL查询及专用的Chrome工具,用于滚动卡顿、页面加载和主线程热点
概览
一个MCP服务器,允许LLM分析Perfetto跟踪。指向Claude代码(或任何MCP客户端)到一个跟踪文件(.pftrace / .perfetto-trace / .bin / ... — 内容嗅探)并用通俗语言询问。服务器底层运行PerfettoSQL,trace_processor_shell支持——首次运行时自动下载,无需手动安装Perfetto。 专用工具自带策划的 SQL;为自定义分析,代理编写 PerfettoSQL——并引导至正确的标准函式库模块。 你通过MCP客户端(Claude Code、Claude Desktop、Codex、Cursor等)驱动perfetto-mcp-rs——如果还没有,先安装一个。 ——下载预构建的二进制文件,如果存在Claude代码和/或Codex,则自动注册MCP服务器: 重启Claude Code(或开一个新的Codex会话)来获取它。Homebrew、Cargo、项目范围、直接二进制下载和手动注册都在安装选项中。 加载 ~/traces/scroll_jank.pftrace,告诉我主要的滚动卡顿原因。
概述(AI 翻译)
英文 |简体中文
完美MCP-RS
一个让LLM进行分析的MCP服务器
Perfetto跟踪。指向Claude Code(或任何MCP客户端)
一个跟踪文件(.pftrace / .perfetto-trace / .bin / … — 已嗅闻内容)
用直白的语言问。服务器在底层运行 PerfettoSQL,支持
trace_processor_shell — 首次运行时自动下载,无需手动操作
需要安装良好。
专用工具提供策划的 SQL;为自定义分析,代理编写 PerfettoSQL——并引导至正确的标准库模块。
快速开始
你通过MCP客户端(Claude Code,Claude Desktop, Codex、光标…)——如果你还没有,先安装一个。
1.安装——下载预构建的二进制文件,如果是Claude代码和/或Codex,则下载 存在,自动注册MCP服务器:
重启Claude代码(或重新开一个Codex游戏)来获取它。自制内容, 货物、项目范围、直接二进制下载和手动注册分别在 安装选项。
2.用通俗易懂的语言问:
加载
~/traces/scroll_jank.pftrace,告诉我主要导致滚动卡顿的原因。
替换你所有的Perfetto跟踪——从Perfetto界面捕获的,
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
English | 简体中文
perfetto-mcp-rs
An MCP server that lets LLMs analyze
Perfetto traces. Point Claude Code (or any MCP client) at
a trace file (.pftrace / .perfetto-trace / .bin / … — content-sniffed) and
ask in plain language. The server runs PerfettoSQL under the hood, backed by
trace_processor_shell — downloaded automatically on first run, no manual
Perfetto install required.
Dedicated tools ship curated SQL; for custom analysis the agent writes PerfettoSQL — steered toward the right stdlib modules.
Quick start
You drive perfetto-mcp-rs through an MCP client (Claude Code, Claude Desktop, Codex, Cursor, …) — install one first if you don’t have it.
1. Install — downloads the prebuilt binary and, if Claude Code and/or Codex are present, registers the MCP server automatically:
# Linux / macOS / Windows (Git Bash, MSYS2, Cygwin)
curl -fsSL https://raw.githubusercontent.com/tooluse-labs/perfetto-mcp-rs/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/tooluse-labs/perfetto-mcp-rs/main/install.ps1 | iex
Restart Claude Code (or start a new Codex session) to pick it up. Homebrew, Cargo, project scope, direct-binary download, and manual registration are under Install options.
2. Ask in plain language:
Load
~/traces/scroll_jank.pftraceand tell me the top scroll-jank causes.
Swap in any Perfetto trace you have — captured from the Perfetto UI,
chrome://tracing, or record_android_trace.
The agent calls load_trace, sees it’s a Chrome trace, and reaches for the
dedicated chrome_scroll_jank_summary tool — no SQL to hand-write. When a
question falls outside the dedicated tools, it drops down to execute_sql with
raw PerfettoSQL on the same trace.
Works best with agentic clients (Claude Code, Codex, Claude Desktop, Cursor) that chain multi-turn tool calls and follow the server’s error-message nudges. Non-agentic clients see the same tools and error nudges, but won’t chain the guided flow automatically.
Tools
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"perfetto-rs": {
"command": "/absolute/path/to/perfetto-mcp-rs"
}
}
}