dap_mcp
Model Context Protocol (MCP) server that interacts with a Debugger
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:
- Install the package from PyPI:
pip install dap-mcp
- Create a JSON configuration file (e.g., config.json) describing your debugger setup. Example is provided in the project’s README.
- Run the MCP server:
# Basic run with Python
python -m dap_mcp --config config.json
- Optional: If you have uv installed, you can run via uvx:
uvx dap-mcp@latest --config config.json
- 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
mcp-agent
Build effective agents using Model Context Protocol and simple workflow patterns
mcp-reddit
A Model Context Protocol (MCP) server that provides tools for fetching and analyzing Reddit content.
mcp-ical
A Model Context Protocol Server that allows you to interact with your MacOS Calendar through natural language.
mcp -odoo
A Model Context Protocol (MCP) server that enables AI assistants to securely interact with Odoo ERP systems through standardized resources and tools for data retrieval and manipulation.
lc2mcp
Convert LangChain tools to FastMCP tools
LLaMa -Streamlit
AI assistant built with Streamlit, NVIDIA NIM (LLaMa 3.3:70B) / Ollama, and Model Control Protocol (MCP).