pprof-analyzer-mcp
Pprof Analyzer MCP Server is a Go-based tool designed for analyzing performance profiles of Go applications. It offers various functionalities such as generating flame graphs, analyzing heap and CPU profiles, and detecting memory leaks. The server is implemented as a Model Context Protocol (MCP) server.
Pprof Analyzer MCP Server
This project is a Model Context Protocol (MCP) server implemented in Go, designed to analyze Go pprof performance profiles. It supports analyzing various profile types such as cpu
, heap
, goroutine
, and allocs
. Key features include:
- Analyze pprof Tool: Provides serialized analysis results and supports output formats like
text
,markdown
,json
, andflamegraph-json
. - Generate flamegraph Tool: Generates an SVG flame graph using
go tool pprof
. - Open Interactive Pprof Tool: Launches the
go tool pprof
web UI on macOS. - Detect Memory Leaks Tool: Compares heap snapshots to identify memory leaks.
- Disconnect Pprof Session Tool: Terminates background
pprof
processes.
Installation (As a Library/Tool)
The package can be installed using go install
and requires Go 1.18 or higher. It can also be run via Docker for convenient dependency management.
Usage Examples
The server supports a variety of tools through MCP client configurations such as analyzing and generating flame graphs for different profiles.
Future Improvements
The project aims to enhance its current capabilities by implementing full analysis logic for certain profile types, improving error handling, and introducing new features like time-series analysis.