Go Debugger
STDIODebugger interface for Go programs with MCP integration
Debugger interface for Go programs with MCP integration
A debugger interface for Go programs that integrates with MCP (Model Context Protocol).
debug_testThe easiest way to install the MCP Go Debugger is with Go:
go install github.com/sunfmin/mcp-go-debugger/cmd/mcp-go-debugger@latest
This will download, compile, and install the binary to your $GOPATH/bin directory.
Alternatively, you can build from source:
git clone https://github.com/sunfmin/mcp-go-debugger.git cd mcp-go-debugger make install
Add the following to your Cursor configuration (~/.cursor/mcp.json):
{ "mcpServers": { "go-debugger": { "command": "mcp-go-debugger", "args": [] } } }
Add the MCP to Claude Desktop:
claude mcp add go-debugger mcp-go-debugger
Verify the connection:
/mcp
This debugger is designed to be integrated with MCP-compatible clients. The tools provided include:
ping - Test connection to the debuggerstatus - Check debugger status and server uptimelaunch - Launch a Go program with debuggingattach - Attach to a running Go processdebug - Debug a Go source file directlydebug_test - Debug a specific Go test functionset_breakpoint - Set a breakpoint at a specific file and linelist_breakpoints - List all current breakpointsremove_breakpoint - Remove a breakpointcontinue - Continue execution until next breakpoint or program endstep - Step into the next function callstep_over - Step over the next function callstep_out - Step out of the current functioneval_variable - Eval a variable's value with configurable depthlist_scope_variables - List all variables in current scope (local, args, package)get_execution_position - Get current execution position (file, line, function)get_debugger_output - Retrieve captured stdout and stderr from the debugged programclose - Close the current debugging sessionAsk the AI assistant to debug your Go program:
> Please debug my Go application main.go
The AI assistant will use the MCP to:
If your Go application is already running, you can attach the debugger:
> Attach to my Go application running with PID 12345
> I'm getting a panic in my processOrders function when handling large orders. 
> Can you help me debug it?
The AI will help you:
If you want to debug a specific test function instead of an entire application:
> Please debug the TestCalculateTotal function in my calculator_test.go file
The AI assistant will use the debug_test tool to:
You can also specify test flags:
> Debug the TestUserAuthentication test in auth_test.go with a timeout of 30 seconds
This is especially useful for:
When working with nested structures or complex types:
> Can you eval the user.Profile.Preferences object at line 45? I need to see all nested fields in detail.
The AI will:
eval_variable tool with appropriate depth parametersTo debug a program that requires command-line arguments:
> Debug my data_processor.go with the arguments "--input=data.json --verbose --max-records=1000"
The debugger will:
For debugging concurrent Go programs:
> I think I have a race condition in my worker pool implementation. Can you help me debug it?
The AI can:
For understanding complex control flow:
> Walk me through what happens when the processPayment function is called with an invalid credit card
The AI assistant will: