A VSCode extension that provides comprehensive multi-language debugging capabilities and automatically exposes itself as an MCP (Model Context Protocol) server for seamless integration with AI assistants.
π’ Beta Version Notice: This is a beta version of DebugMCP maintained by ozzafar@microsoft.com and orbarila@microsoft.com. We welcome feedback and contributions to help improve this extension.
Install from VS Code Marketplace or use the direct link: vscode:extension/ozzafar.debugmcpextension
- Overview
- Features
- Installation
- Quick Start
- Supported Languages
- Configuration
- Troubleshooting
- Contributing
- License
DebugMCP bridges the gap between professional debugging and AI-assisted development by providing a powerful debugging interface that AI assistants can use to help you identify and fix issues in your code. DebugMCP enables AI assistants to perform sophisticated debugging operations on your behalf.
| Tool | Description | Parameters |
|---|---|---|
| get_debug_instructions | Get the debugging guide with best practices and workflow instructions | None |
| start_debugging | Start a debug session for a source code file | fileFullPath (required)workingDirectory (required)testName (optional)configurationName (optional) |
| stop_debugging | Stop the current debug session | None |
| step_over | Execute the next line (step over function calls) | None |
| step_into | Step into function calls | None |
| step_out | Step out of the current function | None |
| continue_execution | Continue until next breakpoint | None |
| restart_debugging | Restart the current debug session | None |
| add_breakpoint | Add a breakpoint at a specific line | fileFullPath (required)lineContent (required) |
| remove_breakpoint | Remove a breakpoint from a specific line | fileFullPath (required)line (required) |
| clear_all_breakpoints | Remove all breakpoints at once | None |
| list_breakpoints | List all active breakpoints | None |
| get_variables_values | Get variables and their values at current execution point | scope (optional: 'local', 'global', 'all') |
| evaluate_expression | Evaluate an expression in debug context | expression (required) |
Note: The
get_debug_instructionstool is particularly useful for AI clients like GitHub Copilot that don't support MCP resources. It provides the same debugging guide content that is also available as an MCP resource.
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
- 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
Option 1: Direct Link (Fastest)
- Click this link: vscode:extension/ozzafar.debugmcpextension
- Or copy and paste in your browser:
vscode:extension/ozzafar.debugmcpextension
Option 2: VS Code Marketplace
- Visit: https://marketplace.visualstudio.com/items?itemName=ozzafar.debugmcpextension
- Click "Install"
Option 3: Within VS Code
- Open VSCode
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "DebugMCP"
- Click Install
- The extension automatically activates and registers as an MCP server
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.
- Install the extension (see Installation)
- Open your project in VSCode
- Ask your AI to debug - it can now set breakpoints, start debugging, and analyze your code!
DebugMCP supports debugging for the following languages with their respective VSCode extensions:
| Language | Extension Required | File Extensions | Status |
|---|---|---|---|
| Python | Python | .py |
β Fully Supported |
| JavaScript/TypeScript | Built-in / JS Debugger | .js, .ts, .jsx, .tsx |
β Fully Supported |
| Java | Extension Pack for Java | .java |
β Fully Supported |
| C/C++ | C/C++ | .c, .cpp, .h, .hpp |
β Fully Supported |
| Go | Go | .go |
β Fully Supported |
| Rust | rust-analyzer | .rs |
β Fully Supported |
| PHP | PHP Debug | .php |
β Fully Supported |
| Ruby | Ruby | .rb |
β Fully Supported |
| C#/.NET | C# | .cs |
β Fully Supported |
The extension runs an MCP server automatically. It will pop up a message to auto-register the MCP server in your AI assistant.
π 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.
Add to your Cline settings or cline_mcp_settings.json:
{
"mcpServers": {
"debugmcp": {
"type": "streamableHttp",
"url": "http://localhost:3001/mcp",
"description": "DebugMCP - AI-powered debugging assistant"
}
}
}Add to your VS Code settings (settings.json):
{
"mcp": {
"servers": {
"debugmcp": {
"type": "http",
"url": "http://localhost:3001/mcp",
"description": "DebugMCP - Multi-language debugging support"
}
}
}
}Add to Cursor's MCP settings:
{
"mcpServers": {
"debugmcp": {
"type": "streamableHttp",
"url": "http://localhost:3001/mcp",
"description": "DebugMCP - Debugging tools for AI assistants"
}
}
}Configure DebugMCP behavior in VSCode settings:
{
"debugmcp.serverPort": 3001,
"debugmcp.timeoutInSeconds": 180
}| Setting | Default | Description |
|---|---|---|
debugmcp.serverPort |
3001 |
Port number for the MCP server |
debugmcp.timeoutInSeconds |
180 |
Timeout for debugging operations |
- Symptom: AI assistant can't connect to DebugMCP
- Solution:
- Check if port 3001 is available
- Restart VSCode
- Verify extension is installed and activated
The extension handles debug configurations intelligently:
-
Existing launch.json: If a
.vscode/launch.jsonfile exists, it will:- Search for a relevant configuration
- Use a specific configuration if found
-
Default Configuration: If no launch.json exists or no relevant config, it creates an appropriate default configurations for each language based on file extension detection
- VSCode with appropriate language extensions installed:
- Python: Python extension for
.pyfiles - JavaScript/TypeScript: Built-in Node.js debugger or JavaScript Debugger extension
- Java: Extension Pack for Java
- C#/.NET: C# extension
- C/C++: C/C++ extension
- Go: Go extension
- Rust: rust-analyzer extension
- PHP: PHP Debug extension
- Ruby: Ruby extension with debug support
- Python: Python extension for
- MCP-compatible AI assistant (Copilot, Cline, Roo..)
Watch to see DebugMCP in action, showing the integration between the VSCode extension and an AI assistant using the MCP protocol.
To build the extension:
npm install
npm run compileThis 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 vulnerabilities should be reported following the guidance at https://aka.ms/SECURITY.md. Please do not report security vulnerabilities through public GitHub issues.
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.
MIT License - See LICENSE for details
This extension was created by Oz Zafar, Ori Bar-Ilan and Karin Brisker.