Skip to content
Back to search

mcp-dap-server

MCP server to communicate with DAP servers allowing AI Agents the ability to debug live programs.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/go-delve--mcp-dap-server/badge.svg)](/listings/go-delve--mcp-dap-server)

HTML

<a href="/listings/go-delve--mcp-dap-server"><img src="/api/listings/go-delve--mcp-dap-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prerequisites

- Go 1.24.4 or later - A DAP-compatible debugger for your target language

Building from Source

git clone https://github.com/go-delve/mcp-dap-server
cd mcp-dap-server
go build -o bin/mcp-dap-server

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 216 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # MCP DAP Server
  2. A Model Context Protocol (MCP) server that provides debugging capabilities through the Debug Adapter Protocol (DAP). This server enables AI assistants and other MCP clients to interact with debuggers for various programming languages.
  3. ## Overview
  4. The MCP DAP Server acts as a bridge between MCP clients and DAP-compatible debuggers, allowing programmatic control of debugging sessions. It provides a comprehensive set of debugging tools that can be used to:
  5. - Start and stop debugging sessions
  6. - Set breakpoints (line-based and function-based)
  7. - Control program execution (continue, step in/out/over, pause)
  8. - Inspect program state (threads, stack traces, variables, scopes)
  9. - Evaluate expressions
  10. - Attach to running processes
  11. - Handle exceptions
  12. ## Demos
  13. - [Basic demo with multiple prompts](https://youtu.be/q0pNfhxWAWk?si=hzJWCyXnNsVKZ3Z4)
  14. - [Autonomous agentic debugging pt.1](https://youtu.be/k5Z51et_rog?si=Z7VZWK8QQ94Pzptu)
  15. - [Autonomous agentic debugging pt.2](https://youtu.be/8PcfLbU_EQM?si=I8y_RLjaWeT3B4I8)
  16. ## Features
  17. - **Unified Debug Launch**: Single `debug` tool handles source, binary, and attach modes
  18. - **Automatic Context**: Execution control tools return full state (location, stack, variables)
  19. - **Streamlined API**: 13 tools cover all debugging operations
  20. - **Breakpoint Management**: Set line and function breakpoints, run-to-cursor
  21. - **Full State Inspection**: Stack traces, scopes, and variables in one call
  22. - **Expression Evaluation**: Evaluate and modify variables in context
  23. - **Process Attachment**: Attach to running processes
  24. - **Disassembly Support**: View disassembled code at memory addresses
  25. ## Installation
  26. ### Prerequisites
  27. - Go 1.24.4 or later
  28. - A DAP-compatible debugger for your target language
  29. ### Building from Source
  30. ```bash
  31. git clone https://github.com/go-delve/mcp-dap-server
  32. cd mcp-dap-server
  33. go build -o bin/mcp-dap-server
  34. ```
  35. ## Usage
  36. ### Connecting via MCP
  37. The server uses stdio transport, allowing AI agents to spawn it on-demand. Configure your MCP client with the path to the binary.
  38. > [!IMPORTANT]
  39. > A debugger can launch programs, attach to processes, evaluate target code,
  40. > inspect secrets, and alter or terminate a debuggee. Run this server only for a
  41. > trusted, single-user MCP client under a least-privileged OS account. The stdio
  42. > server has no HTTP listener or multi-tenant authorization layer. Delve's
  43. > internal DAP socket is always bound to loopback.
  44. Persistent server logging is disabled by default. Set `MCP_DAP_LOG=1` to create
  45. a unique private log in the OS temporary directory. It is capped at 8 MiB and
  46. retained until manually deleted. Explicit protocol and GDB tool logs reject
  47. existing files; treat them as sensitive. GDB tool logs are written directly by
  48. GDB and are not size-capped.
  49. ### Example MCP Client Configuration
  50. This configuration works with [Gemini CLI](https://developers.google.com/gemini-code-assist/docs/use-agentic-chat-pair-programmer#configure-mcp-servers) and similar MCP clients:
  51. ```json
  52. {
  53. "mcpServers": {
  54. "dap-debugger": {
  55. "command": "mcp-dap-server",
  56. "args": [],
  57. "env": {}
  58. }
  59. }
  60. }
  61. ```
  62. ### Claude Code Configuration
  63. ```bash
  64. claude mcp add mcp-dap-server /path/to/mcp-dap-server
  65. ```
  66. ## Available Tools
  67. ### Session Management
  68. #### `debug`
  69. Start a debugging session. Supports four modes:
  70. - **source**: Compile and debug Go source code
  71. - **binary**: Debug a pre-compiled executable
  72. - **core**: Debug a core dump file
  73. - **attach**: Attach to a running process
  74. **Parameters**:
  75. - `mode` (string, required): One of 'source', 'binary', 'core', or 'attach'
  76. - `path` (string): Path to source file or binary (required for source/binary modes; optional for core mode with GDB, which can auto-detect it)
  77. In attach mode, `path` optionally names the target's executable, as seen
  78. from the debugger (for example `/proc/PID/exe`, or an unstripped copy of a
  79. stripped binary); without it the debugger discovers the executable from the
  80. process. With Delve, `path` must be a Go executable, and is used only by
  81. Delve versions that support the attach `program` field
  82. ([go-delve/delve#4462](https://github.com/go-delve/delve/pull/4462));
  83. older releases ignore it.
  84. - `args` (array): Arguments to pass to the program
  85. - `coreFilePath` (string): Path to core dump file (required for core mode)
  86. - `processId` (number): Process ID (required for attach mode). In core mode
  87. with GDB, optionally the PID of the live process the core was taken from.
  88. On Linux, GDB then reads the target's executable and shared libraries
  89. through `/proc/PID/root`, so a sidecar or toolbox container that shares the
  90. target's PID namespace finds the target's own files.
  91. - `breakpoints` (array): Breakpoints to set before running (file:line or function name)
  92. - `stopOnEntry` (boolean): Stop at program entry point. In attach mode, keep the
  93. process stopped where it was attached instead of resuming it. Defaults to
  94. `true` when no `breakpoints` are given, for every mode.
  95. - `port` (number): optional numeric Delve port (`0` chooses an ephemeral
  96. loopback port; external bind addresses are not accepted)
  97. Returns full context (location, stack trace, variables) when stopped.
  98. #### `stop`
  99. End the debugging session. Terminates the debuggee and stops the debugger.
  100. #### `restart`
  101. Restart the debugging session with optional new arguments.
  102. - **Parameters**:
  103. - `arguments` (array, optional): New program arguments
  104. ### Breakpoints
  105. #### `breakpoint`
  106. Set a breakpoint at a file:line location or on a function.
  107. - **Parameters** (one of):
  108. - `file` (string) + `line` (number): Source file and line number
  109. - `function` (string): Function name
  110. #### `clear-breakpoints`
  111. Remove breakpoints from a file or clear all breakpoints.
  112. - **Parameters**:
  113. - `file` (string, optional): Clear breakpoints in this file
  114. - `all` (boolean, optional): Clear all breakpoints
  115. ### Execution Control
  116. #### `continue`
  117. Continue program execution. Optionally run to a specific location.
  118. - **Parameters**:
  119. - `to` (object, optional): Run-to-cursor target (file+line or function)
  120. Returns full context when stopped.
  121. #### `step`
  122. Step through code execution.
  123. - **Parameters**:
  124. - `mode` (string, required): One of 'over', 'in', or 'out'
  125. Returns full context at new location.
  126. #### `pause`
  127. Pause program execution.
  128. - **Parameters**:
  129. - `threadId` (number): Thread ID to pause
  130. ### State Inspection
  131. #### `context`
  132. Get full debugging context including current location, stack trace, and all variables.
  133. - **Parameters**:
  134. - `threadId` (number, optional): Thread ID
  135. - `frameId` (number, optional): Stack frame ID
  136. #### `evaluate`
  137. Evaluate an expression in the current debugging context.
  138. - **Parameters**:
  139. - `expression` (string): Expression to evaluate
  140. - `frameId` (number, optional): Frame context
  141. - `context` (string, optional): Evaluation context ('watch', 'repl', 'hover')
  142. #### `set-variable`
  143. Modify a variable's value in the debugged program.
  144. - **Parameters**:
  145. - `variablesReference` (number): Variables reference from context
  146. - `name` (string): Variable name
  147. - `value` (string): New value
  148. ### Program Information
  149. #### `info`
  150. Get program metadata.
  151. - **Parameters**:
  152. - `type` (string, required): One of 'sources' or 'modules'
  153. #### `disassemble`
  154. Disassemble code at a memory address.
  155. - **Parameters**:
  156. - `memoryReference` (string): Memory address
  157. - `instructionOffset` (number, optional): Offset from address
  158. - `instructionCount` (number): Number of instructions to disassemble
  159. ## Contributing
  160. Contributions are welcome! Please feel free to submit a Pull Request.
  161. ## License
  162. MIT
  163. ## Acknowledgments
  164. - Built with the [Model Context Protocol SDK for Go](https://github.com/modelcontextprotocol/go-sdk)
  165. - Uses the [Google DAP implementation for Go](https://github.com/google/go-dap)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.