
Delve 调试器集成的 MCP 服务器
概览
Delve 调试器集成的 MCP 服务器 这是一个基于 TypeScript 的 MCP 服务器,为 Delve 调试器 for Go 程序提供了完整的接口。它通过 MCP 工具实现了所有主要的 Delve 命令和功能。 - 通过 delve:// URI列表和访问调试会话 - 每个会话包含其类型、目标和端口的元数据 - 会话细节和状态的JSON表示 调试、追踪和分析 Go 程序,功能包括:- 调试命令(调试、附加、执行、测试) - 核心转储分析 - 程序追踪 - 使用 rr 进行重放调试 - DAP 服务器支持 - 带条件的断点管理 - 执行控制(继续、步、下一步) - 变量检查与评估 - 后端选择(原生、lldb、rr) - 日志配置 - 会话管理 - 安装 Delve(去安装 github.com/go-delve/delve/cmd/dlv@latest)- 重放功能:Mozilla rr(https://github.com/mozilla/rr) - 节点。
概述(AI 翻译)
Delve 调试器集成的 MCP 服务器
这是一个基于 TypeScript 的 MCP 服务器,为 Delve 调试器 for Go 程序提供了完整的接口。它通过 MCP 工具实现了所有主要的 Delve 命令和功能。
特色
资源
- 通过
delve://URI列表和访问调试会话 - 每个会话都有关于其类型、目标和端口的元数据
- 会话细节和状态的JSON表示
工具
调试、追踪和分析 Go 程序:
- 调试命令(
debug、attach、exec、test) - 核心倾倒分析
- 程序追踪
- 用[[T5]进行回放调试
- DAP服务器支持
- 带条件的断点管理
- 执行控制([
continue、step、next) - 可变检查与评估
- 后端选择(
native、lldb、rr) - 日志配置
- 会话管理
环境设置
服务器要求:
- Go 安装于 Delve(
go install github.com/go-delve/delve/cmd/dlv@latest) - 回放功能:Mozilla
rr(https://github.com/mozilla/rr) - Node.js和NPM
安装
安装Delve MCP服务器:
发展
安装依赖:
搭建服务器:
关于自动重建的开发:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
delve-mcp
MCP server for Delve debugger integration
This is a TypeScript-based MCP server that provides a complete interface to the Delve debugger for Go programs. It implements all major Delve commands and capabilities through MCP tools.
Features
Resources
- List and access debug sessions via
delve://URIs - Each session has metadata about its type, target, and port
- JSON representation for session details and state
Tools
Debug, trace, and analyze Go programs with:
- Debug commands (
debug,attach,exec,test) - Core dump analysis
- Program tracing
- Replay debugging with
rr - DAP server support
- Breakpoint management with conditions
- Execution control (
continue,step,next) - Variable inspection and evaluation
- Backend selection (
native,lldb,rr) - Logging configuration
- Session management
Environment Setup
The server requires:
- Go installed with Delve (
go install github.com/go-delve/delve/cmd/dlv@latest) - For replay functionality: Mozilla
rr(https://github.com/mozilla/rr) - Node.js and npm
Installation
To install Delve MCP server:
npm install @dwisiswant0/delve-mcp
Development
Install dependencies:
npm install
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
Configuration
To use with Claude Desktop, add the server config:
- On Linux:
~/.config/Claude/claude_desktop_config.json. - On MacOS:
~/Library/Application Support/Claude/claude_desktop_config.json. - On Windows:
%APPDATA%/Claude/claude_desktop_config.json.
{
"mcpServers": {
"delve-mcp": {
"command": "/path/to/delve-mcp/build/index.js"
}
}
}
Available Tools
Debug Commands
debug- Debug a Go package in current directory or specified packageattach- Attach to a running process by PIDexec- Execute and debug a precompiled binarytest- Debug tests in current package or specified packagecore- Examine a core dump file with associated executabledap- Start a Debug Adapter Protocol (DAP) serverreplay- Replay an rr trace recordingtrace- Trace program execution with function matching
Control Commands
setBreakpoint- Set a breakpoint with optional conditionremoveBreakpoint- Remove an existing breakpointcontinue- Continue program executionnext- Step over to next linestep- Step into function callstepout- Step out of current functionvariables- List local variables in current scopeevaluate- Evaluate expression in current scope
Configuration Commands
version- Get Delve version informationsetBackend- Configure debug backend (native,lldb,rr)configureLogging- Configure debug logging components
Usage Examples
Starting a Debug Session
// Debug current package
{ name: "debug" }
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"delve-mcp": {
"command": "/path/to/delve-mcp/build/index.js"
}
}
}