$ show antarikshc/perfetto-mcp
Perfetto MCP is a Model Context Protocol server that provides tools for analyzing Perfetto trace files. It maintains persistent connections to trace files and exposes various analysis tools through the MCP protocol, including ANR detection, CPU profiling, jank frame detection, memory leak analysis, and more. The architecture features a modular design with separate components for connection management, tool implementations, and resource registration. Key entry points include the main server module, development entrypoint, and package initialization. The system handles connection lifecycle management with automatic reconnection and provides structured JSON responses for all tool invocations.
The LLM identified 2 files worth highlighting for reuse:
Manages persistent TraceProcessor connections with automatic reconnection and thread safety. Implements connection switching based on trace path, proper cleanup, and error handling. Demonstrates non-obvious skill in managing service connections with robust fallback mechanisms. Could be extracted for managing connections to any similar service with minimal modification.
Provides utilities for SQL statement splitting, validation, and formatting. Handles edge cases like quoted semicolons and comments to avoid incorrect statement splitting. Includes guardrails for script size and statement count. Demonstrates non-obvious skill in robust SQL parsing that correctly handles PerfettoSQL/SQLite syntax complexities. Completely self-contained with no internal dependencies, making it highly reusable.