qwen-dap-mcp
One-line summary: qwen-dap-mcp is an MCP server that bridges Debug Adapter Protocol to expose native runtime debugging, crash/hang diagnosis, and bounded agent workflows to coding agents.
Manage isolated DAP sessions (create/list/close) and route tools by sessionId.
Diagnose native crashes with high-level workflows (current stop, live, CodeLLDB/lldb-dap/GDB, dump) and optional bounded autonomous fix/verify loops.
Triage hangs/deadlocks with all-thread stacks, wait-state heuristics, and pointer provenance.
Compare two stopped sessions semantically (baseline vs candidate) while ignoring ASLR noise.
Trace suspicious values and object lifetime using watchpoints/data breakpoints and optional reverse execution.
Probe live targets for progress/busy loops via resume/pause sampling.
Build structured runtime reports with crash fingerprints, symbols, sanitizer correlation, ABI analysis, hypotheses, and breakpoint plans.
Capture bounded snapshots of stack, locals, registers, disassembly, modules, exception info, and symbol health.
Run a launch/attach target to the next stop/exit and capture evidence.
Open Windows minidumps/core files read-only via CodeLLDB/lldb-dap/GDB.
Correlate source with disassembly and find the writer of a watched value.
Collect adaptive evidence in cheap-to-full phases.
Inspect session status and disconnect/terminate debuggee with explicit controls.
Default surface is 18 core agent-oriented tools; forensics/full toolsets can be enabled via environment variables.
Provides integration with LLVM's lldb-dap debugger adapter for native runtime debugging, live launch/attach workflows, and read-only core-file/minidump analysis, enabling stack, register, local variable, exception, module, disassembly, memory, and source-correlation evidence collection for crash diagnosis and bounded autonomous fix/verify cycles.
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., "@qwen-dap-mcp Launch the C++ binary, set a breakpoint at main, and take a debug snapshot"
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.
qwen-dap-mcp
Give coding agents a real native debugger.
qwen-dap-mcp is a local Debug Adapter Protocol (DAP) → Model Context Protocol (MCP) bridge for native crash debugging, hang/deadlock triage, crash dumps, differential runtime analysis, remote targets, and bounded fix/verify workflows.
Built for Qwen Code, usable from any stdio MCP client, and designed to expose debugger evidence without turning MCP into a general-purpose shell.
Quick start · Capabilities · Debugger support · Safety · Docs · Contributing
Why this exists
Coding agents can read source and propose patches, but native failures often cannot be diagnosed reliably from source alone. The useful evidence lives at runtime: thread stacks, registers, locals, disassembly, exception state, modules, memory, wait states, symbols, and crash dumps.
qwen-dap-mcp makes that evidence available through MCP and adds agent-oriented workflows on top of raw debugger primitives:
Evidence first — inspect the actual failing process instead of guessing from source.
High-level workflows — crash, hang, differential, causal tracing, progress probing, runtime-report, dump, and verification tools are designed for agents rather than humans driving a debugger console.
Bounded automation — autonomous fix/verify state is explicit, serializable, iteration-limited, and re-checks the original reproduction.
Small default surface — 18 core agent tools stay visible by default; forensic workflows and raw DAP controls are separate opt-in tiers.
Local by default — the MCP server communicates over stdio and debugger adapters run locally unless you explicitly configure a validated remote target.
Related MCP server: DebugPilot
Quick start
Qwen Code
Install directly from GitHub:
qwen extensions install SLP-DEV1/qwen-dap-mcpOr install the published npm package:
qwen extensions install @slp-dev1/qwen-dap-mcpThen verify the extension:
/mcp
/skillsYou should see the qwen-dap-mcp server and the bundled native-runtime-debug skill.
Any stdio MCP client
npx -y @slp-dev1/qwen-dap-mcpTypical configuration:
{
"mcpServers": {
"qwen-dap-mcp": {
"command": "npx",
"args": ["-y", "@slp-dev1/qwen-dap-mcp"]
}
}
}CLI discovery is available without starting the stdio server:
qwen-dap-mcp --help
qwen-dap-mcp --version30-second example
You: Debug why app.exe crashes with --repro
Coding agent
↓
qwen-dap-mcp starts a DAP debugger
↓
captures the native failure + project-controlled frame
↓
correlates stack + registers + locals + disassembly
↓
backtracks runtime evidence toward the likely producer
↓
agent applies a minimal source fix
↓
builds and repeats the original reproduction
↓
verifies whether the original crash fingerprint is goneThe MCP server supplies debugger evidence and bounded workflow state. Source editing, builds, tests, and source-control operations stay with the coding agent's normal authorized tools.
What it does
Problem | Agent-oriented capability |
Native crash | Diagnose a stopped process, identify project frames, collect runtime evidence, and drive bounded fix/verify loops |
Hang or deadlock | Observe, pause when needed, capture all-thread stacks, classify waits, and surface conservative deadlock candidates |
Good run vs bad run | Compare stopped sessions semantically while suppressing raw ASLR/address noise |
Suspicious value | Trace real writers with data breakpoints/watchpoints and bounded temporal tracing |
Runtime causality | Build a bounded suspicious-value consumer → writer/producer chain with |
Suspected busy loop | Resume/pause sample a live target with |
Record/replay target | Move backward with capability-gated |
Crash fleet triage | Build |
Child/fork signal | Inspect fail-closed adapter |
Crash dump | Inspect Windows minidumps and supported LLDB/GDB postmortem targets without launching the failed program |
Remote native target | Attach through validated |
Multiple targets | Keep isolated DAP sessions and route requests by |
Agent safety | Keep the default surface high-level and optionally gate executable/mutating DAP actions with HOL Guard |
Object lifetime / UAF | Correlate pointer writers, sanitizer evidence, reverse stepping, and allocation/free hints |
Symbol mismatch | Compare adapter symbol state with bounded local binary/PDB identity evidence |
Crash fleets | Batch postmortem analysis plus exact/semantic/family grouping |
Offline handoff | Export structured evidence and SARIF without keeping the target alive |
Tool surfaces
The default agent toolset intentionally exposes 18 core tools so coding models spend less context and selection effort on rarely needed forensic workflows.
Core tool | Purpose |
| High-level native crash diagnosis and bounded autonomous verification |
| High-level hang/deadlock triage |
| Semantic comparison of baseline and failing stopped sessions |
| Bounded temporal tracing of a suspicious value |
| Consumer-to-writer producer evidence for suspicious runtime state |
| Resume/pause sampling for no-progress and busy-loop triage |
| Fingerprints, symbols, sanitizer evidence, memory hazards, ABI/API analysis, hypotheses, and breakpoint planning |
| Object/pointer lifetime and writer provenance |
| Cheap → medium → full bounded evidence collection |
| Diagnose the current debugger stop |
| Correlate source with nearby native instructions |
| Stop at the code that writes a watched value |
| Continue/launch toward a bounded meaningful stop |
| Open supported postmortem dump/core targets |
| Capture structured runtime evidence |
| Inspect debugger/session state |
| Cleanly end a debugger session |
| Create, inspect, and remove isolated sessions |
Set QWEN_DAP_MCP_TOOLSET=forensics when deeper investigation is needed. It keeps the raw manual DAP surface hidden while adding:
Forensics-only tool | Purpose |
| Capability-gated reverseContinue / stepBack |
| Cluster normalized crash reports |
| Classify original/changed/inconclusive reproductions |
| Inspect fail-closed child/fork reverse requests |
| Explicitly adopt one reviewed |
| Bounded rr recording/replay planning and reverse workflows |
| Multi-thread progress and explicit-owner lock graph |
| Binary identity, local symbols, and PDB/DWARF mismatch diagnosis |
| Bounded crash-dump fleet analysis |
| Exact/semantic/family crash comparison |
| Read-only C++ object/vtable inspection |
| JSON/Markdown/SARIF evidence handoff |
| Adapter capability, rr, and security-profile audit |
Set QWEN_DAP_MCP_TOOLSET=full only when raw stacks/scopes/variables, manual breakpoints/watchpoints, evaluate, memory reads, stepping, or adapter-specific controls are intentionally required. See docs/toolsets.md.
Debugger support
Adapter / target | Supported use |
CodeLLDB | Local native launch/attach and Windows minidump workflows |
LLVM | Native launch/attach, core-file inspection, and |
GNU GDB 14+ DAP | Native launch/attach, core-file workflows, and hardened |
Adapter discovery, prerequisites, and platform-specific setup are documented in docs/README.md.
More than raw DAP
Raw DAP is intentionally low level. qwen-dap-mcp keeps raw debugger access available in the full toolset, but its default surface focuses on workflows an agent can reason about directly.
Source only | Raw DAP | qwen-dap-mcp agent tools | |
Runtime debugger evidence | — | ✓ | ✓ |
High-level crash diagnosis | — | — | ✓ |
All-thread hang triage | — | manual | ✓ |
Good-vs-bad semantic diff | — | manual | ✓ |
Explicit bounded fix/verify state | — | — | ✓ |
Verification fingerprinting | — | — | ✓ |
Causal writer chain | — | manual | ✓ |
Progress sampling / busy-loop triage | — | manual | ✓ |
Sanitizer + symbols + ABI report correlation | — | manual | ✓ |
Safety by design
A debugger can execute and mutate target state, so the bridge treats that power explicitly.
No arbitrary shell tool is exposed by the MCP server.
No source-writing primitive is exposed by the MCP server.
No general memory-write primitive is part of the default agent surface.
Remote endpoints are validated and non-loopback access requires explicit allowlisting.
Autonomous workflow state is explicit rather than hidden inside a background loop.
Optional HOL Guard 2.2+ integration can fail closed before protected adapter startup or executable/mutating DAP actions cross the debugger boundary.
Read the full policy and threat model in docs/hol-guard.md and SECURITY.md.
Repro labs and benchmark harness
The repository includes deterministic native fixtures so behavior can be tested instead of demonstrated only with screenshots:
npm run demo:build -- null-pointer
npm run demo:repro -- null-pointer
npm run demo:hang:build -- deadlock
npm run demo:hang:repro -- deadlockbenchmark/ also contains a reproducible comparison harness for source-only, dap-raw, and qwen-dap-mcp workflows. It deliberately ships without invented performance numbers; publishable results should record the exact model, settings, commit, reproduction, raw outcome, and verification status.
Documentation
Start with the documentation index.
Topic | Guide |
CodeLLDB on Windows | |
LLVM | |
GNU GDB DAP | |
Remote debugging | |
Hang/deadlock analysis | |
Differential debugging | |
Runtime debugging v2 | |
Agent vs full toolsets | |
HOL Guard integration | |
Publishing / releases |
Development
Requirements: Node.js 20+.
git clone https://github.com/SLP-DEV1/qwen-dap-mcp.git
cd qwen-dap-mcp
npm ci
npm run checknpm run check builds TypeScript, runs the test suite, and validates the self-contained Qwen extension package. CI additionally exercises native crash/hang fixtures, adapter-specific real smoke tests, package output, HOL Guard compatibility, and the container build.
See CONTRIBUTING.md before opening a pull request.
Distribution
Published as:
npm:
@slp-dev1/qwen-dap-mcpMCP Registry:
io.github.SLP-DEV1/qwen-dap-mcpQwen Code extension:
qwen extensions install SLP-DEV1/qwen-dap-mcpGitHub Releases: self-contained extension archives
Current release details are in CHANGELOG.md and GitHub Releases.
Contributing
Bug reports, reproducible native failure cases, adapter compatibility findings, documentation fixes, and focused feature proposals are welcome. Please keep additions evidence-driven and prefer high-level agent workflows over expanding the default surface with raw debugger commands.
If this project saves you a debugging session, consider starring the repository — it helps other MCP and coding-agent users discover it.
License
Available Tools
18 toolsdebug_adaptive_evidenceCollect Adaptive Runtime EvidenceARead-onlyIdempotent
Collect runtime evidence in progressively richer bounded phases instead of immediately requesting a maximal snapshot. Use it when token/DAP cost matters or the amount of evidence needed is unknown: it starts with stack and small locals, expands only when symbols, exception state, or variables are insufficient, and finishes with a full runtime report when needed. Do not use it to replace deliberate deep inspection when the required evidence is already known.
Inputs: forceFull, sessionId, maxVariables. Returns: report, snapshot, selectedPhase, evidenceBudget, +1 more
debug_causal_traceTrace Runtime CausalityADestructive
Build a bounded consumer-to-writer evidence chain for one suspicious debugger-visible value. Use it after crash or differential evidence identifies a value whose runtime producers matter. It combines the current stopped snapshot with repeated watchpoint writer tracing. Do not use it for frozen dumps or unsafe-to-resume targets, and do not treat an observed writer as automatic proof of root cause.
Inputs: name (required), maxDepth, maxStops, sessionId, +1 more. Returns: query, trace, consumer, conclusion, +2 more
debug_compare_runsARead-onlyIdempotent
Compare bounded runtime evidence from two existing stopped DAP sessions. Use this for baseline or known-good versus candidate or failing differential debugging after both sessions have reached comparable stops. It compares stack identities, locals, registers, exception state, symbol health, and modules semantically; non-null raw address-only changes are marked unstable rather than causal evidence. Do not use it to launch, resume, or alter either target; prepare both runtime states with the normal lifecycle tools first.
Inputs: baselineSessionId (required), candidateSessionId (required), snapshot, timeoutMs. Returns: diff, baseline, guidance, candidate, +3 more
debug_diagnose_stopDiagnose Current Debug StopARead-onlyIdempotent
Diagnose an already stopped live or postmortem debug session without changing execution state. Use this when a debugger has captured the failure and you want project-frame selection, crash classification, operand/register/variable bindings, call-chain provenance, ranked hypotheses, and a fix/rebuild/reproduce/verify plan; use debug_snapshot instead when only raw evidence is needed. The tool is read-only and returns both the bounded snapshot and the derived diagnosis, including collection limitations when optional debugger evidence is unavailable.
Inputs: analysis, threadId, sessionId, moduleCount, +7 more. Returns: snapshot, diagnosis
debug_disconnectDisconnect DebuggerADestructive
End the active DAP session and stop its local adapter process. Use this when debugging is finished or the session must be reset; do not call it when more runtime evidence is still needed. With terminateDebuggee=true it may also terminate a live target process, so this operation can destroy the current runtime state and cannot be treated as read-only.
Inputs: sessionId, terminateDebuggee. Returns: disconnected
debug_find_writerFind Runtime WriterADestructive
Temporarily watch a variable or debugger expression, resume an authorized live target, and capture the first resulting stop to identify the immediate writer candidate. Use this after a stopped-state diagnosis suggests a value was corrupted and runtime provenance is needed; do not use it for crash dumps or when resuming is unsafe. Adapters with DAP data-breakpoint support use that protocol directly; GDB 14/15 uses a bounded watch/rwatch/awatch command through DAP REPL because those releases do not advertise native data breakpoints. The tool removes only the temporary watch it created and never automatically continues through an unrelated stop.
Inputs: name (required), frameId, snapshot, threadId, +7 more. Returns: query, before, status, outcome, +11 more
debug_open_dumpOpen Native Crash DumpARead-onlyIdempotent
Open a local native core/minidump with CodeLLDB, upstream LLVM lldb-dap, or GNU GDB DAP and capture bounded postmortem evidence. Use this when the failure is already recorded and no target process should execute; use debug_run_to_stop or debug_this_crash for a live reproduction instead. The tool starts only the selected local debugger adapter, never launches or resumes the crashed program, treats the dump as read-only, and returns the initial stack/locals/registers plus optional modules and disassembly.
Inputs: dumpPath (required), cwd, adapter, program, +10 more. Returns: mode, attach, adapter, program, +6 more
debug_progress_probeProbe Runtime ProgressADestructive
Sample a live target across short resume/pause intervals to distinguish no observed progress, same-frame execution movement, and probable busy loops. Use it when a process appears hung but a single thread snapshot cannot distinguish blocking from spinning. Do not use it when resuming the target is unsafe; sampling perturbs scheduling and is not proof of application-level progress.
Inputs: samples, threadId, sessionId, intervalMs. Returns: status, samples, captures, evidence, +3 more
debug_runtime_reportBuild Runtime Debug ReportARead-onlyIdempotent
Create a shareable structured report from the current stopped target with normalized crash fingerprinting, Symbol Doctor status, sanitizer stderr correlation, poison-pattern memory hazard detection, ABI register-to-argument mapping, and recent debugger output. Use it only for evidence-driven triage and issue handoff. Do not treat heuristic poison patterns, ABI mappings, or sanitizer text correlation as standalone proof.
Inputs: abi, sessionId, redactPaths, includeOutputTail. Returns: abi, frameKey, snapshot, sanitizer, +12 more
debug_run_to_stopRun Until Debug Stop or ExitADestructive
Run one live launch or attach through an already initialized DAP adapter until the first stopped, exited, or terminated event. Use this when you need deterministic runtime evidence from a reproduction; do not use it for a postmortem dump or when executing/attaching to the local target is not authorized. Launch mode executes application code and attach mode changes debugger control of an existing process, so normal target side effects may occur before the stop. Returns the request result, terminal/stopped outcome, session status, and a bounded snapshot only when a stopped event is captured.
Inputs: configuration (required), request, snapshot, sessionId, +2 more. Returns: status, outcome, request, snapshot, +1 more
debug_sessionsManage Debug SessionsADestructive
Use this tool to list, create, or close isolated DAP sessions before routing other debugger tools with sessionId. Omit sessionId on normal debug tools only when the backward-compatible default session is intended; do not use a global session selector for concurrent work.
Inputs: action, sessionId, terminateDebuggee. Returns: action, removed, sessions, sessionId, +2 more
debug_snapshotCapture Runtime Debug SnapshotARead-onlyIdempotent
Capture bounded evidence from the current stopped debug state without resuming execution. Use this when an agent needs raw stack, locals, registers, exception details, modules, or nearby instructions; prefer debug_diagnose_stop when you also want ranked crash hypotheses and project-frame selection. This is read-only with respect to the debuggee and returns best-effort evidence plus collection errors for optional data that an adapter cannot provide.
Inputs: threadId, sessionId, moduleCount, stackLevels, +6 more. Returns: frame, stack, locals, scopes, +9 more
debug_source_disassemblyCorrelate Source and DisassemblyARead-onlyIdempotent
Correlate source locations, disassembly, registers, and pointer-like locals for the raw fault frame and the first likely project-controlled frame. Use this for low-level root-cause evidence when a crash is already stopped and instruction/operand provenance matters; prefer debug_diagnose_stop for a broader ranked diagnosis. This is read-only, does not resume the target, and returns frame-selection reasoning, both correlations, operand bindings, and any best-effort collection errors.
Inputs: analysis, threadId, sessionId, stackLevels, +2 more. Returns: projectFrame, frameSelection, operandAnalysis, collectionErrors, +2 more
debug_statusDebug Session StatusARead-onlyIdempotent
Inspect debugger lifecycle state, the selected stop, recent DAP events, and bounded adapter stderr without changing target execution. Use this to determine whether a session is initialized, running, stopped, postmortem, exited, or failed before choosing another debug tool; it is diagnostic only and does not resume, launch, attach, or terminate the debuggee.
Inputs: no named parameters. Returns: adapterId, adapterPid, configured, initialized, +5 more
debug_this_crashDebug This CrashADestructive
Preferred high-level native crash workflow. Use mode=current for an already stopped session, dump for read-only postmortem analysis, codelldb to discover CodeLLDB, lldb-dap to discover upstream LLVM lldb-dap, gdb to discover GNU GDB built-in DAP interpreter, or live with an already initialized generic DAP adapter. Do not use codelldb/lldb-dap/gdb/live when executing or attaching to the target is not authorized: those modes can run application code and cause its normal side effects, while current/dump only inspect stopped evidence. workflow.stage selects initial diagnosis, verification against a prior baseline, or the bounded autonomous cycle. Returns runtime evidence, diagnosis, verification/autonomous metadata, and debugger status with deterministic fixed/blocked/budget-exhausted outcomes where applicable.
Inputs: cwd, env, args, mode, +15 more. Returns: mode, status, workflow, diagnosis
debug_this_hangDebug This HangADestructive
High-level native hang workflow for all-thread triage. Use it when a live process appears stuck, deadlocked, waiting forever, or spinning and you need bounded stacks from every thread, wait-state/deadlock heuristics, and cross-thread Pointer-Provenance v2. In current mode it inspects an existing configured session and pauses a running live target when necessary; codelldb, lldb-dap, gdb, and live modes can launch or attach to an authorized local target, observe it for a bounded interval, then pause it for evidence. Do not use executable/attach modes when target execution or debugger control is not authorized, and do not treat a deadlock-candidate as a proven lock cycle because generic DAP does not expose portable lock ownership.
Inputs: cwd, env, pid, args, +16 more. Returns: mode, status, evidence, diagnosis, +1 more
debug_trace_lifetimeTrace Object LifetimeADestructive
Trace lifetime evidence for one debugger-visible pointer or object handle using the current snapshot, sanitizer/runtime output, bounded forward writer tracing, and optional reverse stepping when supported. Use this for suspected use-after-free, stale ownership, or unexpected pointer replacement. Do not use forward tracing on a frozen dump or when resuming the target is unsafe.
Inputs: name (required), maxStops, direction, sessionId, +2 more. Returns: query, initial, guidance, sanitizer, +4 more
debug_trace_valueTrace Runtime Value WritesADestructive
Build a bounded temporal write timeline for one debugger-visible variable or expression. Use this after differential or crash evidence identifies a suspicious value and repeated live-target resume is safe. The tool installs one temporary data breakpoint or watchpoint at a time, resumes to the next confirmed writer, captures bounded runtime evidence, removes only its own temporary watch, and repeats. Do not use it for crash dumps, unsafe-to-resume targets, or as proof that an observed writer is the root cause; it stops on unrelated debugger events rather than continuing through them.
Inputs: name (required), maxStops, snapshot, threadId, +4 more. Returns: query, events, status, guidance, +3 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Several tools cluster around the same activity: stopped-state evidence (snapshot, diagnose_stop, runtime_report, adaptive_evidence, source_disassembly) and writer tracing (find_writer, trace_value, causal_trace, trace_lifetime). The descriptions include explicit use-case guardrails and 'do not use' guidance, which helps, but an agent would need to read carefully to avoid picking the wrong tool.
All tools share the debug_ prefix and use snake_case, with most following a verb_noun pattern like debug_run_to_stop, debug_open_dump, and debug_disconnect. A few exceptions such as debug_this_crash, debug_this_hang, and simple noun forms like debug_status and debug_sessions break the strict pattern, but the overall convention remains predictable.
Eighteen tools is above the ideal 3-15 range, but the server covers a broad debugging domain including session lifecycle, crash/hang workflows, postmortem dumps, snapshotting, tracing, comparison, and reporting. The count feels slightly heavy rather than bloated, and each tool appears to have a distinct role.
The tool surface covers the core debug lifecycle: session management, launch/attach/run-to-stop, crash and hang triage, dump analysis, evidence capture, diagnosis, tracing, comparison, and disconnect. Minor gaps exist around explicit breakpoint management, stepping controls, and standalone expression evaluation, but those are outside the server's evident evidence-focused purpose.
Maintenance
Related MCP Connectors
Build, run, inspect, and continue AgentScript workflows on connected Super Chrome and Mac clients.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables coding agents to use a real debugger (Python via debugpy) for launching, attaching, setting breakpoints, stepping through code, inspecting stack frames, and evaluating expressions through MCP tools.1227MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to inspect debug state, control execution, and set breakpoints in VS Code by exposing the Debug Adapter Protocol as an MCP server.Apache 2.0
- AlicenseAqualityDmaintenanceGenerates GCP architecture diagrams, sequence diagrams, flow charts, and class diagrams using Python diagrams DSL via MCP.31Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables launching and controlling a debugpy debug session through MCP, including setting breakpoints, stepping, evaluating expressions, and observing debugger state and events.MIT