
A debugger interface for Go programs that integrates with MCP (Model Context Protocol).
概览
A debugger interface for Go programs that integrates with MCP (Model Context Protocol). - Launch and debug Go applications - Attach to existing Go processes - Set breakpoints - Step through code (step into, step over, step out) - Eval variables - View stack traces - List all variables in current scope - Get current execution position - Debug individual test functions with debug_test - Native integration with Delve debugger API types - Capture and display program output during debugging - Support for custom test flags when debugging tests - Detailed variable inspection with configurable depth The easiest way to install the MCP Go Debugger is with Go: This will download, compile, and install the binary to your $GOPATH/bin directory. Alternatively, you can build from source: Add the following to your Cursor configuration (~/.cursor/mcp.json): This debugger is designed to be integrated with MCP-compatible clients.
README
以下为原文 README 节选,完整内容请查看原文。
MCP Go Debugger
A debugger interface for Go programs that integrates with MCP (Model Context Protocol).
Features
- Launch and debug Go applications
- Attach to existing Go processes
- Set breakpoints
- Step through code (step into, step over, step out)
- Eval variables
- View stack traces
- List all variables in current scope
- Get current execution position
- Debug individual test functions with
debug_test - Native integration with Delve debugger API types
- Capture and display program output during debugging
- Support for custom test flags when debugging tests
- Detailed variable inspection with configurable depth
Installation
Prerequisites
- Go 1.20 or higher
Using Go
The 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.
From Source
Alternatively, you can build from source:
git clone https://github.com/sunfmin/mcp-go-debugger.git
cd mcp-go-debugger
make install
Configuration
Cursor
Add the following to your Cursor configuration (~/.cursor/mcp.json):
{
"mcpServers": {
"go-debugger": {
"command": "mcp-go-debugger",
"args": []
}
}
}
Claude Desktop
Add the MCP to Claude Desktop:
claude mcp add go-debugger mcp-go-debugger
Verify the connection:
/mcp
Usage
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 session
Basic Usage Examples
Debugging a Go Program
Ask the AI assistant to debug your Go program:
> Please debug my Go application main.go
The AI assistant will use the MCP to:
- Launch the program with debugging enabled
- Set breakpoints as needed
- Eval variables and program state
- Help diagnose issues
Attaching to a Running Process
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"go-debugger": {
"command": "mcp-go-debugger",
"args": []
}
}
}