- Home
- MCP servers
- Pprof Analyzer
Pprof Analyzer
- go
47
GitHub Stars
go
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can analyze Go performance profiles with an MCP server that provides powerful tools for profiling, memory analysis, and flame-graph generation. This MCP server makes it easy to run analyses against pprof data from various sources and to connect to an MCP client to view results in human-friendly formats.
How to use
Connect to the MCP server from your MCP client to run profiling tasks. You can analyze CPU, heap, goroutine, and allocation profiles, as well as generate flame graphs. Results can be delivered in text, markdown, json, or flame-graph JSON formats. You can also run an interactive pprof UI on macOS for quick exploration, or compare two heap profiles to detect memory leaks.
How to install
Prerequisites: you need a Go environment and optionally Docker for containerized runs. You should also have Graphviz if you plan to generate SVG flame graphs.
Install the MCP server binary directly from the module path.
go install github.com/ZephyrDeng/pprof-analyzer-mcp@latest
Additional sections
Configuration and usage details mainly come from how you connect with an MCP client and how you run the server in different environments.
Run the server with Docker to bundle Graphviz. Build and run the Docker image:
docker build -t pprof-analyzer-mcp .
docker run -i --rm pprof-analyzer-mcp
MCP client connection (example)
Configure your MCP client to connect to the server using the provided command. If you are using a Docker-based setup, you can connect by executing the following command in your MCP client configuration:
{
"mcpServers": {
"pprof_analyzer": {
"command": "docker",
"args": ["run","-i","--rm","pprof-analyzer-mcp"]
}
}
}
Tools and capabilities
The server exposes several tools to analyze profiles and produce useful outputs. You can run these tools through your MCP client to obtain structured results without manually parsing raw pprof data.
Notes and troubleshooting
Graphviz is required for flame-graph generation. Ensure the dot tool is available on your system path when using generate_flamegraph.
If you run into issues starting the interactive pprof UI on macOS, verify that the go tool is in your PATH and that port 8081 (default) is not blocked.
Available tools
analyze_pprof
Analyzes a specified pprof file and returns serialized results such as a Top N list or a flame graph in JSON or text formats. Supports profile types cpu, heap, goroutine, allocs, mutex, block and outputs in text, markdown, json, or flamegraph-json formats with a configurable top_n.
generate_flamegraph
Uses go tool pprof to generate an SVG flame graph for the given pprof file. Requires Graphviz to be installed and supports profile types cpu, heap, allocs, goroutine, mutex, block. Outputs the SVG to a user-specified path.
open_interactive_pprof
Launches an interactive pprof web UI in the background on macOS. Returns the PID of the background process and uses port 8081 by default if http_address is not provided. Requires the go command to be available in PATH.
detect_memory_leaks
Compares two heap profile snapshots to identify potential memory leaks. Provides memory-growth statistics by object type and allocation site, with configurable growth threshold and result limit.
disconnect_pprof_session
Attempts to terminate a background pprof process started by open_interactive_pprof using its PID, first sending an interrupt then a kill signal if necessary.
compare_profiles
Compares two profile files to identify performance regressions or improvements. Reports diffs with indicators for regression, improvement, added, or removed functions and supports text, markdown, and JSON outputs.
analyze_heap_time_series
Analyzes multiple heap profiles over time to identify memory growth trends, calculates growth rates, and highlights trending object types. Supports custom labels and multiple output formats.