dap-mcp-server

v0.1.19
dap-mcp-server Checked 7 hours ago Published 1 month ago

MCP 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.

ParameterTypeDescription
adapterstringAdapter to validate instead of auto-detecting one
cwdstringProject directory (default: server working directory)
verbosebooleanInclude 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.

ParameterTypeDescription
file *stringSource file containing the breakpoint
line *integerOne-based breakpoint line
adapterstringAdapter type; auto-detected from file/project when omitted
argsarrayProgram arguments
conditionstringConditional breakpoint expression
cwdstringProject and debuggee working directory
envobjectEnvironment variables
expressionsarrayExpressions to evaluate in the stopped frame
hitConditionstringAdapter-specific hit count condition
launchConfigobjectAdapter-specific DAP launch fields
programstringLaunch target; defaults to file for Python/Node and cwd for Go
timeoutnumberBreakpoint 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.

ParameterTypeDescription
program *stringPath or command for the adapter executable
type *stringAdapter type identifier (e.g. 'python', 'node', 'go')
argsarrayAdditional arguments to pass to the adapter
installHintstringHint shown when adapter is not installed
launchDefaultsobjectDefault launch configuration properties
portMatcherstringRegex whose first capture group is the TCP port
runtimestringOptional runtime to invoke the program (e.g. 'node', 'python3')
scopestringWhere to persist the adapter config (default: project)
transportstringDAP 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.

ParameterTypeDescription
adapter *stringAdapter type to use (e.g. 'python', 'node')
adapterConfigobjectOverride adapter config inline instead of looking up from registry
argsarrayProgram arguments
breakpointsarrayBreakpoints to set before launching
cwdstringWorking directory for the program
envobjectEnvironment variables
exceptionBreakpointsarrayException filter IDs (e.g. ['uncaughtExceptions'])
launchConfigobjectAdapter-specific DAP launch properties; explicit common fields take precedence
programstringPath to the program to debug; may instead be supplied through launchConfig
stopOnEntrybooleanStop on program entry. Defaults to false when breakpoints are provided (run to first breakpoint), true otherwise.
timeoutnumberWait timeout in milliseconds (default: 30000)
waitForStopbooleanWait 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.

ParameterTypeDescription
adapter *stringAdapter type to use
adapterConfigobjectOverride adapter config inline
attachConfigobjectArbitrary attach configuration properties
breakpointsarrayBreakpoints to bind before the debuggee resumes
exceptionBreakpointsarrayException filter IDs (e.g. ['uncaughtExceptions'])
hoststringHost to attach to (default: localhost)
portnumberDebug port to attach to
processIdnumberPID of process to attach to
timeoutnumberWait timeout in milliseconds (default: 30000)
waitForStopbooleanWait 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.

ParameterTypeDescription
breakpoints *arrayBreakpoints to set
file *stringAbsolute path to the source file
sessionIdstringSession ID (omit if only one session is active)

set_exception_breakpoints

Configure exception breakpoints for an active debug session.

ParameterTypeDescription
filters *arrayException filter IDs to enable (e.g. ['uncaughtExceptions', 'userUnhandledExceptions'])
sessionIdstringSession 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.

ParameterTypeDescription
depthnumberStack trace depth (default: 10)
detailstring'full' (default) or 'compact' (frame-local scopes only, slimmer JSON)
scopesarrayScope names to fetch, e.g. ['Registers']. Default: every scope except CPU registers; skipped ones are listed in omittedScopes
sessionIdstringSession ID (omit if only one session is active)
threadIdnumberThread ID (uses stopped thread if omitted)
timeoutnumberIf running, wait up to this many milliseconds for the program to stop (default: 0 = don't wait)
variableDepthnumberVariable expansion depth (default: 1)

evaluate

Evaluate an expression in the context of a stopped debug session.

ParameterTypeDescription
expression *stringExpression to evaluate
contextstringEvaluation context (default: repl)
frameIdnumberStack frame ID (uses topmost frame if omitted)
sessionIdstringSession 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.

ParameterTypeDescription
action *stringExecution control action
detailstring'compact' (default: frame-local scopes, short stack, slimmer JSON) or 'full' (same shape as get_state)
sessionIdstringSession ID (omit if only one session is active)
threadIdnumberThread ID (uses stopped thread if omitted)
timeoutnumberMilliseconds 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.

ParameterTypeDescription
categorystringFilter by output category: 'stdout', 'stderr', 'console', etc.
clearbooleanClear the output buffer after reading (default: false)
sessionIdstringSession ID (omit if only one session is active)
sincenumberReturn 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.

ParameterTypeDescription
sessionIdstringSession ID (omit if only one session is active)
terminateDebuggeebooleanWhether 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.

ParameterTypeDescription
sessionIdstringSession 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.

ParameterTypeDescription
adapter *stringAdapter type to use (e.g. 'python', 'node')
at *objectBreakpoint location to stop at
program *stringPath to the program to debug
adapterConfigobjectOverride adapter config inline
argsarrayProgram arguments
cwdstringWorking directory for the program
envobjectEnvironment variables
expressionsarrayExpressions to evaluate when stopped at the breakpoint. Omit to just verify the line is reached.
launchConfigobjectAdapter-specific DAP launch fields
timeoutnumberMilliseconds 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.

ParameterTypeDescription
sessionIdstringSession 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.

ParameterTypeDescription
adapter *stringAdapter type to use (e.g. 'python', 'node')
program *stringPath to the program to debug
adapterConfigobjectOverride adapter config inline
argsarrayProgram arguments
cwdstringWorking directory for the program
envobjectEnvironment variables
logpointsarrayLogpoints to emit per-hit messages without pausing execution
timeoutnumberTotal wall-clock timeout for the whole run in milliseconds (default: 60000)