Skip to content
Debugging
Skill

/debugging

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,

From plugin
mcp-debugger
1911 skill

Claude Code

$ npx -y skills add debugmcp/mcp-debugger --skill debugging --agent claude-code

SKILL.md

debugging.SKILL.md
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++, COBOL, and Dart/Flutter, 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)

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}
   Failing test (Python)? Skip step 2: start_debugging {sessionId, scriptPath: "<ABSOLUTE test file>", testRunner: "pytest", testTarget: "test_name"}
   -> paused at the failing assert (or the escaping exception's raise site) with the autopsy below; a passing test runs to exit code 0.
4. READ THE PAUSED ANSWER: it already carries location, the source line (context), and snapshot
   {exception?, frames, locals} — the exception message, top frames, and the top frame's locals
   (redacted, capped; snapshot.truncation says when there is more). Often that is the whole inspection.
5. To go deeper: get_stack_trace {sessionId} for the full stack (use frame.id, never assume 0),
   get_scopes {sessionId, frameId: <frame.id>} -> scope variablesReference,
   get_variables {sessionId, scope: <variablesReference>} ... or get_local_variables {sessionId}
6. evaluate_expression    {sessionId, expression: "x + y"}
7. 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)
   Each landed step's snapshot carries changedVariables {name: {before, after}} — what the executed
   line changed — instead of re-sending full locals; a variable that appeared is {after, new: true},
   one that left scope is {before, gone: true}, and an empty {} means nothing visible changed.
   ({after} with no flag: the earlier list was cut at its cap, so "new" is not known.)
8. get_output             {sessionId}                          -> captured debuggee stdout/stderr
9. 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 session whose program spawned child sessions (Python and JavaScript, on by default for launches; JavaScript attaches enable children only when local debugger access is verified; `dapLaunchArgs: { subProcess: false }` or `{ autoAttachChildProcesses: false }` opts a launch out) is waited on as a tree: the answer's `sessionId` names the session that stopped — use it to inspect — and `children` lists the rest with their states.
  • **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. Keep each call under your MCP client's own request cap (45 s is safe under the common 60 s cap): a longer wait is several calls, not one long `timeout`, or the client times out first.
  • **Breakpoints may verify late.** Some adapters (debugpy, JDI) report breakpoints unverified until the module/class loads; that is normal, not an error.
  • **`<redacted:...>` placehold
Read more
@debugmcp
Ships withmcp-debugger

A headless, agentic debugger over MCP — let your AI agents debug running programs in ten languages.

Stars on GitHub

Momentum

stars in total
191
Star history of debugmcp/mcp-debugger on GitHub, a chart by star-history.com

More skills from other plugins.

cpu-high

cpu-high

排查 JVM / 应用 CPU 飙高(线程定位 + 代码路径分析)

arthas10d38k
@alibaba@alibabaInstall Skill
analyze-dump

analyze-dump

Triage a Windows crash dump - identify the exception, the faulting frame, and what to look at next. Use when the user points at a…

@svnscha@svnschaInstall Skill
d3k

d3k

Test and debug a web app in its existing d3k browser, including local Chrome connected to a Vercel Sandbox over CDP. Use for UI…

dev30009d1.6k
@vercel-labs-2@vercel-labs-2Install Skill

Questions about debugging.

Which coding agents can use debugging?
debugging installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.