fyuuki0jp/vscode-debugger-mcp
If you are the rightful owner of vscode-debugger-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The VSCode Debugger MCP Server is an extension that integrates Model Context Protocol (MCP) capabilities into the VSCode debugger, allowing for enhanced debugging control and automation.
set_breakpoint
Set a breakpoint at a specific line in a file.
remove_breakpoint
Remove a breakpoint at a specific line.
evaluate_expression
Evaluate an expression in the current debug context.
list_debug_configurations
List all available debug configurations from launch.json files.
start_debugging
Start a debugging session.
stop_debugging
Stop the current debugging session.
get_debug_status
Get the current debug status including active sessions and breakpoints.
step_debugger
Control debugger stepping during an active debug session.
VSCode Debugger MCP Server
VSCode extension that provides an MCP (Model Context Protocol) server for debugging integration.
Features
This extension provides MCP tools for controlling VSCode's debugger:
- Breakpoint Management: Set and remove breakpoints in your code
- Expression Evaluation: Evaluate expressions during debug sessions
- Debug Configuration: List available debug configurations from launch.json
- Session Control: Start and stop debugging sessions
- Step Execution: Control debugger stepping (step over, into, out, continue, pause)
- Status Monitoring: Get current debug status including active sessions and breakpoints
MCP Tools
set_breakpoint
Set a breakpoint at a specific line in a file. Supports both absolute and relative paths.
{
"path": "src/index.js", // relative to workspace
"line": 42,
"condition": "i > 10" // optional
}
remove_breakpoint
Remove a breakpoint at a specific line. Supports both absolute and relative paths.
{
"path": "src/index.js", // relative to workspace
"line": 42
}
evaluate_expression
Evaluate an expression in the current debug context.
{
"expression": "myVariable.someProperty",
"frameId": 0 // optional
}
list_debug_configurations
List all available debug configurations from launch.json files.
start_debugging
Start a debugging session.
{
"configName": "Run Extension" // optional
}
stop_debugging
Stop the current debugging session.
get_debug_status
Get the current debug status including:
- Active session information
- Available threads and active thread ID
- Stack frames (when paused)
- Breakpoints with relative paths
Example response:
{
"isActive": true,
"isPaused": true,
"activeSession": {
"id": "1",
"name": "Launch Program",
"type": "node"
},
"threads": [
{ "id": 1, "name": "main" }
],
"activeThreadId": 1,
"stackFrames": [
{
"id": 1,
"name": "myFunction",
"source": { "path": "src/index.js", "name": "index.js" },
"line": 42,
"column": 5
}
],
"breakpoints": [...]
}
step_debugger
Control debugger stepping during an active debug session.
{
"type": "stepOver", // stepOver, stepInto, stepOut, continue, pause
"threadId": 1 // optional - defaults to active thread
}
Note: You can get the thread ID from get_debug_status
. If not specified, the debugger will use the currently active thread.
Communication
The extension runs an SSE (Server-Sent Events) server on http://localhost:6010/sse
for MCP client communication.
Endpoints
GET /sse
- SSE connection endpointPOST /sse
- Send MCP requestsGET /health
- Health check endpoint
Development
- Clone the repository
- Run
npm install
- Open in VSCode
- Press
F5
to run the extension in a new Extension Development Host window
Building the Extension
Standard Build
npm run build
This creates vscode-debugger-mcp-0.0.1.vsix
file.
Optimized Bundle Build
npm run package-bundle
This creates a webpack-bundled version for better performance.
Available Scripts
npm run compile
- Compile TypeScript to JavaScriptnpm run watch
- Watch mode compilationnpm run lint
- Run ESLintnpm run package
- Create .vsix packagenpm run build
- Compile and packagenpm run webpack
- Bundle with webpacknpm run package-bundle
- Bundle and package
Installation
- Build the extension using one of the methods above
- In VSCode, go to Extensions view
- Click the "..." menu and select "Install from VSIX..."
- Select the generated
.vsix
file
Usage
- The MCP server starts automatically when the extension activates
- Connect your MCP client to
http://localhost:6010/sse
- Send JSON-RPC 2.0 requests to control the debugger
Commands
Start MCP Debug Server
- Manually start the serverStop MCP Debug Server
- Stop the server- Click the status bar item to toggle the server
Requirements
- VSCode 1.80.0 or higher
- Node.js 16.x or higher
License
MIT License - see file for details.