dap-mcp-server
v0.1.19MCP server wrapping the Debug Adapter Protocol for AI-driven debugging
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
debug_doctor Check debugger readiness
Inspect a local project, detect its language/tooling, select the likely debug adapter, verify the complete adapter command, and return concrete remediation. Use this before debugging or when an adapter fails to start.
| Parameter | Type | Description |
|---|---|---|
adapter | string | Adapter to validate instead of auto-detecting one |
cwd | string | Project directory (default: server working directory) |
verbose | boolean | Include full details for every known adapter, not just the selected one |
debug_at Inspect runtime state at a line
Primary one-shot debugging tool for bugs and failing behavior. Auto-selects a ready adapter, launches the program, stops at file:line, evaluates expressions, reports breakpoint/termination/timeout details, and cleans up.
| Parameter | Type | Description |
|---|---|---|
file * | string | Source file containing the breakpoint |
line * | integer | One-based breakpoint line |
adapter | string | Adapter type; auto-detected from file/project when omitted |
args | array | Program arguments |
condition | string | Conditional breakpoint expression |
cwd | string | Project and debuggee working directory |
env | object | Environment variables |
expressions | array | Expressions to evaluate in the stopped frame |
hitCondition | string | Adapter-specific hit count condition |
launchConfig | object | Adapter-specific DAP launch fields |
program | string | Launch target; defaults to file for Python/Node and cwd for Go |
timeout | number | Breakpoint wait timeout in milliseconds |
list_adapters
List all known debug adapters with their availability status on this machine. Returns a summary line, the full adapter list, and a separate 'missing' list with installation hints for adapters that aren't installed.
configure_adapter
Register or update a debug adapter configuration and persist it to disk.
| Parameter | Type | Description |
|---|---|---|
program * | string | Path or command for the adapter executable |
type * | string | Adapter type identifier (e.g. 'python', 'node', 'go') |
args | array | Additional arguments to pass to the adapter |
installHint | string | Hint shown when adapter is not installed |
launchDefaults | object | Default launch configuration properties |
portMatcher | string | Regex whose first capture group is the TCP port |
runtime | string | Optional runtime to invoke the program (e.g. 'node', 'python3') |
scope | string | Where to persist the adapter config (default: project) |
transport | string | DAP transport used by the adapter |
debug_launch
Launch an interactive debug session. With a breakpoint or stopOnEntry, waits by default and reports whether execution stopped, terminated, or timed out.
| Parameter | Type | Description |
|---|---|---|
adapter * | string | Adapter type to use (e.g. 'python', 'node') |
adapterConfig | object | Override adapter config inline instead of looking up from registry |
args | array | Program arguments |
breakpoints | array | Breakpoints to set before launching |
cwd | string | Working directory for the program |
env | object | Environment variables |
exceptionBreakpoints | array | Exception filter IDs (e.g. ['uncaughtExceptions']) |
launchConfig | object | Adapter-specific DAP launch properties; explicit common fields take precedence |
program | string | Path to the program to debug; may instead be supplied through launchConfig |
stopOnEntry | boolean | Stop on program entry. Defaults to false when breakpoints are provided (run to first breakpoint), true otherwise. |
timeout | number | Wait timeout in milliseconds (default: 30000) |
waitForStop | boolean | Wait for stopped/terminated outcome; defaults to true when a stop is expected |
debug_attach
Attach a debug adapter to an already-running process. Pass breakpoints here rather than afterwards: they bind before the debuggee resumes, which is the only reliable way to stop a process started suspended (e.g. JDWP suspend=y). With breakpoints or exception breakpoints, waits and reports stopped, terminated, or timeout.
| Parameter | Type | Description |
|---|---|---|
adapter * | string | Adapter type to use |
adapterConfig | object | Override adapter config inline |
attachConfig | object | Arbitrary attach configuration properties |
breakpoints | array | Breakpoints to bind before the debuggee resumes |
exceptionBreakpoints | array | Exception filter IDs (e.g. ['uncaughtExceptions']) |
host | string | Host to attach to (default: localhost) |
port | number | Debug port to attach to |
processId | number | PID of process to attach to |
timeout | number | Wait timeout in milliseconds (default: 30000) |
waitForStop | boolean | Wait for stopped/terminated outcome; defaults to true when breakpoints or exception breakpoints are given |
set_breakpoints
Set breakpoints in a source file for an active debug session.
| Parameter | Type | Description |
|---|---|---|
breakpoints * | array | Breakpoints to set |
file * | string | Absolute path to the source file |
sessionId | string | Session ID (omit if only one session is active) |
set_exception_breakpoints
Configure exception breakpoints for an active debug session.
| Parameter | Type | Description |
|---|---|---|
filters * | array | Exception filter IDs to enable (e.g. ['uncaughtExceptions', 'userUnhandledExceptions']) |
sessionId | string | Session ID (omit if only one session is active) |
get_state
Get the current state of a debug session. If stopped, returns full stack/scopes/variables. If running, returns status and buffered output.
| Parameter | Type | Description |
|---|---|---|
depth | number | Stack trace depth (default: 10) |
detail | string | 'full' (default) or 'compact' (frame-local scopes only, slimmer JSON) |
scopes | array | Scope names to fetch, e.g. ['Registers']. Default: every scope except CPU registers; skipped ones are listed in omittedScopes |
sessionId | string | Session ID (omit if only one session is active) |
threadId | number | Thread ID (uses stopped thread if omitted) |
timeout | number | If running, wait up to this many milliseconds for the program to stop (default: 0 = don't wait) |
variableDepth | number | Variable expansion depth (default: 1) |
evaluate
Evaluate an expression in the context of a stopped debug session.
| Parameter | Type | Description |
|---|---|---|
expression * | string | Expression to evaluate |
context | string | Evaluation context (default: repl) |
frameId | number | Stack frame ID (uses topmost frame if omitted) |
sessionId | string | Session ID (omit if only one session is active) |
step
Control execution of a debug session: continue, step over (next), step into, step out, or pause. Waits for the program to stop and returns the new state.
| Parameter | Type | Description |
|---|---|---|
action * | string | Execution control action |
detail | string | 'compact' (default: frame-local scopes, short stack, slimmer JSON) or 'full' (same shape as get_state) |
sessionId | string | Session ID (omit if only one session is active) |
threadId | number | Thread ID (uses stopped thread if omitted) |
timeout | number | Milliseconds to wait for the program to stop after the action (default: 30000) |
get_output
Get buffered stdout/stderr and debug adapter output for a session. Pass `since` (the `nextSince` from a previous call) to get only newly-emitted entries — useful for polling logpoint output without re-reading the full buffer.
| Parameter | Type | Description |
|---|---|---|
category | string | Filter by output category: 'stdout', 'stderr', 'console', etc. |
clear | boolean | Clear the output buffer after reading (default: false) |
sessionId | string | Session ID (omit if only one session is active) |
since | number | Return only entries with seq > since. Pass the `nextSince` value from a prior call to fetch incremental output. |
debug_disconnect
Disconnect from a debug session and optionally terminate the debuggee.
| Parameter | Type | Description |
|---|---|---|
sessionId | string | Session ID (omit if only one session is active) |
terminateDebuggee | boolean | Whether to terminate the debuggee process (default: true for launched sessions, false for attached) |
debug_restart
Restart a debug session with the same adapter and launch configuration.
| Parameter | Type | Description |
|---|---|---|
sessionId | string | Session ID to restart (omit if only one session is active) |
debug_inspect
One-shot inspection: launch a program, run to a breakpoint, evaluate a list of expressions in that frame, then disconnect. Collapses launch + wait + evaluate + disconnect into a single call. Use for 'what is X at line N?' debugging.
| Parameter | Type | Description |
|---|---|---|
adapter * | string | Adapter type to use (e.g. 'python', 'node') |
at * | object | Breakpoint location to stop at |
program * | string | Path to the program to debug |
adapterConfig | object | Override adapter config inline |
args | array | Program arguments |
cwd | string | Working directory for the program |
env | object | Environment variables |
expressions | array | Expressions to evaluate when stopped at the breakpoint. Omit to just verify the line is reached. |
launchConfig | object | Adapter-specific DAP launch fields |
timeout | number | Milliseconds to wait for the breakpoint to be hit (default: 30000) |
list_breakpoints
List the breakpoints currently registered with a session, grouped by source file. Includes regular breakpoints, conditional breakpoints, and logpoints.
| Parameter | Type | Description |
|---|---|---|
sessionId | string | Session ID (omit if only one session is active) |
debug_run
Launch a program with no stops, let it run to completion, and return all stdout/stderr/console output. Optionally inject logpoints (breakpoints with logMessage) for printf-style debugging without modifying source. Use for 'what does this script actually do?' cases where you don't need to inspect intermediate state.
| Parameter | Type | Description |
|---|---|---|
adapter * | string | Adapter type to use (e.g. 'python', 'node') |
program * | string | Path to the program to debug |
adapterConfig | object | Override adapter config inline |
args | array | Program arguments |
cwd | string | Working directory for the program |
env | object | Environment variables |
logpoints | array | Logpoints to emit per-hit messages without pausing execution |
timeout | number | Total wall-clock timeout for the whole run in milliseconds (default: 60000) |