MCP Debugger
Use it as a headless MCP debugger to launch or attach to running programs, control execution, and inspect live debug state across 10 languages plus a mock adapter.
Create, list, and close debug sessions; launch scripts or supported tests, restart with breakpoints re-applied, attach by port/PID/adapter URI, and detach without terminating.
Debug Python, JavaScript/TypeScript, Ruby, Rust, Go, Java, .NET/C#, C/C++, COBOL, Dart/Flutter, and mock; list supported languages and mode availability.
Set, list, remove, and clear breakpoints by line, function, or source content; use conditions, expected content checks, logpoints, and Java suspend policies.
Step over/into/out, continue, pause, and block on
wait_for_stop, including pending/running states.Inspect threads, stack traces, scopes, variables, local variables, and evaluate expressions that can read or modify program state.
Read source context and buffered stdout/stderr/console output with cursor-based pagination.
Expose a read-only DAP mirror endpoint for IDE inspection, then close it.
Configure launch/attach options such as stop-on-entry, just-my-code, exception break modes, source mapping, timeouts, adapter config, dry-run launch checks, and pytest test-runner presets.
Hot-reload Flutter apps or redefine Java classes while preserving program state where supported.
Enables step-through debugging for JavaScript applications with tools for managing breakpoints, stack traces, and variable scopes.
Supports debugging of Node.js applications, providing tools to control execution and inspect program state through the Debug Adapter Protocol.
Provides debugging capabilities for Python code, including setting breakpoints, inspecting variables, and stepping through execution using debugpy.
Supports debugging Rust programs and Cargo projects, enabling variable inspection and source context tracking via CodeLLDB.
Provides debugging support for TypeScript projects, allowing for interactive code execution and inspection within the MCP environment.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Debugger debug this Python script and show me the variables at line 15"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-debugger
A headless, agentic debugger over MCP — let your AI agents debug running programs in ten languages.
🎯 Overview
mcp-debugger is a Model Context Protocol (MCP) server that exposes step-through debugging as structured tool calls. It lets AI agents set breakpoints, inspect variables, evaluate expressions, and step through running programs across ten languages — driving real language debuggers through the Debug Adapter Protocol (DAP).
No IDE required. mcp-debugger runs anywhere Node.js runs: CI runners, Docker containers, Kubernetes pods, SSH boxes, and the sandboxes that cloud coding agents live in. It's the debugger for where IDEs can't go.
When to use mcp-debugger vs an IDE-bound debug server
Microsoft's DebugMCP exposes VS Code's debugger over MCP and is a good choice when your agent works inside a running VS Code. The two projects make different structural trade-offs:
mcp-debugger | microsoft/DebugMCP | |
Runs headless (CI, containers, k8s, cloud agents) | ✅ standalone Node process | ❌ requires a running VS Code |
Transports | stdio + Streamable HTTP | Streamable HTTP (localhost) |
Distribution | npx, npm, Docker image | VS Code Marketplace extension |
Remote attach without an IDE | ✅ debugpy / rdbg / JDWP, incl. pods via port-forward | ❌ |
Per-session process isolation | ✅ one proxy process per session | shares the VS Code instance |
Java hot-swap and Flutter hot reload ( | ✅ | ❌ |
Debuggee output as subscribable MCP resource | ✅ | ❌ |
In-IDE debugging UX alongside the agent | ✅ read-only IDE mirror ( | ✅ native |
Logpoints without pausing (prod-safe value watching) | ✅ via VS Code | |
Content/function-addressed breakpoints ( | ✅ agent-native addressing that survives edits | — |
Secret redaction on by default | ✅ variable/evaluate/output masking + least-privilege mode | — |
Kubernetes ephemeral debug sidecar (native attach-by-PID) | ❌ | |
C/C++ | ✅ via CodeLLDB (launch + attach-by-PID) | ✅ via VS Code extensions |
COBOL | ✅ via GnuCOBOL + CodeLLDB (launch + attach-by-PID, COBOL-shaped variables) | — |
Dart/Flutter | ✅ via the SDK's own debug adapters (launch + attach by VM-service URI, or by | — |
PHP | ❌ | ✅ via VS Code extensions |
Languages | Python, JS/TS, Ruby, Rust, Go, Java, .NET, C/C++, COBOL, Dart/Flutter | Python, JS/TS, Ruby, Rust, Go, Java, .NET, C/C++, PHP |
If your agent runs in a terminal, a pipeline, or a cloud sandbox — or needs to attach to a process on another machine — you want mcp-debugger.
🆕 v0.26.0 — Dart and Flutter debugging lands (the SDK's own debug adapters: Dart programs and tests, Flutter apps and tests on desktop, web, Android and the iOS simulator, hot reload and hot restart), every stop answer carries a snapshot of the exception, top frames and locals (a repeated stop reports only what changed),
wait_for_stopblocks until the next stop instead of polling, and one-call failing-test debugging for pytest pauses at the failing assert with no breakpoint set. Also new: one launch contract for every language (a short hold, thenpending: true),dryRunSpawnas a side-effect-free query,hot_reload(replacingredefine_classes, kept as a deprecated alias), Streamable HTTP spec conformance checked in CI, and host/Docker build caches that no longer collide. See the CHANGELOG for the full release history.
Related MCP server: cdp-tools-mcp
✨ Key Features
🌐 Multi-language support – Clean adapter pattern for any language
🐍 Python debugging via debugpy – Full DAP protocol support
💎 Ruby debugging via rdbg – Launch and attach workflows, including remote attach to containers and Kubernetes pods
🟨 JavaScript (Node.js) debugging via js-debug – VSCode's proven debugger
🦀 Rust debugging via CodeLLDB – Debug Rust & Cargo projects (Linux/macOS; Windows needs the GNU toolchain — see Rust on Windows)
🐹 Go debugging via Delve – Full DAP support for Go programs
☕ Java debugging via JDI bridge – Launch and attach modes with JDK 21+
🔷 .NET/C# debugging via netcoredbg – Debug .NET applications with full DAP support
⚙️ C/C++ debugging via CodeLLDB – Launch prebuilt binaries or lone source files (auto-compiled), attach by PID; core dumps and gdbserver/rr targets via config pass-through
🧮 COBOL debugging via GnuCOBOL + CodeLLDB – Launch
.cob/.cblsources (auto-compiled withcobc) or prebuilt executables, attach by PID; WORKING-STORAGE / LOCAL-STORAGE / LINKAGE scopes with DISPLAY, COMP, COMP-3 and 88-level values decoded, breakpoints in copybooks, statement-granular stepping, and a pause on libcob runtime errors (the S0C7/SSRANGE analogues) — built for mainframe-to-GnuCOBOL migrations (guide)🐦 Dart/Flutter debugging via the SDK's own debug adapters – Launch Dart programs and
package:testfiles (dart debug_adapter) or Flutter apps and tests (flutter debug-adapter), the runner auto-detected frompubspec.yamland the program path; attach to a running VM by service URI or service-info file; conditional breakpoints, logpoints,Unhandled/Allexception filters,noDebug. Nothing is vendored — the Dart or Flutter SDK on the machine is the debugger. Flutter runs on Windows, macOS and Linux desktops, in Chrome or Edge, on Android emulators and devices and on the iOS simulator, withhot_reloadand a hotrestart_debuggingonce the app has started; an app on an Android device attaches bydeviceIdalone (guide)🧪 Mock adapter for testing – Test without external dependencies
🛰️ Out-of-IDE & remote attach – Attach over host/port to a process on another machine or inside a container (Python via debugpy, Ruby via rdbg, JavaScript via the V8 inspector, Java via JDWP, Dart/Flutter via the VM-service URI) with source-path mapping, or by PID for native code (C/C++, COBOL) and for a local Node.js process, whose inspector mcp-debugger opens for you (JavaScript). Python and Ruby attach direct-connect — the debug engine already runs inside the target, so no local Python or Ruby is needed; JavaScript, Java, .NET, C/C++, COBOL and Dart/Flutter spawn a local adapter instead; of those, only Java (a JDK), .NET (netcoredbg) and Dart/Flutter (the Dart or Flutter SDK, whose own debug adapter does the work) need a toolchain you install, since the JavaScript, C/C++ and COBOL debug engines ship with the package.
list_supported_languagesreports per-mode availability with reasons🎯 Breakpoints that survive edits – Address by content (
statement: "total = sum(prices)"), by symbol (function: "main"), or assert line content withexpectedContent; anchors re-resolve acrossrestart_debuggingand weak matches warn loudly🪵 Logpoints –
set_breakpointwithlogMessage: "x={x}"streams interpolated values intoget_outputwithout pausing — prod-safe value watching on hot paths🧰 Full breakpoint lifecycle –
list_breakpoints/remove_breakpoint/clear_breakpointswork live mid-run;restart_debuggingrelaunches with the same config and re-applies everything in one call📡 Buffered program output –
get_outputreturns debuggee stdout/stderr with a cursor, and each session exposes its transcript as a subscribable MCP resource💥 Crash-state debugging by default – Launch sessions pause on uncaught exceptions with stack and locals live (
breakOnExceptions; exception class/message surfaced vialastStop)🪞 Read-only IDE mirror –
expose_sessionopens a loopback, token-gated DAP endpoint so a human's IDE can inspect the agent's live session without taking control☸️ Kubernetes debugging – port-forward attach for interpreted runtimes,
kubectl debug --target+ attach-by-PID for native processes (recipe, turnkey manifests)🔌 STDIO and Streamable HTTP transports – Works with any MCP client
📦 Zero-runtime dependencies – Self-contained bundles via esbuild + tsup
⚡ npx ready – Run directly with
npx @debugmcp/mcp-debugger- no installation needed🐳 Docker and npm packages – Deploy anywhere
🤖 Built for AI agents – Structured JSON responses for easy parsing
🔒 Secret redaction on by default – Credential-shaped values (API keys, tokens, private keys) are masked as labeled placeholders in variable, evaluate, and output results before they reach the agent (details; opt out with
DEBUG_MCP_NO_REDACT=1)🛡️ Path validation – Prevents crashes from non-existent files
📝 AI-aware line context – Intelligent breakpoint placement with code context
✅ Comprehensive test suite – unit, integration, and end-to-end coverage across every adapter (CI status)
🧠 Agent Skill
Tools tell an agent what it can do; a skill teaches it how to debug well. This repo ships an agent skill covering the session golden path, root-cause discipline (bisection over line-by-line stepping), attach/remote recipes, and per-language quirks:
# Claude Code (user-level)
cp -r skills/debugging ~/.claude/skills/mcp-debugger
# Cross-agent directories (Copilot CLI and friends)
cp -r skills/debugging ~/.agents/skills/mcp-debuggerThe server also serves condensed guidance in-band: MCP instructions on connect, plus a debugging-workflow prompt any MCP client can request. See skills/debugging/README.md for details.
🎬 See It In Action
Auto-debug failing CI tests – a composite GitHub Action that launches mcp-debugger + an agent on a test failure and posts the root-cause analysis
Sick pod walkthrough – attach to a misbehaving Python service in Kubernetes via port-forward (tutorial)
Native sick pod – same story for compiled code: ephemeral debug sidecar + attach-by-PID, no in-process agent required
🚀 Quick Start
Requirements: Node.js 22+ for the server. Each language you debug also needs its own toolchain installed (Python + debugpy, Ruby + the
debuggem /rdbg, Node.js, Go + Delve, JDK 21+, .NET SDK, the Rust toolchain, a C/C++ compiler — g++/clang++, only needed for source-file launch — GnuCOBOL 3.1.2+ for COBOL source launch, or the Dart SDK — Flutter bundles one — for Dart/Flutter). Not sure what's installed? Runnpx @debugmcp/mcp-debugger doctorfor a per-adapter toolchain report.CodeLLDB platform note (npx/npm installs): the CodeLLDB debug engine ships as per-platform optional dependencies (
@debugmcp/codelldb-win32-x64,-darwin-x64,-darwin-arm64,-linux-x64,-linux-arm64) — npm installs exactly the one matching your platform, so Rust and C/C++ debugging work out of the box everywhere npm serves. If you install with--omit=optional, setCODELLDB_PATHto a CodeLLDB release binary instead, or use the Docker image.
For MCP Clients (Claude Desktop, etc.)
Add to your MCP settings configuration:
{
"mcpServers": {
"mcp-debugger": {
"command": "node",
"args": ["C:/path/to/mcp-debugger/dist/index.js", "stdio", "--log-level", "debug", "--log-file", "C:/path/to/logs/debug-mcp-server.log"],
"disabled": false,
"autoApprove": ["create_debug_session", "set_breakpoint", "get_variables"]
}
}
}For Codex CLI, desktop, and IDE
Register the published stdio server with the Codex CLI:
codex mcp add mcp-debugger -- npx -y @debugmcp/mcp-debugger stdio
codex mcp listCodex stores this entry in ~/.codex/config.toml. The ChatGPT desktop app, Codex CLI,
and Codex IDE extension share that configuration when they run on the same Codex host.
Restart the active desktop client or IDE extension (or start a new CLI session), then use
/mcp to confirm that mcp-debugger is connected. See the official
Codex MCP documentation for configuration and
troubleshooting details.
Developing mcp-debugger itself? Use the restartable source dev proxy instead of the published package.
For Claude Code CLI
For Claude Code users, we provide an automated installation script:
Prerequisite: The Claude CLI must be installed and available on your PATH before running the installation script. See Claude Code documentation for installation instructions.
# Clone the repository
git clone https://github.com/debugmcp/mcp-debugger.git
cd mcp-debugger
# Run the installation script
./scripts/install-claude-mcp.sh
# Verify the connection (use 'claude mcp list' if claude is on your PATH)
claude mcp listImportant: The stdio argument is required to prevent console output from corrupting the JSON-RPC protocol. See CLAUDE.md for detailed setup and troubleshooting.
For the pi coding agent
pi 0.99 and later has built-in MCP support. The published @debugmcp/mcp-debugger package is
also a pi package: one install adds the mcp-debugger agent skill and an extension that registers
the server with pi's MCP support:
pi install npm:@debugmcp/mcp-debugger # the mcp-debugger skill, and the server via pi's built-in MCP
pi list # shows the packageThe extension runs the CLI that pi install put on disk, so the server matches the skill and
starts without an npx download. It registers with deferred exposure: pi lists the debugger in
its system prompt, and the model loads the tools it needs with tool_search, named
mcp__mcp_debugger__<tool>. /mcp shows the server and changes its exposure for a session. A
mcp-debugger entry in ~/.pi/agent/mcp.json replaces the registration, for example to debug a
source build through the dev proxy.
To add only the server, without the skill: pi mcp add mcp-debugger -- npx -y @debugmcp/mcp-debugger stdio.
pi older than 0.99 has no built-in MCP support; the extension then does nothing, so upgrade pi.
Using Docker
docker run -i --rm -v $(pwd):/workspace debugmcp/mcp-debugger:latestThe Docker image debugs Python, JavaScript, Java, Rust, C/C++, COBOL, and Dart natively (toolchains — GnuCOBOL and the Dart SDK included — plus a shared vendored CodeLLDB), plus the mock adapter. Flutter is host-only: the image carries no Flutter SDK. Ruby is attach-only in the image (the adapter ships without a Ruby runtime — attach to any
rdbg --openprocess, local or remote). Only Go and .NET are disabled in the container — run those via npm/npx next to your local toolchain. Host-built Rust/C++ binaries debugged in the container get an auto-derived source map back to/workspace.list_supported_languagesreports per-mode availability (modes.launch/modes.attach) with reasons. See Docker support.
Using npm
npm install -g @debugmcp/mcp-debugger
mcp-debugger --helpOr use without installation via npx:
npx @debugmcp/mcp-debugger --helpOver the network (Streamable HTTP)
stdio is the default and is what most clients want. When the server has to run somewhere else
— a CI runner, a container, a Kubernetes pod — start it on a port instead:
mcp-debugger http --port 3001 # or: node dist/index.js http -p 3001and point the client at it:
{
"mcpServers": {
"mcp-debugger": {
"type": "http",
"url": "http://127.0.0.1:3001/mcp"
}
}
}Each HTTP client gets its own isolated server: debug sessions are never visible to another
client. A client that disconnects without DELETE /mcp keeps its debug sessions — and any
paused attach target — alive until the server reaps it: 2 minutes after its SSE stream
dropped (MCP_HTTP_STREAM_LOST_SESSION_MS), or 30 minutes idle if it never opened one
(MCP_HTTP_STALE_SESSION_MS). GET /health lists what each session is holding.
The port defaults to 3001, and the server listens on 127.0.0.1 only. --bind 0.0.0.0 (or
MCP_HTTP_BIND=0.0.0.0) listens on every interface — pair it with --allowed-host for the names other
machines will use; --bind localhost means 127.0.0.1, and only IP addresses are accepted. GET /health
on the same port answers a liveness check and reports the bound address and port under listening.
The server accepts only loopback Host headers by default — localhost, 127.0.0.1, [::1] —
as DNS-rebinding protection for an unauthenticated endpoint that can spawn processes and attach to
PIDs. A client on another machine reaches it through a port-forward or an SSH tunnel
(ssh -L 3001:127.0.0.1:3001 user@server, then http://127.0.0.1:3001/mcp), or you bind an
interface with --bind; any other Host gets a 403 that says so. To accept a service name directly — http://mcp-debugger:3001/mcp on a
container network — start the server with --allowed-host mcp-debugger (repeatable) or
MCP_HTTP_ALLOWED_HOSTS=mcp-debugger (comma-separated). That opt-in means another access control
fronts the server; there is no wildcard. Browser clients are checked against the same list by
their Origin, so a cross-site page cannot drive the debugger.
📚 How It Works
mcp-debugger exposes debugging operations as MCP tools that can be called with structured JSON parameters:
// Tool: create_debug_session
// Request:
{
"language": "python", // or "ruby", "javascript", "rust", "go", "java", "dotnet", "cpp", "cobol", "dart", or "mock" for testing
"name": "My Debug Session"
}
// Response:
{
"success": true,
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"message": "Created python debug session: My Debug Session"
}🛠️ Available Tools
All 29 tools below are implemented — see the tool reference for parameters and response shapes.
Tool | Description | Status |
| Create a new debugging session | ✅ Implemented |
| List all active sessions | ✅ Implemented |
| Show available language adapters | ✅ Implemented |
| Set a breakpoint in a file | ✅ Implemented |
| List a session's breakpoints with verified state | ✅ Implemented |
| Remove a breakpoint by id or file+line | ✅ Implemented |
| Remove all breakpoints (optionally per file) | ✅ Implemented |
| Start debugging a script — or a failing test in one call ( | ✅ Implemented |
| Relaunch with the same config, breakpoints re-applied | ✅ Implemented |
| Attach debugger to a running process | ✅ Implemented |
| Detach debugger from a process | ✅ Implemented |
| Open a read-only DAP mirror endpoint so an IDE can attach and inspect | ✅ Implemented |
| Close the mirror endpoint and disconnect IDE clients | ✅ Implemented |
| Get the current stack trace | ✅ Implemented |
| List all threads in the debug session | ✅ Implemented |
| Get variable scopes for a frame | ✅ Implemented |
| Get variables in a scope | ✅ Implemented |
| Get local variables in current frame | ✅ Implemented |
| Step over the current line | ✅ Implemented |
| Step into a function | ✅ Implemented |
| Step out of a function | ✅ Implemented |
| Continue running | ✅ Implemented |
| Block until the session next pauses or ends | ✅ Implemented |
| Pause running execution | ✅ Implemented |
| Evaluate expressions in debug context | ✅ Implemented |
| Get source code context | ✅ Implemented |
| Read captured debuggee output (stdout/stderr) | ✅ Implemented |
| Close a session | ✅ Implemented |
| Apply changed code to the running program and keep its state — Flutter hot reload, Java class redefinition ( | ✅ Implemented |
🏗️ Architecture: Dynamic Adapter Loading
Version 0.10.0 introduces a clean adapter pattern that separates language-agnostic core functionality from language-specific implementations:
┌─────────────┐ ┌────────────────┐ ┌──────────────┐ ┌─────────────────┐
│ MCP Client │────▶│ DebugMcpServer │────▶│SessionManager│────▶│ AdapterRegistry │
└─────────────┘ └────────────────┘ └──────────────┘ └─────────────────┘
│ │
▼ ▼
┌──────────────┐ ┌─────────────────┐
│ ProxyManager │◀─────│ Language Adapter│
└──────────────┘ └─────────────────┘
│
┌───────────┬───────────┬───────────┼───────────┬───────────┬───────────┬───────────┬───────────┬───────────┬───────────┐
│ │ │ │ │ │ │ │ │ │ │
┌─────▼────┐┌─────▼────┐┌─────▼────┐┌─────▼────┐┌─────▼────┐┌─────▼────┐┌─────▼────┐┌─────▼────┐┌─────▼────┐┌─────▼────┐┌─────▼────┐
│Python ││Ruby ││JavaScript││Rust ││Go ││Java ││.NET ││C/C++ ││COBOL ││Dart ││Mock │
│Adapter ││Adapter ││Adapter ││Adapter ││Adapter ││Adapter ││Adapter ││Adapter ││Adapter ││Adapter ││Adapter │
└──────────┘└──────────┘└──────────┘└──────────┘└──────────┘└──────────┘└──────────┘└──────────┘└──────────┘└──────────┘└──────────┘Adding Language Support
Want to add debugging support for your favorite language? Check out the Adapter Development Guide!
💡 Example: Debugging Python Code
Here's a complete debugging session example:
# buggy_swap.py
def swap_variables(a, b):
a = b # Bug: loses original value of 'a'
b = a # Bug: 'b' gets the new value of 'a'
return a, bStep 1: Create a Debug Session
// Tool: create_debug_session
// Request:
{
"language": "python",
"name": "Swap Bug Investigation"
}
// Response:
{
"success": true,
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"message": "Created python debug session: Swap Bug Investigation"
}Step 2: Set Breakpoints
// Tool: set_breakpoint
// Request:
{
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"file": "C:\\path\\to\\buggy_swap.py",
"line": 2
}
// Response:
{
"success": true,
"breakpointId": "28e06119-619e-43c0-b029-339cec2615df",
"file": "C:\\path\\to\\buggy_swap.py",
"line": 2,
"verified": false,
"message": "Breakpoint set at C:\\path\\to\\buggy_swap.py:2"
}Step 3: Start Debugging
// Tool: start_debugging
// Request:
{
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"scriptPath": "C:\\path\\to\\buggy_swap.py"
}
// Response:
{
"success": true,
"state": "paused",
"message": "Debugging started for C:\\path\\to\\buggy_swap.py. Current state: paused",
"data": {
"message": "Debugging started for C:\\path\\to\\buggy_swap.py. Current state: paused",
"reason": "breakpoint"
}
}Step 4: Inspect Variables
First, get the scopes:
// Tool: get_scopes
// Request:
{
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"frameId": 3
}
// Response:
{
"success": true,
"scopes": [
{
"name": "Locals",
"variablesReference": 5,
"expensive": false,
"presentationHint": "locals",
"source": {}
},
{
"name": "Globals",
"variablesReference": 6,
"expensive": false,
"source": {}
}
]
}Then get the local variables:
// Tool: get_variables
// Request:
{
"sessionId": "a4d1acc8-84a8-44fe-a13e-28628c5b33c7",
"scope": 5
}
// Response:
{
"success": true,
"variables": [
{"name": "a", "value": "10", "type": "int", "variablesReference": 0, "expandable": false},
{"name": "b", "value": "20", "type": "int", "variablesReference": 0, "expandable": false}
],
"count": 2,
"variablesReference": 5
}📖 Documentation
🗺️ Roadmap – Path to 1.0: stability criteria, near-term themes, non-goals
📘 Tool Reference – Complete API documentation
🚦 Getting Started Guide – First-time setup
🏗️ Architecture Overview – Multi-language design
🔧 Adapter Development – Add new languages
🔌 Dynamic Loading Architecture – Runtime discovery, lazy loading, caching
🧩 Adapter API Reference – Adapter, factory, loader, and registry contracts
🌳 Session Tree Design – A debuggee's child processes as debug sessions (issue #1005; shipped for Python, #1081, and JavaScript, #1082)
🔄 CHANGELOG – Release history and upgrade notes
🐍 Python Debugging Guide – Python-specific features
💎 Ruby Debugging Guide – Ruby debugging with
rdbg, including remote attach🔬 Case Study: the initialize response that never came – mcp-debugger debugging itself to root-cause a Ruby launch stall
🔬 Case Study: attaching the debugger to itself – live-patching a running mcp-debugger through its own
evaluate_expressionto catch a race strace couldn't see🔬 Case Study: the pause that always succeeded – reading js-debug's own CDP trace to catch its smart-stepper eating user pauses on idle servers
🔬 Case Study: the trace that couldn't name its socket – measure-fix-measure on the diagnostics themselves: one scripted attach run, before and after, as the acceptance test
🟨 JavaScript Debugging Guide – JavaScript/TypeScript features
🐹 Go Debugging Guide – Go debugging with Delve
☕ Java Debugging Guide – Java debugging with JDI bridge
🔷 .NET Debugging Guide – .NET/C# debugging with netcoredbg
⚙️ C/C++ Debugging Guide – CodeLLDB launch, auto-compile, attach-by-PID, core dumps, remote stubs
🧮 COBOL Debugging Guide – GnuCOBOL + CodeLLDB: auto-compile, COBOL-shaped variables, runtime-error stops, the mainframe migration recipe
🐦 Dart/Flutter Debugging Guide – the SDK's own debug adapters: runner selection,
dart test/flutter test, attach by VM-service URI, Flutter devices🦀 Rust Debugging Guide – CodeLLDB setup (Windows specifics)
🐳 Docker Support – Container languages, attach modes, host-binary source mapping
☸️ Kubernetes Debugging – Turnkey attach recipes: registry-free manifests, per-language presets, ephemeral debug sidecar
🚑 JIT Diagnostics Tutorial – Debug live services in Kubernetes, incl. the ephemeral-sidecar flow for compiled code
🤖 Agent Debugging Guide – Correct tool usage patterns for AI agents
⚠️ Known Issues – Current caveats and workarounds
🩺 Diagnostics –
mcp-debugger doctor, per-language prerequisites, failure signatures, env-var reference🔧 Troubleshooting – Common issues & solutions
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
# Development setup
git clone https://github.com/debugmcp/mcp-debugger.git
cd mcp-debugger
# Install dependencies and vendor debug adapters
pnpm install
# Vendored debug engines (Microsoft's js-debug; CodeLLDB, shared by Rust, C/C++ and COBOL)
# are downloaded automatically and verified against committed SHA-256 digest pins
# Build the project
pnpm build
# Run tests
pnpm test
# Check adapter vendoring status
pnpm vendor:status
# Force re-vendor all adapters (if needed)
pnpm vendor:forceDebug Adapter Vendoring
The project automatically vendors debug adapters during pnpm install:
JavaScript: Downloads Microsoft's js-debug from GitHub releases
Rust, C/C++ & COBOL: Download a single shared copy of CodeLLDB for the current platform (
packages/codelldb-common)Integrity: Every download is verified against the pinned SHA-256 digests in the packages'
vendor-manifest.json; mismatches fail the buildCI Environment: Set
SKIP_ADAPTER_VENDOR=trueto skip vendoring
To manually manage adapters:
# Check current vendoring status
pnpm vendor:status
# Re-vendor all adapters
pnpm vendor
# Clean and re-vendor (force)
pnpm vendor:force
# Clean vendor directories only
pnpm clean:vendorRunning Container Tests Locally
We use Act to run GitHub Actions workflows locally:
# Build the Docker image first
docker build -t mcp-debugger:local .
# Run tests with Act (use WSL2 on Windows)
act -j build-and-test --matrix os:ubuntu-latestSee tests/README.md for detailed testing instructions.
📊 Project Status
✅ Production Ready: ten language adapters, 29 tools, and polished multi-language distribution
✅ Clean architecture with a dynamic adapter pattern
✅ Python · Ruby · JavaScript/TypeScript · Go · Java · .NET/C#: Full step-through debugging
🦀 Rust: Full support on Linux/macOS/Windows (Windows requires the GNU toolchain; MSVC is not supported by CodeLLDB)
⚙️ C/C++: Full step-through debugging via CodeLLDB (launch + attach-by-PID; on Windows prefer MinGW/DWARF — MSVC PDB fidelity is partial)
🧮 COBOL: Step-through debugging via GnuCOBOL + CodeLLDB (launch + attach-by-PID; verified with GnuCOBOL 3.1.2/3.2 on Linux and Windows/MSYS2; PERFORM-aware stepping, paragraph breakpoints and
{WS-NAME}logpoints)🐦 Dart/Flutter: Step-through debugging through the SDK's own debug adapters (
dart debug_adapter,flutter debug-adapter; launch + attach by VM-service URI, or bydeviceIdon Android). Dart programs anddart test; Flutter apps and tests on desktop, web (Chrome/Edge), Android emulators and devices, macOS and the iOS simulator; hot reload and hot restart🟢 Runtime: Node.js 22+
📈 Active Development: Regular updates and improvements — see the Roadmap for the path to 1.0
🏛️ Who Maintains This
mcp-debugger is stewarded by Sycamore LLC and led by John Franklin (@debugmcpdev). The project uses an agent-first development model with human accountability: AI agents write most of the code; a human maintainer makes every merge, release, and security decision. See MAINTAINERS.md, GOVERNANCE.md, and SUPPORT.md (including commercial support).
Supply-chain posture: pinned CI actions, OIDC trusted publishing, sigstore provenance on every npm package, SBOMs attached to releases, and an OpenSSF Scorecard score we actively maintain — details in SUPPLY-CHAIN-SECURITY.md. Report vulnerabilities via SECURITY.md.
📄 License
MIT License - see LICENSE for details.
👥 Contributors
@Poyraxx — Ruby adapter (rdbg)
@swinyx — Go adapter (Delve)
@roofpig95008 — Java adapter (JDI bridge)
🙏 Acknowledgments
Built with:
Model Context Protocol by Anthropic
Debug Adapter Protocol by Microsoft
debugpy for Python debugging
debug for Ruby debugging
Give your AI agents a real debugger — in any language.
Available Tools
29 toolsattach_to_processA
Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state "running" with pending:true; the late event alone changes the session to "paused" — call wait_for_stop to block until it does
Inputs: sessionId (required), host, port, timeout, +7 more.
clear_breakpointsA
Remove all breakpoints in a session, or all breakpoints in one file. Clearing zero breakpoints is success. Takes effect immediately while the program is running or paused
Inputs: sessionId (required), file.
close_debug_sessionC
Close a debugging session
Inputs: sessionId (required).
continue_executionA
Continue execution. Returns immediately after the adapter acknowledges; does not wait for the next stop. Call wait_for_stop to block until the program stops again or ends — it reports why (lastStop, e.g. "breakpoint" vs "exception") and where; list_debug_sessions and get_stack_trace show the same without waiting. Use get_output to read the program's stdout/stderr
Inputs: sessionId (required).
create_debug_sessionA
Create a new debugging session. Passing port, processId or an adapterConfig that names a target (a debugger URI: vmServiceUri, websocketAddress, vmServiceInfoFile; or a Flutter deviceId, for an app running on an Android device) attaches to a running process in the same call, with every attach argument attach_to_process takes (host alone does not); omit them for launch mode. Attaching pauses the target unless stopOnEntry is false
Inputs: language (required), host, name, port, +9 more.
detach_from_processA
Detach from the debugged process without terminating it
Inputs: sessionId (required), terminateProcess.
evaluate_expressionA
Evaluate expression in the current debug context. Without frameId, uses the same adopted top frame as stack and locals — at a breakpoint or step that is the frame the program stopped in even when the stack display would hide it — and discloses an automatic thread switch or a hidden paused frame in anchorNote; frame names the frame that was used, on success and on failure. Expressions can read and modify program state. Waits up to 30s by default
Inputs: sessionId (required), expression (required), frameId, timeout.
expose_sessionA
Expose a debug session as a read-only DAP mirror endpoint on 127.0.0.1 so an IDE (e.g. VS Code) can attach as a second debug client and inspect live state: threads, stack, scopes, variables, evaluate. Returns host, port, and a session token the IDE must include as "mirrorToken" in its attach configuration. The mirror never drives execution — continue/step/pause and breakpoint changes are rejected; control stays with this MCP session. Requires an active session (launched or attached); works while running or paused. Calling it again returns the same endpoint. The endpoint closes on unexpose_session, close_debug_session, restart, or debuggee exit
Inputs: sessionId (required).
get_local_variablesA
Get local variables for the shared inspection anchor. If the stopped thread is frameless, a sibling with policy-recognized user frames is preferred, adopted, and disclosed in note. At a breakpoint or step inside a frame the stack display hides as internal (a node_modules dependency), the anchor is that frame — the one the program stopped in — and note says so. A JavaScript frame with no Local/block scope returns empty with guidance instead of mislabeling Global bindings. Responses are size-guarded; pass names:[...] to fetch specific variables in full
Inputs: sessionId (required), names, includeSpecial.
get_outputA
Get debuggee output (stdout/stderr/console) captured for a session. Buffered per launch (last 1000 entries; adapter telemetry and known adapter-internal diagnostics — e.g. LLDB DWARF-parser noise — filtered out). Works while the program is running and after it finishes, until the session is closed. Pass since=nextSince from the previous response to fetch only new output
Inputs: sessionId (required), limit, since.
get_scopesC
Get scopes for a stack frame
Inputs: frameId (required), sessionId (required).
get_source_contextB
Get source context around a specific line in a file
Inputs: file (required), line (required), sessionId (required), linesContext.
get_stack_traceB
Get stack trace. The response includes stopReason — why the session is paused. For an implicit frameless stopped thread, a sibling with policy-recognized user frames is preferred and adopted, with the switch disclosed in note. Internal/runtime frames are filtered by default; when any are hidden the response carries hiddenFrames and a note. When the frame the program is paused in is itself internal, pausedFrame names it (kept: whether it was retained as stackFrames[0]) and the note says so. The note also says when the top frame's file is newer than the compiled file the debugger binds it through (a stale build)
Inputs: sessionId (required), threadId, includeInternals.
get_variablesA
Get variables (scope is variablesReference: number). Responses are size-guarded: oversized values are cut (truncated:true) and very large scopes return a capped list with a truncation notice — pass names:[...] to fetch specific variables in full
Inputs: scope (required), sessionId (required), names.
hot_reloadA
Apply changed code to the running program and keep its state — the adapter's own live update. Flutter: the SDK adapter's hot reload (the app must have started; the reassemble runs build(), so a breakpoint there is reported by this call as the stop, with its location and snapshot; widget state, counters and timers survive; a reload sent to a paused program lands when it resumes). Java: class redefinition (JDI HotSwap) — scans classesDir for .class files modified after sinceTimestamp, redefines the ones the JVM has loaded, re-plants breakpoints, and returns which classes were redefined and the newest file timestamp (pass it as sinceTimestamp next time for an incremental update). Statement-anchored breakpoints are re-resolved against the new source after the update (anchorResolution reports moved/stale). Refused by name on the other languages. redefine_classes is a deprecated alias of this tool.
Inputs: sessionId (required), timeout, classesDir, sinceTimestamp.
list_breakpointsA
List all breakpoints in a session with their verified state and adapter-assigned ids. Session-global function breakpoints appear separately as functionBreakpoints (omitted when filtering by file). Works before launch (queued, verified=false), while running or paused, and after the program exits
Inputs: sessionId (required), file.
list_debug_sessionsA
List all active debugging sessions. Paused sessions include lastStop with the reason for the most recent stop (e.g. "breakpoint" vs "exception")
Inputs: no named parameters.
list_supported_languagesA
List all supported debugging languages with metadata
Inputs: no named parameters.
list_threadsB
List all threads in the debugged process
Inputs: sessionId (required).
pause_executionA
Pause a running program. Waits briefly for the stop; if the program cannot stop within ~5s (e.g. blocked in native code, or an idle server waiting for input), returns success with pending:true and the session reports "paused" the next time the program runs code (call wait_for_stop to block until then). An observed stop answers with stopReason, the first visible frame as location (with its source context), and note when the stop was reported on a thread with no program frame — a sibling thread in program code is shown instead, or, when none has one, the note says no program frame is active. Fails with an actionable error if the session has no debuggable target to pause (e.g. a js attach whose target session was never adopted or has ended)
Inputs: sessionId (required), threadId.
remove_breakpointA
Remove a breakpoint by breakpointId (returned by set_breakpoint / list_breakpoints), by function name, or by file + line (removes all breakpoints at that location). Takes effect immediately while the program is running or paused; also works after the program exits, before a relaunch
Inputs: sessionId (required), file, line, function, +1 more.
restart_debuggingA
Restart the debuggee: terminate the current program (if still running) and relaunch it with the same configuration as the last start_debugging. All current breakpoints are re-applied automatically. The get_output buffer starts fresh — read from since=0 after a restart. Works while running, paused, or after the program has exited. Not available for attach sessions or sessions never launched. Answers like start_debugging, including "running" with pending:true when the relaunch has not stopped within the same short hold (then call wait_for_stop)
Inputs: sessionId (required).
set_breakpointC
Set a breakpoint. Setting breakpoints on non-executable lines (structural, declarative) may lead to unexpected behavior
Inputs: sessionId (required), file, line, function, +6 more.
start_debuggingA
Start debugging a script. Answers when the launched program stops, when it ends, or after a short hold — whichever comes first, and the same way in every language: "paused" with a reason and, as wait_for_stop answers a stop, the location, its source context and a note (a breakpoint reached as the program starts is answered here), "stopped" with the exit code, or "running" with pending:true when the program has not stopped yet; the message says what is armed. The hold is not a limit on the program — nothing is cancelled when it passes and breakpoints stay armed: call wait_for_stop to block until the program stops or ends (for a server, after sending the request that reaches your breakpoint). A stopOnEntry launch is answered at its entry stop
Inputs: sessionId (required), scriptPath (required), args, testRunner, +5 more.
step_intoA
Step into the current call. Waits briefly for the program to stop; if the step is still executing after ~5s, returns success with state "running" and pending:true — the session becomes "paused" when the step completes (call wait_for_stop to block until then)
Inputs: sessionId (required).
step_outA
Step out of the current function. Waits briefly for the program to stop; if the step is still executing after ~5s (e.g. the rest of the function is long-running), returns success with state "running" and pending:true — the session becomes "paused" when the step completes (call wait_for_stop to block until then)
Inputs: sessionId (required).
step_overA
Step over the current line. Waits briefly for the program to stop; if the step is still executing after ~5s (e.g. stepping over a long-running call), returns success with state "running" and pending:true — the step is still in effect and the session becomes "paused" when it completes (call wait_for_stop to block until then, or pause_execution to interrupt)
Inputs: sessionId (required).
unexpose_sessionA
Close a session's DAP mirror endpoint and disconnect any attached IDE clients. Succeeds as a no-op if the session is not exposed
Inputs: sessionId (required).
wait_for_stopA
Block until the session next pauses or ends, then say why and where. Call it after continue_execution (which does not wait) and whenever a tool answers pending:true, instead of polling list_debug_sessions. Answers at once when the session is already paused (state "paused" with lastStop — the same record list_debug_sessions shows — and the top frame as location) or already over (the terminal state, with exitCode when the debuggee reported one); note says when the answer is anchored on a thread other than the one the stop was reported on, or when no frame of the shown stack is program code. If neither happens within the timeout it answers state "running" with pending:true: nothing was cancelled, breakpoints and exception filters stay armed — call it again to keep waiting, or pause_execution to interrupt
Inputs: sessionId (required), timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Most tools map to a distinct DAP operation (set/remove/clear breakpoints, step_over/into/out, pause vs continue vs wait_for_stop), and the descriptions actively clarify the run-state distinctions. The main overlaps are create_debug_session (which accepts every attach_to_process argument) versus attach_to_process, and get_variables versus get_local_variables, both of which an agent could plausibly misselect.
All 29 names are snake_case with a verb-first or clear noun-object pattern (list_threads, set_breakpoint, start_debugging, wait_for_stop), with the only mild deviation being the domain term hot_reload. The expose/unexpose_session pair is internally symmetric, so the convention holds throughout.
At 29 tools the surface is heavy, exceeding the comfortable range, though a full DAP debugger genuinely spans sessions, breakpoints, stepping, inspection, output, and hot reload. Some tools (expose_session/unexpose_session, hot_reload, list_supported_languages) are niche relative to the core debugging loop, pushing the set past what most agent sessions need.
Coverage is strong: session lifecycle (create/close/restart/detach), breakpoint CRUD plus clear, full stepping and pause/continue/wait, stack/scopes/variables/evaluate inspection, output streaming, source context, and hot reload. Gaps remain around exception-breakpoint configuration, conditional/watch (data) breakpoints, and explicit frame/thread selection or variable mutation outside evaluate_expression.
Maintenance
Related MCP Connectors
Agent Replay Debugger MCP — record every agent step + deterministic replay. Step-debugger for
Live browser debugging for AI assistants — DOM, console, network via MCP.
Shared debugging memory for AI coding agents
AI-native programming language and toolchain for accountable, verifiable agent-driven development.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to debug JavaScript and TypeScript applications by connecting to Chrome DevTools Protocol-compatible debuggers, allowing them to set breakpoints, step through code, inspect variables, and evaluate expressions with full source map support.1810 npm2Apache 2.0
- AlicenseBqualityBmaintenanceEnables AI agents to debug code and automate browsers using Chrome DevTools Protocol, supporting breakpoints, variable inspection, and replayable interaction recording.35548 npm19MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to debug code inside VS Code by setting breakpoints, stepping through execution, inspecting variables, and evaluating expressions across multiple languages.581MIT
- AlicenseBqualityDmaintenanceEnables AI agents to debug C/C++ programs with GDB or LLDB, supporting breakpoints, stepping, variable inspection, and function calls.20MIT