MCP Catalogs
首页

dap_mcp

by KashunCheng·40·综合分 42

DAP-MCP 通过标准化 MCP 协议实现 LLM 与调试器的交互,提供断点和执行控制等调试功能。

developer-toolsai-llmops-infra
6
Forks
1
活跃 Issue
8 个月前
最近提交
2 天前
收录于

概述

dap-mcp 是一个用 Python 实现的模型上下文协议(MCP)服务器,它连接大型语言模型与调试适配器。该服务器提供了一套控制调试会话的工具,包括设置和删除断点、控制执行流(继续、进入/跳出/下一步)、评估表达式、更改堆栈帧和查看源代码。通过灵活的 JSON 配置系统,该服务器支持多种调试适配器(如 debugpy 和 lldb),使其能够适应各种调试环境。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:AI 辅助调试,语言模型可设置断点和控制执行流程
:基于代码分析由 LLM 触发的自动化调试工作流
:直接调试器访问受限时通过 LLM 界面进行远程调试
:dap-mcp 支持哪些调试器?
:如何添加对新调试器的支持?

什么时候选它

当您需要 AI 辅助调试工作流且团队使用 Python (debugpy) 或 lldb 调试器时,选择 dap-mcp。

什么时候不要选它

如果您使用尚不支持的其他调试器,或需要超出 MCP 协议支持的更全面 IDE 集成,请避免使用。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • launch

    Launch the debuggee program.

  • set_breakpoint

    Set a breakpoint at a specified file and line (with an optional condition).

  • remove_breakpoint

    Remove a breakpoint from a specified file and line.

  • list_all_breakpoints

    List all breakpoints currently set in the debugger.

  • continue_execution

    Continue program execution after hitting a breakpoint.

  • step_in

    Step into a function call.

  • step_out

    Step out of the current function.

  • next

    Step over to the next line of code.

  • evaluate

    Evaluate an expression in the current debugging context.

  • change_frame

    Switch to a different stack frame.

  • view_file_around_line

    View source code around a specified line.

  • terminate

    Terminate the debugging session.

可对比工具

vscode-mcpdebugpylldb-dap

安装

安装

  1. 安装 dap-mcp 包:

``bash pip install dap-mcp ``

  1. 创建配置文件(如 config.json)并设置您的调试器参数
  1. 运行服务器:

``bash python -m dap_mcp --config config.json # 或使用 uv uvx dap-mcp@latest --config config.json ``

Claude Desktop 配置

添加到您的 claude_desktop_config.json 中:

{
  "mcpServers": {
    "dap-debugger": {
      "command": "python",
      "args": ["-m", "dap_mcp"],
      "env": {
        "DAP_MCP_CONFIG": "/path/to/config.json"
      }
    }
  }
}

FAQ

dap-mcp 支持哪些调试器?
目前 dap-mcp 通过调试器适配器协议支持 debugpy 和 lldb。其架构设计可扩展,允许通过创建新的配置类来支持额外的调试器。
如何添加对新调试器的支持?
要添加对新 DAP 服务器的支持,请在 `dap_mcp/config.py` 中创建一个扩展基础 `DAPConfig` 类的新配置类。定义一个唯一的类型值和该调试器特有的任何附加设置,然后更新调试器特定配置的联合类型。

dap_mcp 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。