dlc侧三轮
MCP服务器通过JSON-RPC API控制Delve调试器实例。
概述
这是一个模型上下文协议(MCP)服务器,它提供 set_breakpoint 用于在正在运行的Delve调试器会话中设置断点的工具。它通过TCP上的JSON-RPC与Delve通信 localhost:2345.
建筑
go build -o dlc-sidecar .用法
服务器使用stdio传输进行MCP通信。要将其与MCP客户端一起使用:
- 在无头模式下使用Delve启动Go应用程序:
dlv debug --headless --listen=localhost:2345 --api-version=2 ./your-app- 运行MCP服务器:
./dlc-sidecar- MCP服务器将公开
set_breakpoint工具具有以下参数:
- file (string,必填):源文件的绝对路径 - line (整数,必填):应设置断点的行号
工具:set_breakpoint
在Delve调试器中的指定文件和行处设置断点。
参数:
file:源文件的绝对路径(例如。,/path/to/your/main.go)line:行号(例如。,42)
退货:
{
"success": true,
"breakpoint": {
"id": 1,
"file": "/path/to/your/main.go",
"line": 42
},
"message": "Breakpoint set at /path/to/your/main.go:42 (ID: 1)"
}需求
- 转到1.24或更高版本
- 在以下位置运行Delve调试器实例
localhost:2345
依赖项
- -MCP服务器实现
