Delve MCP
delve-mcp
用于 Delve 调试器集成的 MCP 服务器
这是一个基于 TypeScript 的 MCP 服务器,为 Go 程序的 Delve 调试器提供了完整的接口。它通过 MCP 工具实现了所有主要的 Delve 命令和功能。
特征
资源
通过
delve://URI 列出并访问调试会话每个会话都有关于其类型、目标和端口的元数据
会话详细信息和状态的 JSON 表示
工具
使用以下工具调试、跟踪和分析 Go 程序:
调试命令(
debug、attach、exec、test)核心转储分析
程序跟踪
使用
rr重放调试DAP 服务器支持
带条件的断点管理
执行控制(
continue、step、next)变量检验与评估
后端选择(
native、lldb、rr)日志配置
会话管理
环境设置
服务器要求:
使用 Delve 安装 Go(
go install github.com/go-delve/delve/cmd/dlv@latest)对于重放功能:Mozilla
rr( https://github.com/mozilla/rr )Node.js 和 npm
Related MCP server: MCP Server Playground
安装
要安装 Delve MCP 服务器:
npm install @dwisiswant0/delve-mcp发展
安装依赖项:
npm install构建服务器:
npm run build对于使用自动重建的开发:
npm run watch配置
要与 Claude Desktop 一起使用,请添加服务器配置:
在 Linux 上:
~/.config/Claude/claude_desktop_config.json。在 MacOS 上:
~/Library/Application Support/Claude/claude_desktop_config.json。在 Windows 上:
%APPDATA%/Claude/claude_desktop_config.json。
{
"mcpServers": {
"delve-mcp": {
"command": "/path/to/delve-mcp/build/index.js"
}
}
}可用工具
调试命令
debug- 调试当前目录或指定包中的 Go 包attach-通过 PID 附加到正在运行的进程**
exec**执行并调试预编译的二进制文件test-在当前包或指定包中调试测试core- 检查与可执行文件相关的核心转储文件dap- 启动调试适配器协议(DAP)服务器replay- 重放 rr 跟踪记录trace- 使用函数匹配来跟踪程序执行
控制命令
setBreakpoint- 设置带有可选条件的断点**
removeBreakpoint**删除现有断点**
continue**继续程序执行**
next**跳到下一行**
step**单步执行函数调用**
stepout**跳出当前函数variables- 列出当前范围内的局部变量evaluate-评估当前范围内的表达式
配置命令
version- 获取 Delve 版本信息setBackend- 配置调试后端(native、lldb、rr)configureLogging- 配置调试日志组件
使用示例
启动调试会话
// Debug current package
{ name: "debug" }
// Debug with specific package and build flags
{
name: "debug",
arguments: {
package: "./cmd/myapp",
buildFlags: "-tags=integration"
}
}管理断点
// Set a breakpoint
{
name: "setBreakpoint",
arguments: {
sessionId: "abc123",
file: "main.go",
line: 42,
condition: "count > 5"
}
}检查状态
// List variables
{
name: "variables",
arguments: {
sessionId: "abc123"
}
}
// Evaluate expression
{
name: "evaluate",
arguments: {
sessionId: "abc123",
expr: "myVar.Field"
}
}执照
麻省理工学院。
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dwisiswant0/delve-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server