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.
| Capability | debug.debug_attach |
|---|---|
| Area | Debugger |
| Access | changes ide, processes |
| Reaches | process, network |
| Rights | debug |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
runtimerequired | string | native (lldb-dap), python (debugpy), node (js-debug), java (java-debug, JDWP) or
go (Delve). |
pid | integer | Local process id (native, python, node, go).minimum 0 |
host | string | Host of a debug port (default 127.0.0.1 when port is given). |
port | integer | Debug port: JDWP, debugpy --listen, node --inspect, a gdb-remote server or a
dlv --headless server (on this machine only).minimum 0 · maximum 65535 |
breakpoints | array of object | Breakpoints set right after attaching. |
breakpoints[].pathrequired | string | Workspace-relative source file. |
breakpoints[].linerequired | integer | 1-based line.minimum 0 |
breakpoints[].condition | string | Stop only when this expression is true. |
breakpoints[].hit_condition | string | Stop only on this hit count (adapter syntax, e.g. 3 or >= 3). |
breakpoints[].log_message | string | Log this message ({expr} interpolated) instead of stopping. |
breakpoints[].enabled | boolean | false keeps the breakpoint out of the session, like a switched-off one (default true). |
exception_breakpoints | string | Stop on exceptions (SPEC-0146): caught (every thrown one), uncaught or both. |
exception_types | string | Only for these exception types, in the adapter's syntax. |
function_breakpoints | array of string | Stop on entry of these functions or methods. |
wait_seconds | integer | Seconds to wait for the first stop (default 30, at most 300); the program may go on running.minimum 0 |
dry_run | boolean | Only 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.
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"}