A VSCode extension that provides multi-language debugging capabilities and automatically exposes itself as an MCP (Model Context Protocol) server for integration with AI assistants.
- Multi-Language Debugging Controls: Start, stop, step over, step into, step out, continue, pause, and restart debugging sessions
- Breakpoint Management: Add, remove, and list breakpoints
- Variables Inspection: View local, global, and all variable scopes during debugging
- Launch Configuration Support: Uses existing launch.json configurations or creates appropriate defaults
- Automatic Registration: When the extension is installed, it automatically becomes available as an MCP server
- Full Debug Control: All debugging operations are accessible via MCP tools
- Self-Context Management: The server tracks the debugging state and consistently injects it to the agent context.
- No Additional Setup: No need to clone repositories or install separate servers
- Install the extension in VSCode, the extension will automatically activate itself as an MCP server.
- Configure the MCP server in your AI assistant's settings:
Note: No additional debugging rule instructions are needed - the extension works out of the box.
Tip: For efficient debugging sessions, it's recommended to enable auto-approval for all tools in your AI assistant to avoid interruptions during step-by-step debugging operations.
Add to your Cline settings or cline_mcp_settings.json:
{
"mcpServers": {
"debugmcp": {
"transport": "sse",
"url": "http://localhost:3001/sse"
}
}
}Add to your Copilot workspace settings (.vscode/settings.json):
{
"github.copilot.mcp.servers": {
"debugmcp": {
"type": "sse",
"url": "http://localhost:3001/sse"
}
}
}Add to Roo's MCP settings:
{
"mcp": {
"servers": {
"debugmcp": {
"type": "sse",
"url": "http://localhost:3001/sse"
}
}
}
}Once installed, the extension provides the following MCP tools:
-
start_debugging - Start a debug session for a source code file
- Parameters:
filePath(required),workingDirectory(optional),configurationName(optional) - Supports: Python, Node.js/JavaScript/TypeScript, Java, C#/.NET, C/C++, Go, Rust, PHP, Ruby
- Parameters:
-
stop_debugging - Stop the current debug session
-
step_over - Execute the next line of code (step over function calls)
-
step_into - Step into function calls
-
step_out - Step out of the current function
-
continue_execution - Continue execution until next breakpoint
-
restart_debugging - Restart the current debug session
-
add_breakpoint - Add a breakpoint at a specific line
- Parameters:
filePath(required),line(required)
- Parameters:
-
remove_breakpoint - Remove a breakpoint from a specific line
- Parameters:
filePath(required),line(required)
- Parameters:
-
list_breakpoints - List all active breakpoints
-
get_debug_status - Get the current debug session status
-
get_variables - Get variables and their values at the current execution point
- Parameters:
scope(optional: 'local', 'global', or 'all')
- Parameters:
-
evaluate_expression - Evaluate an expression in the current debug context (syntax depends on language)
- Parameters:
expression(required)
- Parameters:
The extension handles debug configurations intelligently:
-
Existing launch.json: If a
.vscode/launch.jsonfile exists, it will:- Search for a relevant configuarion
- 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 [Currenly Unsupported]: 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..)
This extension is designed to be minimal - it only starts the MCP server when activated. All debugging functionality is accessed through the MCP interface, not through VSCode commands.
Watch to see DebugMCP in action, showing the integration between the VSCode extension and an AI assistant using the MCP protocol.
The extension consists of several key components:
- Main Extension (
src/extension.ts) - Handles VSCode integration and command registration - MCP Server (
src/debugMCPServer.ts) - Implements the MCP protocol with full debugging capabilities - Debugging Handler (
src.debuggingHandler.ts) - Context and state management over the VS Code debugging capabilities. - Debugging Executor (
src/debuggingExecutor.ts) - Executes the debugging commands by using VS Code API directly.
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