Get the FREE Ultimate OpenClaw Setup Guide →

gospy

Non-Invasive goroutine inspector

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio monsterxx03-gospy go install github.com/monsterxx03/gospy@latest \
  --env GOSPY_ENABLE_MCP="true" \
  --env GOSPY_DEFAULT_PORT="8974"

How to use

gospy is a Go-based process inspection tool that also exposes an MCP (Model Context Protocol) HTTP endpoint. Once installed, you can start a local MCP server by running the gospy binary with MCP enabled, which exposes endpoints for goroutine dumps, memory stats, and runtime information, as well as a dedicated MCP API endpoint. Use the included CLI to interact with a running Go process, for example by listing goroutines, viewing memory usage, or fetching runtime details for a given PID. The MCP interface allows programmatic access to the same capabilities, enabling external tooling to query runtime state via HTTP.

How to install

Prerequisites:

  • Go 1.20+ installed on your system
  • Linux or macOS (Apple Silicon supported)
  • Root privileges if you need memory access for certain operations

Installation steps:

  1. Install the gospy binary using Go:
go install github.com/monsterxx03/gospy@latest
  1. Ensure the binary is in your PATH (the go install step places it in $(go env GOPATH)/bin, which should be on your PATH).
  2. Run the MCP-enabled server (example port 8974):
# Start the HTTP/MCP server with MCP enabled
sudo gospy serve --enable-mcp --port 8974
  1. Verify the server is running by visiting the MCP endpoint or the HTTP API:
curl http://localhost:8974/mcp

Notes:

  • The tool requires root privileges to inspect certain process details (memory access).
  • Build from source if needed by cloning the repository and running make as documented in the project.

Additional notes

Tips and caveats:

  • The MCP server exposes endpoints such as GET /runtime?pid=<PID>, GET /goroutines?pid=<PID>, and GET /memstats?pid=<PID>, plus the /mcp endpoint for MCP interactions.
  • Run the server with sudo when you need memory access for non-root processes.
  • If the port is in use, choose another port with --port. Ensure firewalls allow access to the chosen port.
  • The CLI commands (top, serve, summary) map to real-time process inspection; use --json to get machine-readable outputs.
  • For automation, use the /mcp endpoint to integrate with external tooling that consumes MCP-formatted data.

Related MCP Servers

Sponsor this space

Reach thousands of developers