mcp-debugger

Step-through debugging for AI agents: breakpoints, stepping and live variables in nine languages

AI & MLTypeScriptv0.25.1

mcp-debugger

MCP Debugger Logo - A stylized circuit board with debug breakpoints

A headless, agentic debugger over MCP โ€” let your AI agents debug running programs in nine languages.

CI codecov npm version Docker Pulls License: MIT OpenSSF Scorecard OpenSSF Best Practices

๐ŸŽฏ 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 nine 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-debuggermicrosoft/DebugMCP
Runs headless (CI, containers, k8s, cloud agents)โœ… standalone Node processโŒ requires a running VS Code
Transportsstdio + Streamable HTTPStreamable HTTP (localhost)
Distributionnpx, npm, Docker imageVS Code Marketplace extension
Remote attach without an IDEโœ… debugpy / rdbg / JDWP, incl. pods via port-forwardโŒ
Per-session process isolationโœ… one proxy process per sessionshares the VS Code instance
Java hot-swap (redefine_classes)โœ…โŒ
Debuggee output as subscribable MCP resourceโœ…โŒ
In-IDE debugging UX alongside the agentโœ… read-only IDE mirror (expose_session) โ€” the IDE joins the agent's live sessionโœ… native
Logpoints without pausing (prod-safe value watching)โœ… logMessage breakpointsโœ… via VS Code
Content/function-addressed breakpoints (statement:, function:, expectedContent)โœ… 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)โœ… kubectl debug flowโŒ
C/C++โœ… via CodeLLDB (launch + attach-by-PID)โœ… via VS Code extensions
COBOLโœ… via GnuCOBOL + CodeLLDB (launch + attach-by-PID, COBOL-shaped variables)โ€”
PHPโŒโœ… via VS Code extensions
LanguagesPython, JS/TS, Ruby, Rust, Go, Java, .NET, C/C++, COBOLPython, 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.25.0 โ€” COBOL debugging lands (GnuCOBOL + CodeLLDB, with COBOL-shaped variables, PERFORM-aware stepping and paragraph breakpoints), and Rust and C/C++ work out of the box on every platform npm installs now that CodeLLDB ships as per-platform packages. Also new: mcp-debugger doctor, a Kubernetes debugging recipe, an HTTP transport locked to 127.0.0.1 with Host/Origin checks, launch responses that say how a run ended, exit codes for Go and Docker JavaScript, and a lighter startup. See the CHANGELOG for the full release history.

โœจ 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/.cbl sources (auto-compiled with cobc) 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)
  • ๐Ÿงช 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) with source-path mapping, or by PID for native code (C/C++, COBOL). 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++ and COBOL spawn a local adapter instead; of those, only Java (a JDK) and .NET (netcoredbg) need a toolchain you install, since the JavaScript, C/C++ and COBOL debug engines ship with the package. list_supported_languages reports per-mode availability with reasons
  • ๐ŸŽฏ Breakpoints that survive edits โ€“ Address by content (statement: "total = sum(prices)"), by symbol (function: "main"), or assert line content with expectedContent; anchors re-resolve across restart_debugging and weak matches warn loudly
  • ๐Ÿชต Logpoints โ€“ set_breakpoint with logMessage: "x={x}" streams interpolated values into get_output without pausing โ€” prod-safe value watching on hot paths
  • ๐Ÿงฐ Full breakpoint lifecycle โ€“ list_breakpoints / remove_breakpoint / clear_breakpoints work live mid-run; restart_debugging relaunches with the same config and re-applies everything in one call
  • ๐Ÿ“ก Buffered program output โ€“ get_output returns 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 via lastStop)
  • ๐Ÿชž Read-only IDE mirror โ€“ expose_session opens 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 (legacy SSE transport is deprecated)
  • ๐Ÿ“ฆ 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-debugger

The 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 debug gem / rdbg, Node.js, Go + Delve, JDK 21+, .NET SDK, the Rust toolchain, a C/C++ compiler โ€” g++/clang++, only needed for source-file launch โ€” or GnuCOBOL 3.1.2+ for COBOL source launch). Not sure what's installed? Run npx @debugmcp/mcp-debugger doctor for 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, set CODELLDB_PATH to 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 list

Codex 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 list

Important: 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 has no built-in MCP support โ€” MCP servers reach it through the community pi-mcp-adapter extension. The published @debugmcp/mcp-debugger package is itself a pi package (from v0.25.0): it ships the mcp-debugger agent skill and a server entry for the adapter, so one install registers both:

pi install npm:pi-mcp-adapter          # prerequisite: the MCP bridge for pi
pi install npm:@debugmcp/mcp-debugger  # registers the stdio server and the mcp-debugger skill
pi list                                # shows the package, its skill, and its MCP server

The adapter namespaces contributed servers by package, so the tools appear under debugmcp_mcp-debugger__mcp-debugger; mcp({ search: "breakpoint" }) finds them either way. The server entry runs the published package via npx. To debug a source build instead, register the dev proxy in the adapter's own config.

Using Docker

docker run -i --rm -v $(pwd):/workspace debugmcp/mcp-debugger:latest

The Docker image debugs Python, JavaScript, Java, Rust, C/C++, and COBOL natively (toolchains โ€” GnuCOBOL included โ€” plus a shared vendored CodeLLDB), plus the mock adapter. Ruby is attach-only in the image (the adapter ships without a Ruby runtime โ€” attach to any rdbg --open process, 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_languages reports per-mode availability (modes.launch / modes.attach) with reasons. See Docker support.

Using npm

npm install -g @debugmcp/mcp-debugger
mcp-debugger --help

Or use without installation via npx:

npx @debugmcp/mcp-debugger --help

Over 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 3001

and 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 legacy sse subcommand still exists but is deprecated โ€” use http.

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. The deprecated sse subcommand applies the same allowlist and accepts the same flag.

๐Ÿ“š 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", 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 28 tools below are implemented โ€” see the tool reference for parameters and response shapes.

ToolDescriptionStatus
create_debug_sessionCreate a new debugging sessionโœ… Implemented
list_debug_sessionsList all active sessionsโœ… Implemented
list_supported_languagesShow available language adaptersโœ… Implemented
set_breakpointSet a breakpoint in a fileโœ… Implemented
list_breakpointsList a session's breakpoints with verified stateโœ… Implemented
remove_breakpointRemove a breakpoint by id or file+lineโœ… Implemented
clear_breakpointsRemove all breakpoints (optionally per file)โœ… Implemented
start_debuggingStart debugging a scriptโœ… Implemented
restart_debuggingRelaunch with the same config, breakpoints re-appliedโœ… Implemented
attach_to_processAttach debugger to a running processโœ… Implemented
detach_from_processDetach debugger from a processโœ… Implemented
expose_sessionOpen a read-only DAP mirror endpoint so an IDE can attach and inspectโœ… Implemented
unexpose_sessionClose the mirror endpoint and disconnect IDE clientsโœ… Implemented
get_stack_traceGet the current stack traceโœ… Implemented
list_threadsList all threads in the debug sessionโœ… Implemented
get_scopesGet variable scopes for a frameโœ… Implemented
get_variablesGet variables in a scopeโœ… Implemented
get_local_variablesGet local variables in current frameโœ… Implemented
step_overStep over the current lineโœ… Implemented
step_intoStep into a functionโœ… Implemented
step_outStep out of a functionโœ… Implemented
continue_executionContinue runningโœ… Implemented
pause_executionPause running executionโœ… Implemented
evaluate_expressionEvaluate expressions in debug contextโœ… Implemented
get_source_contextGet source code contextโœ… Implemented
get_outputRead captured debuggee output (stdout/stderr)โœ… Implemented
close_debug_sessionClose a sessionโœ… Implemented
redefine_classesHot-swap changed Java classes into a running JVM (Java only)โœ… 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     โ”‚โ”‚Mock      โ”‚
        โ”‚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, b

Step 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

๐Ÿค 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:force

Debug 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 build
  • CI Environment: Set SKIP_ADAPTER_VENDOR=true to 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:vendor

Running 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-latest

See tests/README.md for detailed testing instructions.

๐Ÿ“Š Project Status

  • โœ… Production Ready: nine language adapters, 28 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)
  • ๐ŸŸข 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

๐Ÿ™ Acknowledgments

Built with:


Give your AI agents a real debugger โ€” in any language.

Installation

Source-derived launch command. Check the maintainerโ€™s required arguments and credentials before running:

bash
npx -y @debugmcp/mcp-debugger

Set up in your AI client

Merge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.

json
{
  "mcpServers": {
    "io-github-debugmcp-mcp-debugger": {
      "command": "npx",
      "args": [
        "-y",
        "@debugmcp/mcp-debugger"
      ]
    }
  }
}

Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the clientโ€™s tool list, then try a read-only example from its documentation.

Claude Desktop setup reference

Package

@debugmcp/mcp-debuggernpm

Compatible MCP Clients

mcp-debugger works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.

  • Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.
  • Cursor~/.cursor/mcp.jsonRestart Cursor for changes to take effect.
  • VS Code.vscode/mcp.jsonReload VS Code window for changes to take effect.
  • Windsurf~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect.
  • Claude Code.mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.

Learn More