DAP-MCP调试协议服务器

DAP-MCP调试协议服务器

实现与调试器交互的模型上下文协议(MCP)服务器,优化大型语言模型的调试工作流。

快速入门

安装

确保已安装 Python 3.10 或更高版本。

通过 pip 安装:

pip install dap-mcp python -m dap_mcp --config config.json

或者使用 uv:

uvx dap-mcp@latest --config config.json

配置

创建一个 JSON 配置文件,例如 config.json

{ "type": "debugpy", "debuggerPath": "/path/to/python", "debuggerArgs": ["-m", "debugpy.adapter"], "sourceDirs": ["/path/to/source/code"] }

常用功能

  • 启动调试:launch
  • 设置断点:set_breakpoint
  • 继续执行:continue_execution
  • 查看源码:view_file_around_line

更多工具和详细说明请参考文档。