vscode-debug-mcp
Gives AI agents full control of VS Code's debugging engine — set breakpoints, launch/attach sessions, step through code, inspect call stacks and variables, and evaluate expressions in the paused frame.
README
vscode-debug-mcp
Let AI agents drive the VS Code debugger.
A two-part toolkit that gives coding agents (Claude Code, Cursor, Codex, or plain curl) full control of VS Code's debugging engine: set breakpoints, launch/attach sessions, step through code, inspect call stacks and variables, and evaluate expressions in the paused frame — all inside the editor the human is already looking at.
AI Agent ──(stdio MCP)──> MCP Server ──(HTTP 127.0.0.1:7779)──> VS Code Extension ──> vscode.debug API
└──────────────(or plain curl, no MCP config needed)──────────────┘
| Package | Where | What |
|---|---|---|
laststance.vscode-debug-mcp-bridge |
VS Code Marketplace / Open VSX | Extension exposing vscode.debug over a local HTTP bridge |
vscode-debug-mcp |
npm | Stdio MCP server translating MCP tool calls to bridge HTTP calls |
Why an editor bridge instead of a standalone DAP client? The debug session lives in the user's VS Code window: breakpoints are visible, the paused file opens at the exact line, and the human can take over the Run and Debug UI at any moment. Agent and human share one debugging surface. This powers live "feature tour" walkthroughs where an agent narrates newly written code while stepping through it in a real app.
Setup
1. Install the VS Code extension
From the Marketplace / Open VSX (search "Debug MCP Bridge"), or from a local build:
code --install-extension vscode-debug-mcp-bridge-0.1.0.vsix # cursor --install-extension works too
The bridge auto-starts when a window opens and binds 127.0.0.1:7779 (change via the debugMcpBridge.port setting). Command Palette: Debug MCP Bridge: Start Server / Stop Server.
Verify:
curl http://127.0.0.1:7779/health
# → {"status":"ok","version":"0.1.0"}
2. Configure the MCP server (optional)
Skip this if you prefer driving the bridge with plain HTTP — see Zero-config HTTP mode.
Claude Code (~/.claude.json or project .mcp.json):
{
"mcpServers": {
"vscode-debugger": {
"command": "npx",
"args": ["-y", "vscode-debug-mcp"]
}
}
}
Cursor (~/.cursor/mcp.json or project .cursor/mcp.json) uses the same shape. Codex (~/.codex/config.toml):
[mcp_servers.vscode-debugger]
command = "npx"
args = ["-y", "vscode-debug-mcp"]
Optional: set a custom bridge port with the VSCODE_DEBUG_PORT env var (default 7779).
MCP tools
| Tool | Description |
|---|---|
set_breakpoint |
Set a breakpoint (optional condition / hit count / logpoint) |
remove_breakpoint |
Remove breakpoints at a file:line |
list_breakpoints |
List all breakpoints |
launch_debug |
Start a debug session (inline config or launch.json name) |
stop_debugging |
Stop the active debug session |
debug_continue |
Continue execution |
debug_step_over |
Step over next statement |
debug_step_into |
Step into function call |
debug_step_out |
Step out of current function |
debug_pause |
Pause execution |
get_debug_state |
Get current state (inactive/running/stopped) |
get_call_stack |
Get call stack frames |
get_variables |
Get variables in scope |
evaluate_expression |
Evaluate an expression in the paused frame |
expand_variable |
Expand object/array children by variablesReference |
get_threads |
List active threads |
Zero-config HTTP mode
Everything the MCP server does is also reachable directly — useful for agents that can run shell commands but have no MCP configuration:
| Purpose | HTTP |
|---|---|
| Health check | GET /health |
| Set breakpoint | POST /breakpoint {"file":"<abs path>","line":N} (opt: condition, hitCondition, logMessage) |
| Remove breakpoint | DELETE /breakpoint {"file":"<abs path>","line":N} |
| List breakpoints | GET /breakpoints |
| Launch/attach | POST /debug/launch {"config":{...}} or {"configName":"<launch.json name>"} |
| Poll state | GET /state → {"state":"stopped","threadId":1,...} |
| Call stack | GET /debug/callstack |
| Variables | POST /debug/variables {} |
| Evaluate | POST /debug/evaluate {"expression":"..."} |
| Expand variable | POST /debug/expand {"variablesReference":N} |
| Continue / step | POST /debug/continue, /debug/stepOver, /debug/stepInto, /debug/stepOut, /debug/pause |
| Threads | GET /debug/threads |
| Detach | POST /debug/stop |
Example — attach to a running Chrome and break on a click handler:
curl -s -X POST http://127.0.0.1:7779/debug/launch -H "Content-Type: application/json" -d '{
"config": {
"type": "chrome", "request": "attach", "name": "agent attach",
"port": 9222, "webRoot": "/abs/path/to/project",
"urlFilter": "http://localhost:3000/*"
}
}'
curl -s -X POST http://127.0.0.1:7779/breakpoint -d '{"file":"/abs/path/src/App.tsx","line":42}'
curl -s http://127.0.0.1:7779/state # poll until "stopped"
Operational notes
- One window owns the port. The bridge binds
7779per VS Code window; with multiple windows open, the first to activate wins. Paused files open in the owning window. Find the owner withps -p $(lsof -t -iTCP:7779 -sTCP:LISTEN) -o command=(the workspace name appears in the process title), then stop/start the bridge via the Command Palette in the window you want. - Start the bridge before launching debug sessions. The DAP tracker only observes sessions created after the bridge is running. If state looks stale after IDE-driven steps, call
GET /stateto re-sync. - Single session (current limitation). Only the active debug session is tracked. Multi-session setups (e.g. Next.js server + client) follow the focused session — see TODO.md.
- The bridge listens on
127.0.0.1only and is never exposed externally.
Development
pnpm install # workspace root
pnpm typecheck # both packages
pnpm build # both packages
pnpm package # build the .vsix (vscode-extension/)
# E2E (requires a VS Code window with this repo open and the bridge running)
cd e2e && node e2e-test.mjs
Releasing
# VS Code Marketplace + Open VSX (PATs injected via 1Password)
pnpm publish:stores:dry-run
pnpm publish:stores
# npm (mcp-server)
pnpm publish:npm
.env.1password maps VSCE_PAT / OVSX_PAT to 1Password items (op run injects them at publish time). The npm publish uses your logged-in npm account (npm login first).
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.