Skip to content

tb0hdan/remote-debugger-mcp

Repository files navigation

Remote debugger MCP

This is a Model Context Protocol (MCP) server that runs on your machine and provides a set remote debugging tools for profiling Go applications.

Project Overview

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

Adding to coding agents

Claude Code

 claude mcp add --scope user --transport http remote-debugger-mcp http://localhost:8899/mcp

Gemini CLI

gemini mcp add remote-debugger-mcp http://localhost:8899/mcp -t http

Running the Server

Build it once using the following command:

make

then just

build/remote-debugger-mcp -debug

Tools usage

delve

Running application with delve debugger

dlv debug --accept-multiclient --headless --listen=:2345

or even with PID (for example, 862262)

dlv attach 862262 --accept-multiclient --headless --listen=:2345

Sample agent usage

delve Command=help

kube

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.

pprof

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

sshexec

  • 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

sysinfo

or

sysinfo Host=192.168.4.15

Combined usage (tested on Claude)

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.

Security considerations

pprof

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:

General security

Consider using authentication mechanisms or network-level restrictions (e.g., firewalls, VPNs) to limit access.

Similar projects

About

Remote debugger MCP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages