DebugMCP logo

DebugMCP

Organization
microsoft

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

Publishermicrosoft
RepositoryDebugMCP
LanguageTypeScript
Forks
60
Stars
520
Available tools
0
Transport typestreamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    DebugMCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    520 stars and 60 forks from the linked repository.

DebugMCP (MCP Server) - Empowering AI Agents with Operational Debugging Capabilities

Let AI agents debug your code inside VS Code - set breakpoints, step through execution, inspect variables, and evaluate expressions. Works with Codex, GitHub Copilot, GitHub Copilot CLI, Claude Code, Cline, Cursor, Windsurf, Roo Code, and any MCP-compatible assistant. Compatible with any VS Code supported coding language.

License: MIT VS Code Version VS Marketplace

🚀 DebugMCP CLI is now available on npm! Debug directly from the terminal without requiring VS Code or any IDE at all by connecting AI coding agents to explicitly configured Debug Adapter Protocol (DAP) adapters. The debug adapter and target process run in the background. Install it with npm install --global debugmcp, then run debugmcp configure --agent copilot-cli. The CLI also installs the debug-live skill automatically. View the package on npm

⭐ If you find DebugMCP useful, please star the repo on GitHub! It helps others discover the project and motivates continued development.

📢 Developers Notice: This extension is maintained by ozzafar@microsoft.com and orbarila@microsoft.com. We welcome feedback and contributions to help improve this extension.

🎬 Watch DebugMCP in action — your AI assistant autonomously sets breakpoints, steps through code, and inspects variables directly in VS Code.

✨ What's New

2.4

  • Standalone DebugMCP CLI — install debugmcp from npm and give MCP-compatible agents direct access to explicitly configured DAP adapters without running VS Code. The CLI supports any language with a DAP adapter that communicates over stdio, configures supported agents, and installs the debug-live skill automatically.

2.2

  • Cross-agent debug-live skill install — the systematic debugging workflow ships as an Agent Skill and is now installed into the standard skills directories — ~/.agents/skills/ (the cross-agent location honored by skills-compatible harnesses, including VS Code agent mode) and ~/.copilot/skills/ when present — so it's discoverable everywhere instead of being copied next to each agent's config where nothing scans it (fixes #105, where VS Code never loaded the skill). The server also advertises MCP instructions and the start_debugging tool points at the skill for the full workflow.
  • Pause running programs — new pause_execution tool interrupts a freely-running program and stops at its current location, even with no breakpoint set (great for busy loops and embedded/bare-metal targets), so you can then inspect state or step from there.
  • Robust debugging via the VS Code Testing API — start_debugging with a testName uses the VS Code Testing API to discover and launch the test, producing consistent breakpoint hits inside individual test cases across language test runners (pytest, Jest/Vitest, Java, .NET, Go, etc.).

🚀 Quick Install

Install from VS Code Marketplace or use the direct link: vscode:extension/ozzafar.debugmcpextension

Table of Contents

Overview

DebugMCP is an MCP server that gives AI coding agents full control over the VS Code debugger. Instead of reading logs or guessing, your AI assistant can autonomously set breakpoints, launch debug sessions, step through code line by line, inspect variable values, and evaluate expressions — just like a human developer would. It runs 100% locally, requires zero configuration, and works out of the box with any MCP-compatible AI assistant.

Features

🔧 Tools

ToolDescriptionParameters
start_debuggingStart a debug session for a source code filefileFullPath (required)workingDirectory (required)testName (optional)configurationName (optional)
stop_debuggingStop the current debug sessionNone
step_overExecute the next line (step over function calls)None
step_intoStep into function callsNone
step_outStep out of the current functionNone
continue_executionContinue until next breakpointNone
pause_executionInterrupt a freely-running program and stop at its current location (no breakpoint needed)None
restart_debuggingRestart the current debug sessionNone
add_breakpointAdd a breakpoint at a specific line (optionally conditional)fileFullPath (required)line (required, 1-based)condition (optional)
add_logpointAdd a logpoint that logs a message (instead of pausing) when a line is reachedfileFullPath (required)line (required, 1-based)logMessage (required, {expr} interpolated)condition (optional)
remove_breakpointRemove a breakpoint from a specific linefileFullPath (required)line (required)
clear_all_breakpointsRemove all breakpoints at onceNone
list_breakpointsList all active breakpointsNone
list_variable_namesList names and types of variables in scope, without reading any valuesscope (optional: 'local', 'global', 'all')
get_variables_valuesGet the values of specifically named variables at the current execution pointvariableNames (required, e.g. ["user","response"])scope (optional: 'local', 'global', 'all')
evaluate_expressionEvaluate an expression in debug context; expandable children are listed by name and type without their valuesexpression (required)

Note: The MCP server exposes tools for debugger actions, while the procedural workflow guidance (when to debug, how to structure a root-cause investigation, language-specific quirks) lives in the companion Agent Skill. Tool descriptions stay terse and behavioral; the extension installs the debug-live skill into the standard skills directories (~/.agents/skills/, plus ~/.copilot/skills/ when present) so skills-compatible harnesses load the full workflow on demand. The server also advertises MCP instructions pointing agents at it before debugging.

🎯 Debugging Best Practices

DebugMCP follows systematic debugging practices for effective issue resolution:

  • Start with Entry Points: Begin debugging at function entry points or main execution paths
  • Follow the Execution Flow: Use step-by-step execution to understand code flow
  • Root Cause Analysis: Don't stop at symptoms - find the underlying cause

🛡️ Security & Reliability

  • Secure Communication: All MCP communications use secure protocols
  • Local Operation: The MCP server runs 100% locally with no external communications and requires no credentials
  • State Validation: Robust validation of debugging states and operations

Installation

Standalone CLI (preview)

The standalone host talks directly to explicitly configured DAP adapters and does not require VS Code. It never discovers, downloads, installs, or selects an adapter automatically.

Install the published package:

console
npm install --global debugmcp

For repository development, build and invoke the local bundle:

console
npm install
npm run package
node dist/debugmcp.js adapter add python --command "python -m debugpy.adapter"
node dist/debugmcp.js adapter validate python
node dist/debugmcp.js configure

Adapter registrations are stored in .debugmcp.json by default. Add --user to adapter add, adapter list, or adapter remove to use the per-user configuration. Project registrations override registrations with the same name in user configuration.

Language shorthands derive the DAP type and file extensions for python, csharp, dotnet, cpp, c, javascript, typescript, node, java, go, rust, ruby, php, swift, and dart. These are configuration conveniences, not a language support boundary. The command remains explicit so the selected environment determines which adapter installation is used. Languages without a shorthand provide --type and --extensions explicitly. Compiled-language registrations can provide the executable in --launch; values support ${workspaceFolder}, ${file}, ${fileDirname}, and ${fileBasenameNoExtension}.

The current CLI supports adapters that speak DAP over stdio. A registration can provide adapter-specific launch properties with --launch followed by a JSON object. If multiple registered adapters claim the same file extension, start_debugging.configurationName must identify the adapter to use. Test discovery remains host-specific; configure the adapter launch properties to run the required test command.

Adapter arguments beginning with -- can follow --args directly. Use a standalone -- after --args when an adapter argument has the same name as a DebugMCP option, for example --args -- --user.

debugmcp configure presents the same agent choices as the VS Code extension's setup popup and writes the standalone stdio command for every selected agent. In automation, repeat --agent <id> to bypass the terminal prompt, for example debugmcp configure --agent copilot-cli --agent codex. Each configuration has one canonical debugmcp entry, so configuring the CLI replaces an existing extension HTTP entry rather than registering both. The command also installs the bundled debug-live skill into the standard personal skills directories. Restart configured agents to discover it.

Use debugmcp status to inspect the GitHub Copilot CLI registration. The DebugMCP command configures only the standalone CLI. To use the interactive VS Code version, configure it through the DebugMCP extension's agent popup; the command line does not select or configure the extension.

Quick Install Options

Option 1: Direct Link (Fastest)

Option 2: VS Code Marketplace

Option 3: Within VS Code

  1. Open VSCode
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "DebugMCP"
  4. Click Install
  5. The extension automatically activates and registers as an MCP server

Verification

After installation, you should see:

  • DebugMCP extension in your installed extensions
  • MCP server automatically running on port 3001 (configurable)
  • Debug tools available to connected AI assistants

📝 Note: No additional debugging rule instructions are needed - the extension works out of the box.

💡 Tip: Enable auto-approval for all debugmcp tools in your AI assistant to create seamless debugging workflows without constant approval interruptions.

Quick Start

  1. Install the extension (see Installation)
  2. Open your project in VSCode
  3. Ask your AI to debug - it can now set breakpoints, start debugging, and analyze your code!

Supported AI Assistants

DebugMCP works with any MCP-compatible AI assistant. It auto-detects and offers to register itself with:

AssistantAuto-RegistrationManual Config
GitHub Copilot✅See config
GitHub Copilot CLI✅See config
Claude Code✅See config
Cline✅See config
Cursor✅See config
Codex✅See config
Windsurf✅See config
Roo Code✅See config
Antigravity✅See config
Any MCP-compatible assistant—See manual setup

Supported Languages

DebugMCP supports debugging for the following languages with their respective VSCode extensions:

LanguageExtension RequiredFile ExtensionsStatus
PythonPython.py✅ Fully Supported
JavaScript/TypeScriptBuilt-in / JS Debugger.js, .ts, .jsx, .tsx✅ Fully Supported
JavaExtension Pack for Java.java✅ Fully Supported
C/C++C/C++.c, .cpp, .cc✅ Fully Supported
GoGo.go✅ Fully Supported
Rustrust-analyzer.rs✅ Fully Supported
PHPPHP Debug.php✅ Fully Supported
RubyRuby.rb✅ Fully Supported
C#/.NETC#.cs, .csproj✅ Fully Supported

Configuration

MCP Server Configuration (Recommended)

The extension runs an MCP server automatically. It will pop up a message to auto-register the MCP server in your AI assistant.

You can also trigger the registration manually via the Command Palette:

  • DebugMCP: Show Agent Selection Popup

Manual MCP Server Registration (Optional)

🔄 Auto-Migration: If you previously configured DebugMCP with SSE transport, the extension will automatically migrate your configuration to the new Streamable HTTP transport on activation.

Cline

Add to your Cline settings or cline_mcp_settings.json:

json
{
  "mcpServers": {
    "debugmcp": {
      "type": "streamableHttp",
      "url": "http://localhost:3001/mcp",
      "description": "DebugMCP - AI-powered debugging assistant"
    }
  }
}

GitHub Copilot

Add to your VS Code settings (settings.json):

json
{
  "mcp": {
    "servers": {
      "debugmcp": {
        "type": "http",
        "url": "http://localhost:3001/mcp",
        "description": "DebugMCP - Multi-language debugging support"
      }
    }
  }
}

GitHub Copilot CLI

Add to ~/.copilot/mcp-config.json (${COPILOT_HOME}/mcp-config.json if COPILOT_HOME is set):

json
{
  "mcpServers": {
    "debugmcp": {
      "type": "http",
      "url": "http://localhost:3001/mcp",
      "tools": ["*"]
    }
  }
}

Claude Code

Register DebugMCP with Claude Code:

bash
claude mcp add --transport http --scope user debugmcp http://localhost:3001/mcp

Or add the equivalent configuration to ~/.claude.json (top-level mcpServers, for cross-project user-scope access — see the Claude Code MCP docs):

json
{
  "mcpServers": {
    "debugmcp": {
      "type": "http",
      "url": "http://localhost:3001/mcp"
    }
  }
}

Claude Desktop: Claude Desktop connects to local/remote HTTP MCP servers through Settings → Connectors → Add custom connector rather than a static config file — paste http://localhost:3001/mcp there. DebugMCP doesn't auto-register with Desktop for this reason.

Cursor

Add to Cursor's MCP settings:

json
{
  "mcpServers": {
    "debugmcp": {
      "type": "streamableHttp",
      "url": "http://localhost:3001/mcp",
      "description": "DebugMCP - Debugging tools for AI assistants"
    }
  }
}

Codex

Register DebugMCP with Codex:

bash
codex mcp add debugmcp --url http://localhost:3001/mcp

Or add the equivalent configuration to ~/.codex/config.toml (${CODEX_HOME}/config.toml if CODEX_HOME is set):

toml
[mcp_servers.debugmcp]
url = "http://localhost:3001/mcp"

Windsurf

Add to Windsurf's MCP settings (~/.windsurf/mcp_settings.json or workspace .windsurf/mcp_settings.json):

json
{
  "mcpServers": {
    "debugmcp": {
      "type": "streamableHttp",
      "url": "http://localhost:3001/mcp",
      "description": "DebugMCP - Debugging tools for AI assistants"
    }
  }
}

Roo Code

Add to Roo Code's MCP settings:

json
{
  "mcpServers": {
    "debugmcp": {
      "type": "streamableHttp",
      "url": "http://localhost:3001/mcp",
      "description": "DebugMCP - Debugging tools for AI assistants"
    }
  }
}

Antigravity

Add to Antigravity's MCP settings:

json
{
  "mcpServers": {
    "debugmcp": {
      "type": "streamableHttp",
      "url": "http://localhost:3001/mcp",
      "description": "DebugMCP - Debugging tools for AI assistants"
    }
  }
}

Extension Settings

Configure DebugMCP behavior in VSCode settings:

json
{
  "debugmcp.serverPort": 3001,
  "debugmcp.timeoutInSeconds": 180,
  "debugmcp.bindHost": ["127.0.0.1", "::1"]
}
SettingDefaultDescription
debugmcp.serverPort3001Port number for the MCP server
debugmcp.timeoutInSeconds180Timeout for debugging operations
debugmcp.bindHost["127.0.0.1", "::1"]Network interface(s) the HTTP server binds to. Accepts a string or array of strings. See Security model before changing.

Security model

DebugMCP exposes powerful debugger primitives (evaluate_expression, start_debugging, …) over an unauthenticated local HTTP endpoint. To keep that surface safe, the server enforces four controls:

  1. Loopback-only bind. The HTTP server binds to the IPv4 and IPv6 loopback addresses (127.0.0.1 and ::1) by default, so other hosts on your network cannot reach http://<your-ip>:3001/mcp. Binding both families ensures clients that resolve localhost to either family connect successfully. The debugmcp.bindHost setting (string or array of strings) lets you opt into a different interface (for example, when forwarding the port into a remote container), but doing so exposes the unauthenticated debugger to anything that can route to that address — do not point it at 0.0.0.0 or a LAN address on an untrusted network.
  2. Host / Origin header validation. Every request must carry a Host header naming a loopback address (localhost, 127.0.0.1, or [::1]); any port suffix in the Host must also match the server's listening port. Requests with any other Host — including those that arrive via DNS rebinding from a malicious webpage — are rejected with HTTP 403. The same loopback check is applied to the Origin header when present.
  3. Least-privilege variable inspection. get_variables_values requires an explicit variableNames list (max 50, no wildcards) and returns only those variables. It no longer dumps every variable in scope, which previously handed the agent unrelated process state that it never asked for. Use list_variable_names to discover what exists; that tool returns names and types only and never reads a value.
  4. Secret redaction on variable inspection. Values with credential-bearing names or values matching a known credential shape are replaced with <redacted: possible secret> before the response leaves the extension. The evaluated result returned by evaluate_expression is covered too. When get_variables_values or evaluate_expression expands a complex value, descendants are listed by name and type only. Use evaluate_expression with an exact descendant path when its value is needed. Recursive expansion is capped at 100 child fields total per response. Null-ish values (None, undefined, '') are never redacted so "my token is empty" bugs remain debuggable. Redaction is always on and cannot be turned off.

FAQ

DebugMCP works with any MCP-compatible AI assistant, including GitHub Copilot, GitHub Copilot CLI, Claude Code, Cline, Cursor, Codex, Windsurf, Roo Code, Antigravity, and others. If your assistant supports the Model Context Protocol, it can use DebugMCP. Claude Desktop can also connect via its Custom Connector UI (see Claude Code in the manual configuration section).

Yes. DebugMCP runs as a VS Code extension with extensionKind: workspace, so it activates in the remote environment where your code lives. The MCP server runs on localhost within that remote context.

No. DebugMCP automatically generates appropriate debug configurations based on the file's language/extension. If you have a launch.json, it will automatically pick the most relevant configuration.

No. DebugMCP runs 100% locally. The MCP server runs on localhost, and no code, variables, or debug data is sent to any external service. The AI assistant communicates with the MCP server entirely within your local machine.

Change the port in VS Code settings: "debugmcp.serverPort": 3002 (or any available port). Then update your AI assistant's MCP configuration to use the new port.

Yes. Pass the testName parameter to start_debugging to debug a specific test method. DebugMCP will configure the debug session to run and pause at breakpoints within that test.

Make sure DebugMCP is registered in your AI assistant's MCP settings. The extension should auto-detect and offer to register itself. If not, see the Manual MCP Server Registration section. Also enable auto-approval for DebugMCP tools for a smoother workflow.

Yes. DebugMCP supports .cs files and .csproj project files for C#/.NET debugging, including ASP.NET applications.

Troubleshooting

Common Issues

MCP Server Not Starting

  • Symptom: AI assistant can't connect to DebugMCP
  • Solution:
    • Check if port 3001 is available
    • Restart VSCode
    • Verify extension is installed and activated

Debug Session Not Stopping at Breakpoints

  • Symptom: Breakpoints are set but execution doesn't pause
  • Solution:
    • Ensure the correct file is being debugged
    • Check that the breakpoint line number is correct
    • Verify the relevant language debugger extension is installed

Another VS Code Window Takes Focus When Debugging Stops

  • Symptom: With multiple VS Code windows open, the window being debugged comes to the foreground when it hits a breakpoint or completes a step
  • Solution: Disable VS Code's native focus-on-break behavior in your user or workspace settings:
    json
    {
      "debug.focusWindowOnBreak": false,
      "debug.focusEditorOnBreak": false
    }
    debug.focusWindowOnBreak prevents the debugged window from taking operating-system focus. The optional debug.focusEditorOnBreak setting also prevents VS Code from moving focus into the stopped source editor. DebugMCP does not change these persistent preferences automatically.

Configuration Not Auto-Detected

  • Symptom: Extension doesn't prompt to register with your AI assistant
  • Solution:
    • Run DebugMCP: Show Agent Selection Popup from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
    • Manually add the configuration (see Manual MCP Server Registration)

How It Works

Architecture

AI Agent (Copilot/Cline/Cursor/Codex) → MCP/Streamable HTTP → DebugMCPServer → DebuggingHandler → VS Code Debug API

Launch Configuration Integration

The extension handles debug configurations intelligently:

  • Existing launch.json: If a .vscode/launch.json file exists, it will:

    • Search for a relevant configuration
    • Honor configurationName when explicitly provided by the agent
    • Support JSONC (JSON with comments and trailing commas)
  • Default Configuration: If configurationName is omitted, or if no matching named configuration is found, it creates an appropriate default configuration for each language based on file extension detection

Requirements

Development

To build the extension:

bash
npm install
npm run compile

To run linting:

bash
npm run lint

To run tests:

bash
npm test

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Security

Security vulnerabilities should be reported following the guidance at https://aka.ms/SECURITY.md. Please do not report security vulnerabilities through public GitHub issues.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

⭐ Support DebugMCP

If DebugMCP has helped you debug faster, please consider giving it a star on GitHub! Stars help the project gain visibility and attract contributors.

⭐ Star DebugMCP on GitHub

Star History

License

MIT License - See LICENSE for details

Use DebugMCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once DebugMCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP connects through a hosted MCP server URL in TypingMind.

Add an MCP server URL

Use this when DebugMCP is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for DebugMCP.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the DebugMCP connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the DebugMCP tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the DebugMCP tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use DebugMCP to help me with this task?
DebugMCP
Sure. I read it.
Here is what I found using DebugMCP.

Frequently asked questions

What is the DebugMCP MCP server used for?

DebugMCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use DebugMCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use DebugMCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use DebugMCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With DebugMCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect DebugMCP MCP to TypingMind?

DebugMCP can be connected in TypingMind by adding its hosted MCP server URL. This is useful when you want a remote MCP connection that is available from your TypingMind workspace.

What tools does DebugMCP MCP provide in TypingMind?

DebugMCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use DebugMCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If DebugMCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇