Get the FREE Ultimate OpenClaw Setup Guide →

pprof-analyzer

This is a Model Context Protocol (MCP) server implemented in Go, providing a tool to analyze Go pprof performance profiles.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio zephyrdeng-pprof-analyzer-mcp docker run -i pprof-analyzer-mcp

How to use

The Pprof Analyzer MCP Server provides a collection of tooling to analyze Go pprof profiles directly through the MCP framework. It offers an analyze_pprof tool capable of processing CPU, heap, goroutine, allocs, mutex and block profiles and returning results in multiple formats (text, markdown, json, and flamegraph-json). In addition, you can generate flamegraphs via generate_flamegraph, launch an interactive pprof UI on macOS with open_interactive_pprof, compare two profiles with compare_profiles, and detect memory leaks by comparing heap snapshots with detect_memory_leaks. The server is designed to work with standard MCP clients and can be connected via a docker command or other integration methods supported by MCP clients. You can request Top N results, switch output formats, and generate structured data suitable for visualization.

How to install

Prerequisites:

  • Docker installed and running (recommended for this MCP server).
  • Optional: Go toolchain if you prefer building from source locally instead of using Docker.

Using Docker (recommended):

  1. Build the Docker image locally (if not already built by the maintainer): docker build -t pprof-analyzer-mcp .
  2. Run the MCP server with Docker (as described in the README): docker run -i --rm pprof-analyzer-mcp

Alternative: Build from source (Go required)

  1. Ensure Go 1.18+ is installed.
  2. Clone the repository and navigate to the project root.
  3. Build the executable: go build
  4. Run the server binary directly (if the project exposes an MCP entrypoint): ./pprof-analyzer-mcp

If you plan to run via npm/pipx/uvx/etc., please refer to the project’s official deployment notes for any additional steps, but the Docker path is the simplest to ensure environment consistency.

Additional notes

Notes and tips:

  • The Docker image for pprof-analyzer-mcp bundles Graphviz, which is required for flamegraph generation when using generate_flamegraph.
  • For open_interactive_pprof on macOS, ensure the go toolchain is available in PATH. This tool may operate in the background and will report its PID upon success.
  • The tool set includes compare_profiles for regression testing across profile runs and detect_memory_leaks for memory growth analysis; these can produce output in text, markdown, or JSON formats depending on client configuration.
  • If you customize the MCP client to connect to the docker-based server, ensure the client’s mcp.json points to the correct command and that Docker permissions allow container execution from the client environment.
  • Environment variables (e.g., for custom paths or API endpoints) can be added to the mcp_config under an env block if needed by your deployment context.

Related MCP Servers

Sponsor this space

Reach thousands of developers