Get the FREE Ultimate OpenClaw Setup Guide →

dap_mcp

Model Context Protocol (MCP) server that interacts with a Debugger

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio kashuncheng-dap_mcp python -m dap_mcp --config config.json

How to use

dap-mcp is a Python-based MCP server that specializes in managing Debug Adapter Protocol (DAP) sessions within the Model Context Protocol framework. It exposes a set of tools to control and inspect a debugging session, including launching the debuggee, setting and removing breakpoints, continuing execution, stepping through code, evaluating expressions, changing stack frames, and viewing source code around specific lines. The MCP layer enables efficient context management for large language models by standardizing interactions with the debugger and providing XML-rendered outputs for client integrations. To use it, prepare a configuration file that describes the debugger type (e.g., debugpy or lldb-dap) and how to launch the debugger, then start the server with the configured file. The server will expose the available tools through the MCP interface, allowing clients to perform debugging operations in a consistent, device- and debugger-agnostic way.

How to install

Prerequisites:

  • Python 3.10 or higher
  • Optional: uv (uvx) for running the server

Install and run:

  1. Install the package from PyPI:
pip install dap-mcp
  1. Create a JSON configuration file (e.g., config.json) describing your debugger setup. Example is provided in the project’s README.
  2. Run the MCP server:
# Basic run with Python
python -m dap_mcp --config config.json
  1. Optional: If you have uv installed, you can run via uvx:
uvx dap-mcp@latest --config config.json
  1. Point your MCP clients to the running server to interact with the debugging tools.

Additional notes

Configuration tips:

  • The configuration file describes the debugger type (e.g., debugpy, lldb) and paths to the debugger and source directories. You can include module, python interpreter, working directory, and other debugger-specific settings as shown in the example.
  • The server supports tools such as launch, set_breakpoint, remove_breakpoint, list_all_breakpoints, continue_execution, step_in, step_out, next, evaluate, change_frame, view_file_around_line, and terminate.
  • If you encounter issues connecting to a debugger, verify that the debugger executable paths and arguments are correct and that the configured source directories exist.
  • When using uvx, ensure you have uv installed and accessible in your environment. The uvx command in the README demonstrates how to run the package with UV’s runtime.
  • The MCP layer will render tool outputs in XML for client consumption; ensure your MCP client can parse and render XML responses.

Related MCP Servers

Sponsor this space

Reach thousands of developers