Agent skill

MCP Debugger

by debugmcp in debugmcp/mcp-debugger

A skill your agent uses when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack…

MITAuto-check passedDevelopment

Install MCP Debugger

skills CLI
$ npx skills add debugmcp/mcp-debugger --skill mcp-debugger -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install debugmcp/mcp-debugger mcp-debugger --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/debugmcp/mcp-debugger.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/debugging .claude/skills/mcp-debugger && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mcp-debugger
GitHub stars
171
Token cost
~3.8k tokens
SKILL.md length
1,762 words
Files
11 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack…

  • Works in 6 steps: State a hypothesis about where reality… → Set at most two breakpoints:… → When pausing is too disruptive (hot… → …
  • Investigating a bug
  • SKILL.md covers When to reach for the debugger, The golden path (launch), Root-cause discipline and Program output, plus 5 more sections
  • Calls python and kubectl

What it does

MCP Debugger is an agent skill from debugmcp/mcp-debugger. Use when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack traces, variable inspection, expression evaluation) for Python, JavaScript/TypeScript, Ruby, Rust, Go, Java, .NET/C, C/C++, and COBOL, locally or attached to remote processes.

Its SKILL.md is about 3.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `README.md`, `references/cobol.md` and `references/cpp.md`).

It sits in Development, covering Debugging, MCP servers and Responsive design. It works with Model Context Protocol, Python, C# and C++. The repository describes itself as: A headless, agentic debugger over MCP — let your AI agents debug running programs in seven languages. The licence is MIT.

When your agent uses it

  • Investigating a bug
  • Unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints
  • Variable inspection
  • Expression evaluation) for Python

Example prompts

  • “/mcp-debugger”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. State a hypothesis about where reality diverges from expectation before setting breakpoints.
  2. Set at most two breakpoints: last-known-good and first-known-bad. Run, inspect, halve the interval. Bisection beats stepping line-by-line…
  3. When pausing is too disruptive (hot loops, live or attached processes), use a logpoint: set_breakpoint with logMessage: "x={x}" streams…
  4. At each pause, record what you learned (variable values, actual control flow), not just where you are.
  5. When the diverging line is found, inspect every input to that line before concluding — the bug is usually an operand, not the operator.
  6. Fix, then restart_debugging {sessionId} — one call relaunches with the same configuration and re-applies every breakpoint (the output…

What it can do on your machine

Read from SKILL.md and the folder at commit 55fbfea. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python
    • kubectl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use kubectl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

MCP Debugger loads about 3.8k tokens when it runs, and up to ~19k if it reads all its reference files. Until then it costs about 92 tokens; SKILL.md has 1,762 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~3.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~19k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from debugmcp/mcp-debugger at commit 55fbfea, republished under its MIT licence (© debugmcp). 1,762 words, ~3,798 tokens.

Download SKILL.mdSave it as .claude/skills/mcp-debugger/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
mcp-debugger
description
Use when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack traces, variable inspection, expression evaluation) for Python, JavaScript/TypeScript, Ruby, Rust, Go, Java, .NET/C#, C/C++, and COBOL, locally or attached to remote processes.

Debugging with mcp-debugger

mcp-debugger exposes real language debuggers as MCP tools. Prefer it over print-debugging whenever you would otherwise need more than one edit-run cycle to see program state: a breakpoint plus evaluate_expression answers in one run what printf answers in three.

When to reach for the debugger

  • A test fails and the assertion message doesn't explain why the value is wrong.
  • Control flow surprises you (a branch that "can't happen", a loop that exits early).
  • State mutates somewhere between two known-good points and you need to bisect.
  • The bug lives in code you can't easily edit (third-party package, compiled artifact).
  • You need ground truth about runtime types/values instead of inferring them from source.

Do NOT reach for it when a single glance at the code or one log line would answer the question — session setup costs a few seconds and the target must be runnable.

The golden path (launch)

text
1. create_debug_session   {language: "python"}                 -> sessionId
2. set_breakpoint         {sessionId, file: "<ABSOLUTE path>", statement: "<line text or distinctive substring>"}   (or line: N + expectedContent)
3. start_debugging        {sessionId, scriptPath: "<ABSOLUTE path>"}   -> paused at the breakpoint, or pending: true -> wait_for_stop {sessionId}
4. get_stack_trace        {sessionId}                          -> frames (use frame.id, never assume 0)
5. get_scopes             {sessionId, frameId: <frame.id>}     -> scope variablesReference
6. get_variables          {sessionId, scope: <variablesReference>}
   ... or get_local_variables {sessionId} for the common case
7. evaluate_expression    {sessionId, expression: "x + y"}
8. step_over / step_into / step_out / continue_execution
   wait_for_stop          {sessionId}                          -> blocks until the next stop or the exit (continue_execution does not wait)
9. get_output             {sessionId}                          -> captured debuggee stdout/stderr
10. close_debug_session   {sessionId}                          -> ALWAYS, even on failure

Rules that prevent 90% of failed sessions:

  • Absolute paths only for file and scriptPath (relative paths are rejected in host mode).
  • Use real frame IDs. Take id from get_stack_trace frames; it is adapter-assigned and is not 0-indexed.
  • Expand variable containers. If a variable entry carries a variablesReference, call get_variables again with that reference to see children (Python's "special variables", object fields, array elements).
  • Respect session state. Stepping, evaluation, and variable reads require PAUSED. After continue_execution the session is RUNNING; after a step or breakpoint hit it returns to PAUSED with a persisted stop reason telling you why it stopped (breakpoint, step, entry, exception, ...). continue_execution returns at once — call wait_for_stop {sessionId} to block until the program stops again or ends; it answers with the stop (lastStop, location) or the exit code.
  • A start_debugging that answers running with pending: true is not stuck. The launch holds its answer only briefly — about a second — for the program's first stop, so a breakpoint reached as the program starts is answered in the one call, and anything later is collected with wait_for_stop {sessionId}, which blocks until the program stops or ends. Nothing was cancelled: breakpoints stay armed for as long as the program runs, and the message says what is armed. For a server, this is the workflow: set the breakpoint in the handler, start_debugging (answers pending), send the request, wait_for_stop. The same goes for any step, pause or attach that answers pending: true. wait_for_stop takes a timeout in ms (default 30000); when it runs out it answers pending: true again — just call it again.
  • Breakpoints may verify late. Some adapters (debugpy, JDI) report breakpoints unverified until the module/class loads; that is normal, not an error.
  • <redacted:...> placeholders are masking, not program state. Credential-shaped values and values of sensitive variable names (password, api_key, ...) are masked by default in variable/evaluate/output results; a redaction field reports what was hidden. The real value is intact in the debuggee — don't "fix" it, and don't retry the read. The user can disable masking by restarting the server with DEBUG_MCP_NO_REDACT=1.
  • If get_variables demands names, the server is in least-privilege mode (DEBUG_MCP_VARIABLE_ACCESS=explicit): pass the exact variable names you need (names: ["user", "total"]; case-sensitive, misses reported in notFound) instead of dumping the scope. evaluate_expression still works for targeted reads.
  • Always close_debug_session when done — it tears down the debuggee process tree.

Root-cause discipline

  1. State a hypothesis about where reality diverges from expectation before setting breakpoints.
  2. Set at most two breakpoints: last-known-good and first-known-bad. Run, inspect, halve the interval. Bisection beats stepping line-by-line from the top. Move the window mid-session with remove_breakpoint / clear_breakpoints; list_breakpoints shows what is currently set (with verified state and adapter ids).
    • Prefer statement: "<line text>" over line numbers: it matches like an Edit-tool old_string (whole line or a distinctive substring — whitespace-trimmed, trailing comments ignored, exact matches win), only lands on a line containing your text (inexact or multi-candidate matches are flagged in the response warning), lists every occurrence on ambiguity (add nearLine to pick one), and re-resolves across restart_debugging after you edit the file. When you do address by line, pass expectedContent: "<line text or distinctive substring>" (trailing comments ignored) so a stale or off-by-one line number fails immediately with the actual nearby lines. A response saying requested line N, bound to line M means the adapter moved the breakpoint — trust the bound line.
    • function: "name" breaks on entry to a symbol with no file or line at all — names survive edits best. Supported by Python/Go/Rust/.NET/Java/JavaScript, C/C++ and COBOL (paragraph, section or PROGRAM-ID names) — not Ruby, which rejects it up front (Java accepts bare method, Class.method, or fully-qualified names and binds every concrete overload; JavaScript names are dotted runtime paths like obj.method bound to the current function value — main-module function declarations bind at launch, functions in lazily-loaded modules bind at the next pause).
  3. When pausing is too disruptive (hot loops, live or attached processes), use a logpoint: set_breakpoint with logMessage: "x={x}" streams interpolated values into get_output without stopping the program (Python/JS/Go/Rust, C/C++ and COBOL, where {WS-NAME} is a COBOL data reference; Java, .NET and Ruby reject it with a clear error).
  4. At each pause, record what you learned (variable values, actual control flow), not just where you are.
  5. When the diverging line is found, inspect every input to that line before concluding — the bug is usually an operand, not the operator.
  6. Fix, then restart_debugging {sessionId} — one call relaunches with the same configuration and re-applies every breakpoint (the output buffer resets; read get_output from since: 0). Confirm the observed state changed as predicted. Works even after the program exited; attach sessions are rejected (detach and re-attach instead).

Program output

get_output {sessionId} returns buffered debuggee stdout/stderr with a cursor: pass the returned nextSince back as since to read only new output. Each session also exposes the transcript as MCP resource debug://sessions/{id}/output with subscription support. Caveat: Ruby attach sessions capture no stdout (launch sessions stream it) — when attached to Ruby, verify behavior via evaluate_expression/breakpoints or have the program write a file.

Show full SKILL.md (779 more words)Show less

Attach instead of launch

For an already-running process (including remote machines, containers, and Kubernetes pods via port-forward):

text
attach_to_process {sessionId, host: "localhost", port: 5678, sourcePaths: ["<local src>"], adapterConfig: {...}}
  • Attach pauses the target by default (omitting stopOnEntry means true — the opposite of start_debugging). Pass stopOnEntry: false for a live service you must not freeze. A response with pending: true means the pause lands when the target next runs code (wait_for_stop blocks until it does); continue_execution releases it.
  • Python: target ran python -m debugpy --listen <host>:<port> ...; to address breakpoints by local-checkout path, map it onto the debuggee tree with adapterConfig: {pathMappings: [{localRoot: "<abs local>", remoteRoot: "/app"}]}
  • Ruby: target ran rdbg --open --port <port> ... (works through kubectl port-forward); localfsMap: "/app:<abs local dir>" maps paths
  • Java: target JVM has -agentlib:jdwp=transport=dt_socket,server=y,address=*:<port>; breakpoints in not-yet-loaded classes are deferred automatically, and a fully-qualified class name as file needs no source files at all
  • C/C++ (and other native): attach by PID instead of port — attach_to_process {sessionId, processId: <pid>, adapterConfig: {program: "<path to binary>"}}; in a Kubernetes ephemeral debug container use processId: 1 with program: "/proc/1/root/<binary path>" (on Linux, mind kernel.yama.ptrace_scope)
  • COBOL: attach by PID like C/C++, plus adapterConfig: {sources: ["<abs .cob>", …], dialect: "ibm"} (the manifest is regenerated by a translate-only cobc -C; pass the options the binary was built with) or adapterConfig: {manifestDirs: ["<dir holding *.cobol-symbols.json>"]} (an earlier source launch's .debug-mcp/cobol/<name>/<buildKey>/, needs no cobc) so variables are COBOL-shaped; without either only the engine's C view is available. A job paused inside libcob still shows its program's data division (scopes from the nearest COBOL frame up the stack)

Breakpoint paths on attach are sent verbatim and resolved against the target's filesystem (host-side existence checks are skipped). Without a mapping, use debuggee-side paths — get_stack_trace shows the paths the target uses — or address by symbol ({function: "name"}), which needs no paths. adapterConfig keys the adapter cannot forward into its attach request are named in the response's warning.

Direct-connect attaches (debugpy, rdbg) need no local language toolchain — the debug engine runs inside the target. list_supported_languages reports per-mode availability (modes.launch / modes.attach) with reasons.

detach_from_process leaves the target running; close_debug_session after detach cleans up the session.

For Kubernetes pods, don't re-derive attach configs: the Kubernetes recipe (pattern decision table, path rules) and the per-language attach presets have verified copy-paste calls.

IDE mirror (let a human look around)

When a human wants to inspect your live session in their IDE — CI flake parked at the failing state, a long-running attach session that hit an anomaly — expose it:

text
expose_session {sessionId}  ->  {host: "127.0.0.1", port, token}

Relay the endpoint with a ready-to-paste VS Code config: {"name": "Mirror", "type": "<language's debug type>", "request": "attach", "debugServer": <port>, "mirrorToken": "<token>"}. Their IDE attaches read-only and lands directly on the paused frame: stacks, scopes, variables, and evaluate all work; stepping, continuing, and breakpoint changes are rejected — execution control stays with you. unexpose_session {sessionId} disconnects IDE clients and closes the endpoint (it also closes on session close/restart/exit). Loopback-only; the token is required and should be treated as sensitive.

Crash diagnosis

  • Launch sessions pause at uncaught exceptions by default (breakOnExceptions: "uncaught") with the stack and locals live instead of losing the session — pass "none" to opt out, or "all" to also stop on caught raises (language-dependent). Ruby is the exception: rdbg has no uncaught-only filter, so Ruby crashes still run to termination unless you pass "all". Attach sessions apply no default — pass the mode explicitly.
  • On an exception stop, lastStop.description/lastStop.text carry the exception class and message; where the adapter supports it (Python, JS, Java, .NET), lastStop.exceptionInfo adds exceptionId, breakMode, and details (it lands a moment after the pause — re-query if absent). After termination, exitCode in list_debug_sessions distinguishes a crash (non-zero) from a clean exit.

Current limitations (be honest with yourself)

  • pause_execution support varies by adapter; prefer breakpoints over pausing a free-running program.
  • Variable responses are size-guarded (values truncated past ~1KB, capped variable counts/response size, all env-tunable); a truncation field says what was cut and suggests narrowing with names: [...] or a targeted evaluate_expression.

Language specifics

Read the matching reference before your first session in a language — each has load-bearing quirks:

LanguageReferenceHeadline quirk
Pythonreferences/python.mdexpand "special variables" containers; late breakpoint verification
JavaScript/TSreferences/javascript.mdchild-session architecture; internals filtered from stacks
Rubyreferences/ruby.mdstops at load only with stopOnEntry (rdbg continues by itself otherwise); attach captures no stdout
Rustreferences/rust.mdGNU toolchain on Windows; scriptPath = source file, adapter finds Cargo project
Goreferences/go.mdDelve native DAP; optimized-binary locals warning
Javareferences/java.mdjavac -g required; FQCN breakpoints; redefine_classes hot-swap
.NET/C#references/dotnet.mdscriptPath = compiled .dll; Portable PDB required
C/C++references/cpp.mdscriptPath = binary (-gdwarf-4 -O0) or lone .c/.cpp (auto-compiled); attach by PID; MinGW/DWARF on Windows
COBOLreferences/cobol.mdscriptPath = .cob/.cbl source (auto-compiled with GnuCOBOL) or prebuilt exe; dapLaunchArgs {dialect, format, copybookDirs, runtimeChecks, stdinFile}; COBOL-shaped variables; breakpoints in copybooks; paragraph function breakpoints; {WS-NAME} logpoints; PERFORM-aware step_over/step_out

© debugmcp, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files (references) in skills/debugging of debugmcp/mcp-debugger.

  • SKILL.md
  • README.md
  • references/cobol.md
  • references/cpp.md
  • references/dotnet.md
  • references/go.md
  • references/java.md
  • references/javascript.md
  • references/python.md
  • references/ruby.md
  • references/rust.md

Open the folder on GitHubat commit 55fbfea

Compare with similar skills

MCP Debugger next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

MCP Debugger compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
MCP Debugger this skilldebugmcp/mcp-debugger171—~3.8kAutomated safety check: PassMIT
SlintMoosync/Moosync259—~2.4kAutomated safety check: PassGPL-3.0
Dbgtheodo-group/debug-that158—~1.9kAutomated safety check: PassMIT
Ue Live DebuggingJasonMa0012/MooaToon749—~2.9kAutomated safety check: NotesCustom licence
Failure Oriented InstrumentationArabelaTso/Skills-4-SE253—~2.1kAutomated safety check: PassApache-2.0
Replay Oriented InstrumentationArabelaTso/Skills-4-SE253—~2.5kAutomated safety check: PassApache-2.0

Similar skills

  • Slint

    Moosync/Moosync

    Expert guidance for building, debugging, and working with Slint GUI applications.

    259 GitHub stars~2.4k tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~1.9k tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Ue Live Debugging

    JasonMa0012/MooaToon

    A skill your agent uses when debugging UE C++ crashes, runtime bugs, or unexpected behavior with Rider MCP available.

    749 GitHub stars~2.9k tokensUpdated 19 days ago
    DevelopmentAuto-check: notes
  • Failure Oriented Instrumentation

    ArabelaTso/Skills-4-SE

    Selectively instruments code to capture runtime data for debugging failures and bugs.

    253 GitHub stars~2.1k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Replay Oriented Instrumentation

    ArabelaTso/Skills-4-SE

    Instruments programs to record execution information for deterministic replay debugging.

    253 GitHub stars~2.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Run profile-driven bottleneck optimization across Apache Fory implementations (Java, C++, Python/Cython, Go, Rust, Swift, C, JavaScript/TypeScript, Dart, Kotlin, Scala).

    4.6k GitHub stars~2.2k tokensUpdated today
    MobileAuto-check passed

Questions about MCP Debugger

What does MCP Debugger do?

A skill your agent uses when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack…. MCP Debugger is an agent skill from debugmcp/mcp-debugger.NET/C, C/C++, and COBOL, locally or attached to remote processes.

When should I use MCP Debugger?

MCP Debugger fits situations like: investigating a bug; unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints; variable inspection; expression evaluation) for Python.

How do I install MCP Debugger in Claude Code?

Run `npx skills add debugmcp/mcp-debugger --skill mcp-debugger -a claude-code`. Or copy the skill folder (skills/debugging in debugmcp/mcp-debugger) into .claude/skills/mcp-debugger in your project. Claude Code loads it when a task matches its description.

How do I install MCP Debugger in Codex?

Run `npx skills add debugmcp/mcp-debugger --skill mcp-debugger -a codex`. Or copy the skill folder (skills/debugging in debugmcp/mcp-debugger) into .agents/skills/mcp-debugger in your project. Codex loads it when a task matches its description.

Can I use MCP Debugger in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add debugmcp/mcp-debugger --skill mcp-debugger -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcp-debugger, .gemini/skills/mcp-debugger, .github/skills/mcp-debugger and .opencode/skills/mcp-debugger in your project.

What does MCP Debugger need to run?

Going by SKILL.md and its folder, MCP Debugger needs the command-line tools its instructions call (python and kubectl). Our summary lists: Python 3.

Does MCP Debugger access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is MCP Debugger safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does MCP Debugger use?

MCP Debugger is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does MCP Debugger use?

About 3.8k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 15k tokens, read only when the agent opens those files.

What are the alternatives to MCP Debugger?

Skills that share tags, products or a category with MCP Debugger: Slint (Moosync/Moosync, 259 stars), Dbg (theodo-group/debug-that, 158 stars), Ue Live Debugging (JasonMa0012/MooaToon, 749 stars) and Failure Oriented Instrumentation (ArabelaTso/Skills-4-SE, 253 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains MCP Debugger?

debugmcp (a GitHub organization) maintains it in debugmcp/mcp-debugger, which has 171 GitHub stars. The repository was last updated on October 6, 2026.

Source: debugmcp/mcp-debugger on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.