MCP Go Debugger is an interface that allows you to debug Go programs using the Model Context Protocol (MCP). It provides seamless integration between MCP-compatible AI assistants and the Delve debugger, enabling interactive debugging sessions with features like setting breakpoints, stepping through code, and inspecting variables.
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.
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 integrates with MCP-compatible clients and provides the following tools:
Ask 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:
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
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:
To debug a program that requires command-line arguments:
Debug my data_processor.go with the arguments "--input=data.json --verbose --max-records=1000"
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:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "go-debugger" '{"command":"mcp-go-debugger","args":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"go-debugger": {
"command": "mcp-go-debugger",
"args": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"go-debugger": {
"command": "mcp-go-debugger",
"args": []
}
}
}
3. Restart Claude Desktop for the changes to take effect