Skip to content

debug_attach

MCP tools › Debugger

Attach a debugger to a running program: native (lldb-dap), python (debugpy), node (js-debug), java (JDWP) or go (Delve), by pid or debug port. Breakpoints are set right after attaching, then it waits for the first stop. Dry run unless dry_run false, which needs the user-granted debug right and returns a session for debug_resume, debug_variables and debug_evaluate; debug_stop detaches and the program keeps running. Logged in .ferris-idea/agent-log.jsonl. Counts towards the 4 sessions.

Its results carry text from process, files: the client is told to treat that as data, never as instructions.

Capabilitydebug.debug_attach
AreaDebugger
Accesschanges ide, processes
Reachesprocess, network
Rightsdebug
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
runtimerequiredstringnative (lldb-dap), python (debugpy), node (js-debug), java (java-debug, JDWP) or go (Delve).
pidintegerLocal process id (native, python, node, go).minimum 0
hoststringHost of a debug port (default 127.0.0.1 when port is given).
portintegerDebug port: JDWP, debugpy --listen, node --inspect, a gdb-remote server or a dlv --headless server (on this machine only).minimum 0 · maximum 65535
breakpointsarray of objectBreakpoints set right after attaching.
breakpoints[].pathrequiredstringWorkspace-relative source file.
breakpoints[].linerequiredinteger1-based line.minimum 0
breakpoints[].conditionstringStop only when this expression is true.
breakpoints[].hit_conditionstringStop only on this hit count (adapter syntax, e.g. 3 or >= 3).
breakpoints[].log_messagestringLog this message ({expr} interpolated) instead of stopping.
breakpoints[].enabledbooleanfalse keeps the breakpoint out of the session, like a switched-off one (default true).
exception_breakpointsstringStop on exceptions (SPEC-0146): caught (every thrown one), uncaught or both.
exception_typesstringOnly for these exception types, in the adapter's syntax.
function_breakpointsarray of stringStop on entry of these functions or methods.
wait_secondsintegerSeconds to wait for the first stop (default 30, at most 300); the program may go on running.minimum 0
dry_runbooleanOnly show the attach request (default true); false attaches and needs the debug right.

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project debug_attach '{"runtime":"<string>"}'
Input schema as JSON
{
"properties": {
"runtime": {
"description": "`native` (lldb-dap), `python` (debugpy), `node` (js-debug), `java` (java-debug, JDWP) or\n`go` (Delve).",
"type": "string"
},
"pid": {
"description": "Local process id (native, python, node, go).",
"type": [
"integer",
"null"
],
"minimum": 0
},
"host": {
"description": "Host of a debug port (default 127.0.0.1 when `port` is given).",
"type": [
"string",
"null"
]
},
"port": {
"description": "Debug port: JDWP, `debugpy --listen`, `node --inspect`, a gdb-remote server or a\n`dlv --headless` server (on this machine only).",
"type": [
"integer",
"null"
],
"maximum": 65535,
"minimum": 0
},
"breakpoints": {
"description": "Breakpoints set right after attaching.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/DebugBreakpointArg"
}
},
"exception_breakpoints": {
"description": "Stop on exceptions (SPEC-0146): `caught` (every thrown one), `uncaught` or `both`.",
"type": [
"string",
"null"
]
},
"exception_types": {
"description": "Only for these exception types, in the adapter's syntax.",
"type": [
"string",
"null"
]
},
"function_breakpoints": {
"description": "Stop on entry of these functions or methods.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"wait_seconds": {
"description": "Seconds to wait for the first stop (default 30, at most 300); the program may go on running.",
"type": [
"integer",
"null"
],
"minimum": 0
},
"dry_run": {
"description": "Only show the attach request (default true); false attaches and needs the `debug` right.",
"type": [
"boolean",
"null"
]
}
},
"$defs": {
"DebugBreakpointArg": {
"description": "A breakpoint for `debug_start`.",
"type": "object",
"properties": {
"path": {
"description": "Workspace-relative source file.",
"type": "string"
},
"line": {
"description": "1-based line.",
"type": "integer",
"minimum": 0
},
"condition": {
"description": "Stop only when this expression is true.",
"type": [
"string",
"null"
]
},
"hit_condition": {
"description": "Stop only on this hit count (adapter syntax, e.g. `3` or `>= 3`).",
"type": [
"string",
"null"
]
},
"log_message": {
"description": "Log this message (`{expr}` interpolated) instead of stopping.",
"type": [
"string",
"null"
]
},
"enabled": {
"description": "false keeps the breakpoint out of the session, like a switched-off one (default true).",
"type": [
"boolean",
"null"
]
}
},
"required": [
"path",
"line"
]
}
},
"required": [
"runtime"
],
"type": "object"
}