microsoft/DebugMCP

Gift your VS Code agent a real debugger: breakpoints, stepping, inspection.

DebugMCP – Let AI agents control the VS Code debugger

What it is – DebugMCP is a Microsoft‑maintained VS Code extension (and a companion CLI) that runs a small MCP (Multi‑Chat‑Protocol) server locally. The server exposes the full set of VS Code debugging actions (start/stop, step, breakpoints, variable inspection, expression evaluation, etc.) as MCP tools. Any AI coding assistant that understands MCP – e.g. GitHub Copilot, Claude Code, Codex, Cursor, Cline and others – can call those tools and debug your program exactly the way a human would, without you having to write prompts that parse logs.

Why it matters – Modern AI pair‑programmers can suggest fixes, but they still lack direct access to a running debugger. DebugMCP bridges that gap, giving agents the ability to:

  • launch a debug session for a file or test,
  • set breakpoints (including conditional ones) and log‑points,
  • pause a running process on‑the‑fly,
  • step over/into/out, continue, restart, and stop,
  • query variable names and values, and
  • evaluate arbitrary expressions in the current debug context.

All of this happens locally, with no network traffic and no credentials, keeping the powerful debugger primitives safe.


Key components

Component What it does
VS Code extension Starts the MCP server on http://localhost:3001/mcp, registers the tools, and auto‑registers with supported AI assistants.
DebugMCP CLI (npm package) Provides the same MCP server without VS Code. It talks directly to any Debug Adapter Protocol (DAP) adapter that speaks over stdio, making it usable in headless CI or remote containers.
debug-live Agent Skill A reusable skill package (installed into ~/.agents/skills/ or ~/.copilot/skills/) that contains the higher‑level workflow (when to start debugging, how to investigate, language‑specific tips).

How it works (high‑level)

  1. Server start – When the extension activates (or the CLI is run), it launches an HTTP MCP server bound to the loopback interface.
  2. Tool registration – The server advertises a set of tools (e.g., start_debugging, add_breakpoint, evaluate_expression). Each tool has a JSON schema describing required parameters.
  3. Agent call – An AI assistant that supports MCP sends a request like {"tool":"add_breakpoint","params":{"fileFullPath":"/src/app.py","line":42}}.
  4. Action execution – DebugMCP forwards the request to VS Code’s built‑in Debug Adapter (or to a standalone DAP adapter when using the CLI) and returns the result to the agent.
  5. Skill guidance – The optional debug-live skill can be invoked by the agent to get a step‑by‑step debugging plan, ensuring systematic root‑cause analysis.

Quick start (VS Code)

  1. Install DebugMCP from the VS Code Marketplace (or via the vscode: link).
  2. Open a project and open the Command Palette → DebugMCP: Show Agent Selection Popup.
  3. Choose the AI assistant you want to enable (e.g., Copilot, Claude Code).
  4. Ask the assistant to debug a file or test; it will automatically call the MCP tools.

Quick start (CLI)

npm install --global debugmcp          # install the CLI
debugmcp configure --agent copilot-cli  # register the agent you want to use
# start the server (runs in background)
debugmcp start

Now any MCP‑compatible agent can talk to http://localhost:3001/mcp.


Supported languages & adapters

The extension works with any language that has a VS Code Debug Adapter Protocol implementation. Out‑of‑the‑box support includes Python, JavaScript/TypeScript, Java, C/C++, Go, Rust, PHP, Ruby, and C#/.NET. The CLI can be pointed at any DAP adapter that communicates over stdio (e.g., debugpy for Python, lldb-vscode for C/C++, java-debug for Java).


Security model

  • The server binds only to 127.0.0.1 and ::1 by default – it is unauthenticated but not reachable from the network.
  • Changing debugmcp.bindHost to a non‑loopback address is possible (useful for container forwarding) but exposes the debugger to anyone who can reach that address.
  • All requests are validated; malformed or out‑of‑bounds operations are rejected.

Who should use it

  • Developers who rely on AI pair‑programmers and want the assistant to actually step through code.
  • Teams building custom AI agents that need deterministic debugging capabilities.
  • Researchers exploring autonomous code repair or self‑debugging LLMs.

Where to find more

  • GitHub repo – https://github.com/microsoft/DebugMCP (issues, source, contribution guide)
  • VS Code Marketplace – install directly from VS Code.
  • npm package – npm install -g debugmcp for the CLI.
  • Demo GIF – shows an AI assistant setting breakpoints and inspecting variables.

TL;DR

DebugMCP turns the VS Code debugger into an MCP‑exposed service that AI agents can call programmatically. It works both as a VS Code extension and as a headless CLI, supports all major languages with DAP adapters, and ships with a reusable debug-live skill that guides agents through systematic debugging. Install it, register your AI assistant, and let the model debug your code just like a human would.

Related

  • Project
  • Project
  • Project
  • Project
  • Project