This is a Model Context Protocol (MCP) server that runs on your machine and provides a set remote debugging tools for profiling Go applications.
Available tools:
- delve - now with session support
- kube - port-forwarding to Kubernetes clusters (requires kubectl configured)
- pprof
- sshexec - requires SSH access already configured
- sysinfo - both local and remote system information via SSH
claude mcp add --scope user --transport http remote-debugger-mcp http://localhost:8899/mcpgemini mcp add remote-debugger-mcp http://localhost:8899/mcp -t httpBuild it once using the following command:
makethen just
build/remote-debugger-mcp -debugRunning application with delve debugger
dlv debug --accept-multiclient --headless --listen=:2345or even with PID (for example, 862262)
dlv attach 862262 --accept-multiclient --headless --listen=:2345Sample agent usage
delve Command=help
You can use deployment pprof-test.yaml to test kube tool.
kubectl apply -f deployments/pprof-test/pprof-test.yaml
Then use the following command to port forward and gather pprof heap profile.
Use kube tool to port forward deployment pprof-test-deployment, then gather pprof heap. Stop port forwarding.
Running application with profiling
See pprof documentation for details on how to run your application with profiling enabled.
Sample agent usage
List available pprof profiles for port 8899
or
pprof Host=192.168.4.15 Profile=heap
or even
Run available pprof profiles for host 192.168.4.15 and aggregate data
- Kill specific PID
sshexec Host=192.168.1.100 KillPID=12345
- Kill by process name
sshexec Host=192.168.1.100 KillByName=remote-debugger-mcp
- Kill with specific signal
sshexec Host=192.168.1.100 KillByName=myapp KillSignal=KILL
sysinfo
or
sysinfo Host=192.168.4.15
Build this project locally and then transfer it to remote host 192.168.4.15 using sshexec tool. Run it there with -bind 192.168.4.15:8899.
Then fetch profiling information using pprof tool, show it here, terminate remote binary.
Enabling pprof in your application exposes sensitive information about your application's performance and behavior.
To ensure that access to pprof endpoints is restricted to trusted users only, use a separate web framework, that is
not affected by pprof's init() function. For sample code, see:
- cmd/pprof-test/main.go - with labstack/echo.
- cmd/pprof-test-std/main.go - with standard net/http.
Consider using authentication mechanisms or network-level restrictions (e.g., firewalls, VPNs) to limit access.