From c80140768914249a5a916890e5551b81d6c1b827 Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 29 Nov 2026 17:15:48 -0500 Subject: [PATCH 1/5] fix: keep the Java attach guidance and the port probe on loopback, with a guard (#1389) The text an agent reads before attaching to a JVM told it to start the JVM with address=*:, which opens the unauthenticated JDWP port on every interface. The attach_to_process description, the Java adapter's attach hint, the workflow prompt and the debugging skill now say address=127.0.0.1:. The 24 tool-list snapshots follow. The per-session free-port probe listened with no host, which binds every interface for a tick. It binds 127.0.0.1, the address every adapter then binds. A guard in the unit suite scans the shipped sources and the agent-facing text for address=*, 0.0.0.0 and a listen call that names no loopback host, and compares what it finds with a recorded list of reviewed lines, each with a reason. A new occurrence fails; so does a recorded line that no longer matches. Written by a GPT worker from the manager session's brief. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs --- changelog.d/1389.fixed.md | 1 + .../adapter-java/src/java-adapter-factory.ts | 2 +- skills/debugging/SKILL.md | 2 +- src/implementations/network-manager-impl.ts | 2 +- src/server/tool-schemas.ts | 2 +- src/skill-content.ts | 5 +- .../java/unit/java-adapter-factory.test.ts | 6 + tests/core/unit/loopback-bindings.test.ts | 198 ++++++++++++++++++ .../bp-assert.va-explicit.container-true.json | 2 +- ...bp-assert.va-explicit.container-unset.json | 2 +- .../bp-assert.va-open.container-true.json | 2 +- .../bp-assert.va-open.container-unset.json | 2 +- .../bp-assert.va-unset.container-true.json | 2 +- .../bp-assert.va-unset.container-unset.json | 2 +- ...bp-content.va-explicit.container-true.json | 2 +- ...p-content.va-explicit.container-unset.json | 2 +- .../bp-content.va-open.container-true.json | 2 +- .../bp-content.va-open.container-unset.json | 2 +- .../bp-content.va-unset.container-true.json | 2 +- .../bp-content.va-unset.container-unset.json | 2 +- .../bp-line.va-explicit.container-true.json | 2 +- .../bp-line.va-explicit.container-unset.json | 2 +- .../bp-line.va-open.container-true.json | 2 +- .../bp-line.va-open.container-unset.json | 2 +- .../bp-line.va-unset.container-true.json | 2 +- .../bp-line.va-unset.container-unset.json | 2 +- .../bp-unset.va-explicit.container-true.json | 2 +- .../bp-unset.va-explicit.container-unset.json | 2 +- .../bp-unset.va-open.container-true.json | 2 +- .../bp-unset.va-open.container-unset.json | 2 +- .../bp-unset.va-unset.container-true.json | 2 +- .../bp-unset.va-unset.container-unset.json | 2 +- .../unit/server/server-instructions.test.ts | 20 ++ .../network-manager-impl.test.ts | 12 +- 34 files changed, 262 insertions(+), 36 deletions(-) create mode 100644 changelog.d/1389.fixed.md create mode 100644 tests/core/unit/loopback-bindings.test.ts diff --git a/changelog.d/1389.fixed.md b/changelog.d/1389.fixed.md new file mode 100644 index 000000000..f9a3fbab6 --- /dev/null +++ b/changelog.d/1389.fixed.md @@ -0,0 +1 @@ +**Local Java attach guidance and the per-session free-port probe use loopback.** The attach tool, Java adapter hint and debugging skill now recommend `address=127.0.0.1:` so JDWP does not listen on every interface. The temporary port probe also binds `127.0.0.1`. A source and guidance scan records reviewed exceptions and rejects new wildcard addresses or hostless listen calls, as well as stale exceptions. (#1389) diff --git a/packages/adapter-java/src/java-adapter-factory.ts b/packages/adapter-java/src/java-adapter-factory.ts index 9ac02a49d..13e58a45f 100644 --- a/packages/adapter-java/src/java-adapter-factory.ts +++ b/packages/adapter-java/src/java-adapter-factory.ts @@ -60,7 +60,7 @@ export class JavaAdapterFactory implements IAdapterFactory { attachBy: ['port'], attachHints: { processId: - 'JDWP has no PID step; start the JVM with -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*: and pass that port' + 'JDWP has no PID step; start the JVM with -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1: and pass that port' } }, icon: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjggMTI4Ij48cGF0aCBmaWxsPSIjRTc2RjAwIiBkPSJNNDcuNiA3Ni41cy00LjYgMi43IDMuMyAzLjZjOS41IDEuMSAxNC40LjkgMjQuOS0xLjEgMCAwIDIuOCAxLjcgNi42IDMuMi0yMy40IDEwLTUzLTAuNi0zNC44LTUuN3ptLTIuOS0xMy4xcy01LjIgMy44IDIuNyA0LjZjMTAuMiAxLjEgMTguMiAxLjIgMzIuMS0xLjYgMCAwIDEuOSAyIDQuOSAzLjEtMjguMyA4LjMtNTkuOC42LTM5LjctNi4xeiIvPjxwYXRoIGZpbGw9IiM1MzgyQTEiIGQ9Ik02OS40IDQ1LjFjNS43IDYuNi0xLjUgMTIuNS0xLjUgMTIuNXMxNC41LTcuNSA3LjktMTYuOWMtNi4yLTguOC0xMC45LTEzLjIgMTQuNy0yOC4yIDAgMC00MC4yIDEwLTIxLjEgMzIuNnoiLz48cGF0aCBmaWxsPSIjRTc2RjAwIiBkPSJNOTUuOCA4My45czMuNCAyLjgtMy44IDVjLTEzLjUgNC4xLTU2LjIgNS4zLTY4LjEuMi00LjMtMS45IDMuOC00LjQgNi40LTUgMi43LS42IDQuMi0uNSA0LjItLjUtNC44LTMuNC0zMS4zIDYuNy0xMy40IDkuNSA0OC42IDcuNyA4OC42LTMuNSA3NC43LTkuMnpNNDkuOSA1NS42cy0yMi4yIDUuMy03LjkgNy4yYzYuMS44IDE4LjIuNiAyOS41LS4zIDkuMi0uOCAxOC41LTIuNCAxOC41LTIuNHMtMy4zIDEuNC01LjYgM2MtMjIuOCA2LTY2LjggMy4yLTU0LjEtMi45IDEwLjctNS4yIDE5LjYtNC42IDE5LjYtNC42ek04NS43IDcxLjJjMjMuMS0xMiAxMi40LTIzLjYgNS0yMiAtMS44LjQtMi42LjctMi42LjdzLjctMS4xIDItMS41YzE0LjctNS4yIDI2IDE1LjItNC44IDIzLjMgMCAwIC40LS4zLjQtLjV6Ii8+PHBhdGggZmlsbD0iIzUzODJBMSIgZD0iTTc2LjUgMS45czEyLjggMTIuOC0xMi4xIDMyLjVjLTIwIDE1LjgtNC42IDI0LjggMCAzNS4xLTExLjctMTAuNS0yMC4yLTE5LjgtMTQuNS0yOC40QzU4LjMgMjguNCA4MS4xIDIyIDc2LjUgMS45eiIvPjxwYXRoIGZpbGw9IiNFNzZGMDAiIGQ9Ik01MS40IDEwNC41YzIyLjIgMS40IDU2LjMtLjggNTcuMS0xMS4zIDAgMC0xLjYgNC0xOC40IDcuMi0xOSAzLjYtNDIuNCAzLjItNTYuMy45IDAgMCAyLjggMi40IDE3LjYgMy4yeiIvPjwvc3ZnPg==', diff --git a/skills/debugging/SKILL.md b/skills/debugging/SKILL.md index ef52c02dc..98e7244ed 100644 --- a/skills/debugging/SKILL.md +++ b/skills/debugging/SKILL.md @@ -83,7 +83,7 @@ attach_to_process {sessionId, host: "localhost", port: 5678, sourcePaths: [": ...`; to address breakpoints by local-checkout path, map it onto the debuggee tree with `adapterConfig: {pathMappings: [{localRoot: "", remoteRoot: "/app"}]}` - **Ruby**: target ran `rdbg --open --port ...` (works through `kubectl port-forward`); `localfsMap: "/app:"` maps paths - **JavaScript**: target ran `node --inspect=: ...` → attach by `host`/`port`; a plain `node app.js` on the same host → attach by `processId` (mcp-debugger opens its inspector on 9229, and it stays open, unauthenticated, after detach and close: #1261 — pass `port` too if the target set `--inspect-port=`) -- **Java**: target JVM has `-agentlib:jdwp=transport=dt_socket,server=y,address=*:`; breakpoints in not-yet-loaded classes are deferred automatically, and a fully-qualified class name as `file` needs no source files at all +- **Java**: target JVM has `-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:`; breakpoints in not-yet-loaded classes are deferred automatically, and a fully-qualified class name as `file` needs no source files at all - **C/C++ (and other native)**: attach by PID instead of port — `attach_to_process {sessionId, processId: , adapterConfig: {program: ""}}`; in a Kubernetes ephemeral debug container use `processId: 1` with `program: "/proc/1/root/"` (on Linux, mind `kernel.yama.ptrace_scope`) - **COBOL**: attach by PID like C/C++, plus `adapterConfig: {sources: ["", …], dialect: "ibm"}` (the manifest is regenerated by a translate-only `cobc -C`; pass the options the binary was built with) or `adapterConfig: {manifestDirs: [""]}` (an earlier source launch's `.debug-mcp/cobol/-[-container]///`, needs no cobc) so variables are COBOL-shaped; without either only the engine's C view is available. A job paused inside libcob still shows its program's data division (scopes from the nearest COBOL frame up the stack) - **Dart/Flutter**: attach by VM-service URI, never by PID — `attach_to_process {sessionId, adapterConfig: {vmServiceUri: "ws://127.0.0.1:/=/ws"}}` (the URI a `dart --enable-vm-service … run` target prints, or `flutter run --machine`'s `app.debugPort` event) or `adapterConfig: {vmServiceInfoFile: ""}`; a bare `host`/`port` only works for a VM started with `--disable-service-auth-codes`. The `dart-test`/`flutter-test` runners refuse attach. An isolate idle in an `await` shows an empty stack at the attach pause — set a breakpoint and `continue_execution`, or attach with `stopOnEntry: false` diff --git a/src/implementations/network-manager-impl.ts b/src/implementations/network-manager-impl.ts index 3f96caa89..1f10565c3 100644 --- a/src/implementations/network-manager-impl.ts +++ b/src/implementations/network-manager-impl.ts @@ -15,7 +15,7 @@ export class NetworkManagerImpl implements INetworkManager { const server = net.createServer(); server.unref(); server.on('error', reject); - server.listen(0, () => { + server.listen(0, '127.0.0.1', () => { const address = server.address(); if (address && typeof address === 'object' && 'port' in address) { const port = address.port; diff --git a/src/server/tool-schemas.ts b/src/server/tool-schemas.ts index f866edba8..d1a7ddc20 100644 --- a/src/server/tool-schemas.ts +++ b/src/server/tool-schemas.ts @@ -262,7 +262,7 @@ export function buildToolDefinitions(options: BuildToolDefinitionsOptions): Tool } }, { name: 'restart_debugging', description: 'Restart the debuggee: terminate the current program (if still running) and relaunch it with the same configuration as the last start_debugging. All current breakpoints are re-applied automatically. The get_output buffer starts fresh — read from since=0 after a restart. A Flutter session hot-restarts in place instead, an attached one included: same process, output buffer kept, and the answer carries hotRestart: true. Works while running, paused, or after the program has exited. Not available for sessions never launched, or for attach sessions of the other adapters (detach and re-attach). Answers like start_debugging, including "running" with pending:true when the relaunch has not stopped within the same short hold (then call wait_for_stop)', inputSchema: { type: 'object', properties: { sessionId: { type: 'string' } }, required: ['sessionId'] } }, - { name: 'attach_to_process', description: `Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state "running" with pending:true; the late event alone changes the session to "paused" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: ${attachPathForms} (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap ":"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo`, inputSchema: { + { name: 'attach_to_process', description: `Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state "running" with pending:true; the late event alone changes the session to "paused" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: ${attachPathForms} (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap ":"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo`, inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Debug session ID' }, diff --git a/src/skill-content.ts b/src/skill-content.ts index 9c325a091..b5bbb407a 100644 --- a/src/skill-content.ts +++ b/src/skill-content.ts @@ -5,7 +5,8 @@ * `instructions` field); DEBUGGING_WORKFLOW_PROMPT backs the * `debugging-workflow` prompt. Both are condensed views of the full agent * skill in skills/debugging/ — when editing one, check the other and the - * skill for drift. + * skill for drift. The Java loopback recipe is pinned across these surfaces + * by tests/core/unit/server/server-instructions.test.ts. * * Both texts are built per addressing mode (issue #271): the * DEBUG_MCP_BP_ADDRESSING flag must hide content-addressing features from @@ -205,7 +206,7 @@ attach_to_process {sessionId, host, port, sourcePaths, adapterConfig} - Python: target started with "python -m debugpy --listen host:port ..."; map a local checkout onto the debuggee tree with adapterConfig: {pathMappings: [{localRoot, remoteRoot}]} - Ruby: target started with "rdbg --open --port N ..." (works via kubectl port-forward); localfsMap: "/app:" maps paths - JavaScript: host/port of a "node --inspect" target, or processId of a plain local node process (its inspector is opened for you on 9229 and stays open, unauthenticated, after detach and close: #1261; pass port too for an --inspect-port target) -- Java: JVM flag -agentlib:jdwp=transport=dt_socket,server=y,address=*:PORT (breakpoints defer until class load); FQCN as "file" needs no source at all +- Java: JVM flag -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:PORT (breakpoints defer until class load); FQCN as "file" needs no source at all - C/C++ (and other native): attach by PID — attach_to_process {sessionId, processId, adapterConfig: {program: ""}} - COBOL: attach by PID like C/C++; add adapterConfig: {sources: ["", …]} (the manifest is regenerated by a translate-only cobc -C) or adapterConfig: {manifestDirs: ["<.debug-mcp/cobol/-// dir of the running build>"]} so the shim finds the symbol manifest, or variables show only the engine's C view - Dart/Flutter: attach to a running VM service — pass adapterConfig.vmServiceUri or vmServiceInfoFile, not a PID (the SDK adapter is spawned locally and connects to the VM service); a Flutter app on an Android device or emulator takes adapterConfig.deviceId alone with no URI (flutter attach discovers it; the app.debugPort URI of another flutter run is that tool's own DDS and never connects) diff --git a/tests/adapters/java/unit/java-adapter-factory.test.ts b/tests/adapters/java/unit/java-adapter-factory.test.ts index 6171ee98c..fdfa56a35 100644 --- a/tests/adapters/java/unit/java-adapter-factory.test.ts +++ b/tests/adapters/java/unit/java-adapter-factory.test.ts @@ -87,6 +87,12 @@ describe('JavaAdapterFactory', () => { const metadata = factory.getMetadata(); expect(metadata.documentationUrl).toContain('github.com'); }); + + it('recommends loopback for the local JDWP attach port (#1389)', () => { + expect(factory.getMetadata().modes?.attachHints?.processId).toContain( + '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:' + ); + }); }); describe('validate', () => { diff --git a/tests/core/unit/loopback-bindings.test.ts b/tests/core/unit/loopback-bindings.test.ts new file mode 100644 index 000000000..d50ef4833 --- /dev/null +++ b/tests/core/unit/loopback-bindings.test.ts @@ -0,0 +1,198 @@ +/** + * Line-level tripwire for listener defaults and agent-facing bind guidance (#1389). + * Like check-structure.mjs, resolve the repository from this module, normalize + * paths to forward slashes and compare both additions and removals with a record. + * Walk the requested source roots directly so new, untracked files count too. + * + * This is not an AST or a network audit: comments and strings count; variable + * values, aliases, computed calls, multiline arguments and non-Node listeners + * cannot be resolved. A listen line without a literal loopback host is reviewed, + * including calls with a host variable or arguments continued on the next line. + */ +import { describe, expect, it } from 'vitest'; +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const ROOT = fileURLToPath(new URL('../../..', import.meta.url)); + +interface Occurrence { + file: string; + line: string; +} + +interface AllowedOccurrence extends Occurrence { + reason: string; +} + +// Exact text, including indentation: changing or removing a line requires review. +const ALLOWED: AllowedOccurrence[] = [ + { + "file": "packages/adapter-dart/src/bridge/dap-stdio-bridge-core.ts", + "line": " server.listen(options.port, host, () => {", + "reason": "Dart bridge receives the session adapterHost, 127.0.0.1; standalone use defaults to loopback." + }, + { + "file": "packages/adapter-java/java/JdiDapServer.java", + "line": " cmdList.add(\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:\" + jdwpPort);", + "reason": "Existing child-JVM launch wildcard, outside the attach-guidance fix; retained for a separate fix, not endorsed as safe." + }, + { + "file": "packages/adapter-mock/src/mock-adapter-process.ts", + "line": " this.server.listen(port, host, () => {", + "reason": "Mock adapter receives the session adapterHost, 127.0.0.1, as its host argument." + }, + { + "file": "packages/shared/src/utils/deadline.ts", + "line": " tree.listen(outside);", + "reason": "DeadlineTree.listen subscribes to an AbortSignal; it opens no network socket." + }, + { + "file": "packages/shared/src/utils/loopback-host.ts", + "line": " * Anything else — a LAN address, a container or pod name, `0.0.0.0` — is not", + "reason": "Documentation excludes the bind-all address from loopback destinations." + }, + { + "file": "packages/shared/src/utils/loopback-host.ts", + "line": " * loopback: `0.0.0.0` is a bind-all address, never a destination.", + "reason": "Documentation explains why a bind-all address is never a destination." + }, + { + "file": "src/cli/bind-address.ts", + "line": " * `http` used to call `app.listen(port)`, which binds", + "reason": "Historical example explains the unsafe hostless HTTP default that was replaced." + }, + { + "file": "src/cli/bind-address.ts", + "line": " * `MCP_HTTP_BIND=0.0.0.0` so a published port keeps working; the `-p", + "reason": "Documents the explicit Docker bind-all override and loopback port publishing." + }, + { + "file": "src/cli/bind-address.ts", + "line": " '0.0.0.0 listens on every interface and is reachable from other machines — pair it with ' +", + "reason": "CLI help warns that an explicit bind-all address is reachable from other machines." + }, + { + "file": "src/cli/bind-address.ts", + "line": " throw new BindAddressError(`${chosen.origin} is empty; give an IP address such as 127.0.0.1 or 0.0.0.0`);", + "reason": "Validation error lists valid IP literals for an explicitly configured HTTP bind." + }, + { + "file": "src/cli/bind-address.ts", + "line": " `${chosen.origin} value '${trimmed}' is not an IP address; give one such as 127.0.0.1, 0.0.0.0 or :: ` +", + "reason": "Validation error lists valid IP literals rather than accepting DNS hostnames." + }, + { + "file": "src/cli/bind-address.ts", + "line": "/** 0.0.0.0 or :: — every interface (`::` is dual-stack unless ipv6Only). */", + "reason": "Documents the wildcard-address predicate used by HTTP bind validation." + }, + { + "file": "src/cli/bind-address.ts", + "line": " return bare === '0.0.0.0' || bare === '::';", + "reason": "Detects explicit wildcard HTTP binds so their handling can be validated." + }, + { + "file": "src/cli/bind-address.ts", + "line": " * softening: the image's own `MCP_HTTP_BIND=0.0.0.0` under `MCP_CONTAINER=true`", + "reason": "Explains that Docker wildcard binding does not soften remote-attach policy." + }, + { + "file": "src/cli/bind-address.ts", + "line": " 'Give one it has, 0.0.0.0 for every interface, or 127.0.0.1.'", + "reason": "Unavailable-address diagnostic offers explicit wildcard or loopback alternatives." + }, + { + "file": "src/cli/http-command.ts", + "line": " const server = app.listen(port, bind.address);", + "reason": "HTTP uses the validated bind.address, defaulting to loopback with explicit operator overrides." + }, + { + "file": "tools/dev-proxy/backend-subscriptions.mjs", + "line": " open = await client.listen({", + "reason": "MCP client.listen opens a subscription stream to the backend, not a listening socket." + } +]; + +function walk(directory: string): string[] { + return fs.readdirSync(path.join(ROOT, directory), { withFileTypes: true }) + .flatMap(entry => { + const file = `${directory}/${entry.name}`; + if (entry.isDirectory() && entry.name !== 'node_modules') return walk(file); + return entry.isFile() ? [file] : []; + }).sort(); +} + +function sourceFiles(): string[] { + const packageSources = fs.readdirSync(path.join(ROOT, 'packages'), { withFileTypes: true }) + .filter(entry => entry.isDirectory() && fs.existsSync(path.join(ROOT, 'packages', entry.name, 'src'))) + .flatMap(entry => walk(`packages/${entry.name}/src`).filter(file => file.endsWith('.ts'))); + return [ + ...walk('src').filter(file => file.endsWith('.ts')), + ...packageSources, + ...walk('packages/adapter-java/java').filter(file => /^packages\/adapter-java\/java\/[^/]+\.java$/.test(file)), + ...walk('skills').filter(file => file.endsWith('.md')), + ...walk('tools/dev-proxy').filter(file => /^tools\/dev-proxy\/[^/]+\.mjs$/.test(file)) + ].sort(); +} + +function suspicious(line: string): boolean { + // Stop at the first closing parenthesis: unrelated text later on the line + // must not supply a host, and a second listen call needs its own host. + const listens = [...line.matchAll(/\.listen\s*\(([^)]*)/g)]; + return line.includes('address=*') || line.includes('0.0.0.0') || + listens.some(listen => !/['"](?:127\.0\.0\.1|localhost|::1)['"]/.test(listen[1])); +} + +function differences(found: Occurrence[], allowed: AllowedOccurrence[]): string[] { + const remaining = [...allowed]; + const problems: string[] = []; + for (const occurrence of found) { + const index = remaining.findIndex(entry => entry.file === occurrence.file && entry.line === occurrence.line); + if (index === -1) { + problems.push(`New occurrence: ${occurrence.file}\n${occurrence.line}\nBind loopback (127.0.0.1), or add this exact line to ALLOWED with a one-line reason.`); + } else { + remaining.splice(index, 1); + } + } + for (const entry of remaining) { + problems.push(`Stale allowance: ${entry.file}\n${entry.line}\nRemove this entry from ALLOWED; it no longer matches an occurrence.`); + } + return problems; +} + +describe('loopback bindings and guidance', () => { + it('records every reviewed occurrence and rejects stale allowances', () => { + const found = sourceFiles().flatMap(file => fs.readFileSync(path.join(ROOT, file), 'utf8') + .split(/\r?\n/).filter(suspicious).map(line => ({ file, line }))); + for (const entry of ALLOWED) { + expect(entry.reason.trim(), `${entry.file}: give a one-line reason`).not.toBe(''); + expect(entry.reason).not.toMatch(/[\r\n]/); + } + expect(differences(found, ALLOWED).join('\n\n')).toBe(''); + }); + + it.each([ + ['address=*:', true], + ['address=0.0.0.0:5005', true], + ['server.listen(0, () => {', true], + ['server.listen({', true], + ['server.listen(port, host);', true], + ['server.listen(port); log("127.0.0.1");', true], + ['a.listen(0, "127.0.0.1"); b.listen(0);', true], + ['server.listen(0, "127.0.0.1", callback);', false], + ["server.listen({ port, host: '127.0.0.1' }, callback);", false], + ['address=127.0.0.1:', false] + ])('classifies %s', (line, expected) => { + expect(suspicious(line)).toBe(expected); + }); + + it('requires exact text and counts repeated occurrences separately', () => { + const allowed = { file: 'src/example.ts', line: 'server.listen(port);', reason: 'Example reviewed for this test.' }; + expect(differences([allowed], [allowed])).toEqual([]); + expect(differences([], [allowed]).join()).toContain('Stale allowance'); + expect(differences([allowed, allowed], [allowed]).join()).toContain('New occurrence'); + const changed = { ...allowed, line: ` ${allowed.line}` }; + expect(differences([changed], [allowed]).join()).toMatch(/New occurrence[\s\S]*Stale allowance/); + }); +}); diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json index f34f94fe6..4ceb592ef 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json index a8d273102..5e4ee3e7c 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json index 054ee3812..b1685408f 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json index 48c2624c2..18287d7a0 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json index 054ee3812..b1685408f 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json index 48c2624c2..18287d7a0 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json index af7085821..bfc2b4f90 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json index d3ceb3f09..17a90a9b0 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json index 9a9bb3799..6a891d9ab 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json index 35fe0fc6b..58129c43e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json index 9a9bb3799..6a891d9ab 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json index 35fe0fc6b..58129c43e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json index 0fe4c5566..d51ff560b 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json index 8561b60cf..167e7990c 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json index 05fe103d0..6980f793b 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json index 55cc4410f..bea550623 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json index 05fe103d0..6980f793b 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json index 55cc4410f..bea550623 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json index af7085821..bfc2b4f90 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json index d3ceb3f09..17a90a9b0 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json index 9a9bb3799..6a891d9ab 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json index 35fe0fc6b..58129c43e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json index 9a9bb3799..6a891d9ab 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json index 35fe0fc6b..58129c43e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=*:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/server-instructions.test.ts b/tests/core/unit/server/server-instructions.test.ts index 2b958b600..4e7f558b5 100644 --- a/tests/core/unit/server/server-instructions.test.ts +++ b/tests/core/unit/server/server-instructions.test.ts @@ -12,8 +12,10 @@ * descriptions are checked at the end: each long one is stated once. */ import { describe, it, expect } from 'vitest'; +import { readFileSync } from 'fs'; import { buildServerInstructions, + DEBUGGING_WORKFLOW_PROMPT, SERVER_INSTRUCTIONS_LIMIT, type ServerInstructionsOptions } from '../../../../src/skill-content.js'; @@ -320,6 +322,24 @@ describe('server instructions (issue #1331)', () => { }); }); +describe('Java attach guidance (#1389)', () => { + it('keeps the workflow prompt, agent skill and attach tool on loopback', () => { + const skill = readFileSync(new URL('../../../../skills/debugging/SKILL.md', import.meta.url), 'utf8'); + const tools = buildToolDefinitions({ + supportedLanguages: ['java'], + environment: { + get: () => undefined, + getAll: () => ({}), + getCurrentWorkingDirectory: () => process.cwd() + } + }); + const attach = tools.find(tool => tool.name === 'attach_to_process')?.description ?? ''; + for (const text of [DEBUGGING_WORKFLOW_PROMPT, skill, attach]) { + expect(text).toContain('-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:'); + } + }); +}); + describe('the rules that moved into the tool descriptions (issue #1331)', () => { const toolsFor = (variableAccess: 'open' | 'explicit'): ReturnType => buildToolDefinitions({ diff --git a/tests/unit/implementations/network-manager-impl.test.ts b/tests/unit/implementations/network-manager-impl.test.ts index 11e5b9190..efef55a42 100644 --- a/tests/unit/implementations/network-manager-impl.test.ts +++ b/tests/unit/implementations/network-manager-impl.test.ts @@ -71,7 +71,7 @@ describe('NetworkManagerImpl', () => { const freePort = 12345; // Setup mock behavior - mockServer.listen.mockImplementation(((port: number, callback?: Function) => { + mockServer.listen.mockImplementation(((port: number, host: string, callback?: Function) => { if (callback) { process.nextTick(() => callback()); } @@ -92,7 +92,7 @@ describe('NetworkManagerImpl', () => { expect(result).toBe(freePort); expect((net as any).createServer).toHaveBeenCalled(); expect(mockServer.unref).toHaveBeenCalled(); - expect(mockServer.listen).toHaveBeenCalledWith(0, expect.any(Function)); + expect(mockServer.listen).toHaveBeenCalledWith(0, '127.0.0.1', expect.any(Function)); expect(mockServer.close).toHaveBeenCalled(); }); @@ -113,7 +113,7 @@ describe('NetworkManagerImpl', () => { it('should handle invalid address format', async () => { - mockServer.listen.mockImplementation(((port: number, callback?: Function) => { + mockServer.listen.mockImplementation(((port: number, host: string, callback?: Function) => { if (callback) { process.nextTick(() => callback()); } @@ -135,7 +135,7 @@ describe('NetworkManagerImpl', () => { it('should handle null address', async () => { - mockServer.listen.mockImplementation(((port: number, callback?: Function) => { + mockServer.listen.mockImplementation(((port: number, host: string, callback?: Function) => { if (callback) { process.nextTick(() => callback()); } @@ -158,14 +158,14 @@ describe('NetworkManagerImpl', () => { it('should clean up server resources on success', async () => { const freePort = 54321; - mockServer.listen.mockImplementation(((port: number, callback?: Function) => { + mockServer.listen.mockImplementation(((port: number, host: string, callback?: Function) => { if (callback) { process.nextTick(() => callback()); } return mockServer; }) as any); - mockServer.address.mockReturnValue({ port: freePort, family: 'IPv4', address: '0.0.0.0' }); + mockServer.address.mockReturnValue({ port: freePort, family: 'IPv4', address: '127.0.0.1' }); let closeCallbackCalled = false; mockServer.close.mockImplementation(((callback?: Function) => { From 09f550e7660908bc1fd8a5c92b89531de62c563a Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 29 Nov 2026 17:17:18 -0500 Subject: [PATCH 2/5] test: the loopback guard recognises the Java bridge's sockets (#1389) After the rebase onto the launch fix (#1387), the guard's recorded entry for the bridge's old wildcard line was stale, and the guard said so. The entry is gone. The guard now also flags a Java "new ServerSocket(" that names no loopback address, the form the bridge's port probe had until that fix. Put back as text, both old lines fail the guard. The changelog entry is reworded in the house style. Written by the manager session. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs --- changelog.d/1389.fixed.md | 2 +- tests/core/unit/loopback-bindings.test.ts | 24 +++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/changelog.d/1389.fixed.md b/changelog.d/1389.fixed.md index f9a3fbab6..d3f95e61e 100644 --- a/changelog.d/1389.fixed.md +++ b/changelog.d/1389.fixed.md @@ -1 +1 @@ -**Local Java attach guidance and the per-session free-port probe use loopback.** The attach tool, Java adapter hint and debugging skill now recommend `address=127.0.0.1:` so JDWP does not listen on every interface. The temporary port probe also binds `127.0.0.1`. A source and guidance scan records reviewed exceptions and rejects new wildcard addresses or hostless listen calls, as well as stale exceptions. (#1389) +**The Java attach guidance and the per-session port probe keep to loopback** — the text an agent reads before attaching to a JVM (the `attach_to_process` description, the Java adapter's attach hint, the workflow prompt and the debugging skill) told it to start the JVM with `address=*:`, which opens the unauthenticated JDWP port on every network interface; it now says `address=127.0.0.1:`. The server's own free-port probe, once per session, listened with no host and so on every interface for an instant; it binds `127.0.0.1`. A check in the unit suite now scans the shipped sources and the agent-facing text for a wildcard address or a listener that names no loopback host, against a recorded list of the lines where binding wider is deliberate, each with its reason: a new one fails until it is bound to loopback or added on purpose (#1389) diff --git a/tests/core/unit/loopback-bindings.test.ts b/tests/core/unit/loopback-bindings.test.ts index d50ef4833..0d74290aa 100644 --- a/tests/core/unit/loopback-bindings.test.ts +++ b/tests/core/unit/loopback-bindings.test.ts @@ -5,9 +5,11 @@ * Walk the requested source roots directly so new, untracked files count too. * * This is not an AST or a network audit: comments and strings count; variable - * values, aliases, computed calls, multiline arguments and non-Node listeners - * cannot be resolved. A listen line without a literal loopback host is reviewed, - * including calls with a host variable or arguments continued on the next line. + * values, aliases, computed calls and multiline arguments cannot be resolved. A + * listen line without a literal loopback host is reviewed, including calls with + * a host variable or arguments continued on the next line. Of the listeners that + * are not Node's, only the Java bridge's `new ServerSocket(` is recognised; what + * a spawned debug adapter binds by its own default is outside this scan. */ import { describe, expect, it } from 'vitest'; import fs from 'fs'; @@ -32,11 +34,6 @@ const ALLOWED: AllowedOccurrence[] = [ "line": " server.listen(options.port, host, () => {", "reason": "Dart bridge receives the session adapterHost, 127.0.0.1; standalone use defaults to loopback." }, - { - "file": "packages/adapter-java/java/JdiDapServer.java", - "line": " cmdList.add(\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:\" + jdwpPort);", - "reason": "Existing child-JVM launch wildcard, outside the attach-guidance fix; retained for a separate fix, not endorsed as safe." - }, { "file": "packages/adapter-mock/src/mock-adapter-process.ts", "line": " this.server.listen(port, host, () => {", @@ -140,7 +137,11 @@ function suspicious(line: string): boolean { // Stop at the first closing parenthesis: unrelated text later on the line // must not supply a host, and a second listen call needs its own host. const listens = [...line.matchAll(/\.listen\s*\(([^)]*)/g)]; - return line.includes('address=*') || line.includes('0.0.0.0') || + // The Java bridge: a ServerSocket constructed without a bind address listens + // on every interface (the free-port probe did, until #1387). + const javaListener = /new\s+ServerSocket\s*\(/.test(line) && + !/getLoopbackAddress\s*\(\s*\)|"(?:127\.0\.0\.1|localhost|::1)"/.test(line); + return line.includes('address=*') || line.includes('0.0.0.0') || javaListener || listens.some(listen => !/['"](?:127\.0\.0\.1|localhost|::1)['"]/.test(listen[1])); } @@ -182,7 +183,10 @@ describe('loopback bindings and guidance', () => { ['a.listen(0, "127.0.0.1"); b.listen(0);', true], ['server.listen(0, "127.0.0.1", callback);', false], ["server.listen({ port, host: '127.0.0.1' }, callback);", false], - ['address=127.0.0.1:', false] + ['address=127.0.0.1:', false], + ['try (ServerSocket ss = new ServerSocket(0)) {', true], + ['try (ServerSocket ss = new ServerSocket(port)) {', true], + ['try (ServerSocket ss = new ServerSocket(0, 1, InetAddress.getLoopbackAddress())) {', false] ])('classifies %s', (line, expected) => { expect(suspicious(line)).toBe(expected); }); From deb256b2ad0b043b8200021ba208923721dd84b5 Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 29 Nov 2026 17:56:10 -0500 Subject: [PATCH 3/5] fix: say when a wider JDWP address is needed, and tighten the loopback guard (#1389) Findings of two reviews (Gemini with a mutation pass, Claude Opus) on the previous two commits. Guidance. The three general attach texts gave a loopback address in a section that also covers remote machines and containers, where a JVM behind a published Docker port cannot be reached on its loopback. They keep address=127.0.0.1: and now say when to widen it and how to publish a container's port on the host's loopback. The Java docs, the skill reference and an example named a bare port, which is every interface on a JDK 8 target: they name 127.0.0.1. A comment said Delve runs with --listen=:port; the code passes 127.0.0.1. Guard. Three reviewer mutants survived the first version. It now - takes a call's arguments by matching parentheses, so loopback text after the call does not count and a nested call does not cut the arguments short; - does not accept a literal behind a fallback, a ternary or a spread; - judges a call that continues on the next line on the arguments it has already finished, so listen(0, '127.0.0.1', () => { passes without an entry and listen({ goes to review; - knows the Java ServerSocket and InetSocketAddress constructors, [::], a --listen value that starts with a colon, address=* anywhere, and a non-loopback address= on a line that names JDWP; - reads 0.0.0.0 as an address, not as a substring of 10.0.0.0/8; - scans .js, .mjs and .cjs beside .ts, every package's java tree, the pi extension and tools; - names the rule and the line number when it fails. Three recorded reasons that did not say what their line does are corrected. 79 classifier rows pin each clause; eleven text-only mutants, among them the two old bridge lines and the three that had survived, all fail it. The probe's unit test failed by timeout when the probe lost its host; its stand-in now calls the callback wherever it is, and the assertion fails in milliseconds. The guidance, the first tightening of the guard and the probe test were written by the GPT worker. The manager session wrote the finished-arguments rule, the JDWP context rule, their rows, and the changelog entry. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs --- changelog.d/1389.fixed.md | 2 +- docs/java/README.md | 4 +- examples/java/InfiniteWait.java | 2 +- .../src/interfaces/adapter-policy-go.ts | 2 +- skills/debugging/SKILL.md | 2 +- skills/debugging/references/java.md | 2 +- src/server/tool-schemas.ts | 2 +- src/skill-content.ts | 2 +- tests/core/unit/loopback-bindings.test.ts | 278 +++++++++++++++--- .../bp-assert.va-explicit.container-true.json | 2 +- ...bp-assert.va-explicit.container-unset.json | 2 +- .../bp-assert.va-open.container-true.json | 2 +- .../bp-assert.va-open.container-unset.json | 2 +- .../bp-assert.va-unset.container-true.json | 2 +- .../bp-assert.va-unset.container-unset.json | 2 +- ...bp-content.va-explicit.container-true.json | 2 +- ...p-content.va-explicit.container-unset.json | 2 +- .../bp-content.va-open.container-true.json | 2 +- .../bp-content.va-open.container-unset.json | 2 +- .../bp-content.va-unset.container-true.json | 2 +- .../bp-content.va-unset.container-unset.json | 2 +- .../bp-line.va-explicit.container-true.json | 2 +- .../bp-line.va-explicit.container-unset.json | 2 +- .../bp-line.va-open.container-true.json | 2 +- .../bp-line.va-open.container-unset.json | 2 +- .../bp-line.va-unset.container-true.json | 2 +- .../bp-line.va-unset.container-unset.json | 2 +- .../bp-unset.va-explicit.container-true.json | 2 +- .../bp-unset.va-explicit.container-unset.json | 2 +- .../bp-unset.va-open.container-true.json | 2 +- .../bp-unset.va-open.container-unset.json | 2 +- .../bp-unset.va-unset.container-true.json | 2 +- .../bp-unset.va-unset.container-unset.json | 2 +- .../unit/server/server-instructions.test.ts | 3 + .../network-manager-impl.test.ts | 12 +- 35 files changed, 274 insertions(+), 85 deletions(-) diff --git a/changelog.d/1389.fixed.md b/changelog.d/1389.fixed.md index d3f95e61e..bee055466 100644 --- a/changelog.d/1389.fixed.md +++ b/changelog.d/1389.fixed.md @@ -1 +1 @@ -**The Java attach guidance and the per-session port probe keep to loopback** — the text an agent reads before attaching to a JVM (the `attach_to_process` description, the Java adapter's attach hint, the workflow prompt and the debugging skill) told it to start the JVM with `address=*:`, which opens the unauthenticated JDWP port on every network interface; it now says `address=127.0.0.1:`. The server's own free-port probe, once per session, listened with no host and so on every interface for an instant; it binds `127.0.0.1`. A check in the unit suite now scans the shipped sources and the agent-facing text for a wildcard address or a listener that names no loopback host, against a recorded list of the lines where binding wider is deliberate, each with its reason: a new one fails until it is bound to loopback or added on purpose (#1389) +**The Java attach guidance and the server's free-port probe keep to loopback** — the text an agent reads before attaching to a JVM (the `attach_to_process` description, the Java adapter's attach hint, the workflow prompt and the debugging skill) told it to start the JVM with `address=*:`, which opens the unauthenticated JDWP port on every network interface. It now gives `address=127.0.0.1:`, and says when a wider address is needed (an attach from another machine or into a container) and how to publish a container's port on the host's loopback. The Java docs and skill reference name `127.0.0.1` where they gave a bare port, which is every interface on a JDK 8 target. The server's own free-port probe, on every launch, attach and restart, listened with no host and so on every interface for an instant; it binds `127.0.0.1`. A check in the unit suite now scans the server's and adapters' sources, the Java bridge and the skill text for the shapes this class takes (`0.0.0.0`, `[::]`, a `--listen` value that starts with a colon, a wildcard or non-loopback JDWP `address=`, a `listen` call or a Java socket constructor that names no loopback host) against a recorded list of reviewed lines, each with its reason: a new one fails until it is bound to loopback or recorded on purpose, and so does a recorded line that no longer matches (#1389) diff --git a/docs/java/README.md b/docs/java/README.md index eb78fff95..a15f8d221 100644 --- a/docs/java/README.md +++ b/docs/java/README.md @@ -86,7 +86,7 @@ Connect to a running JVM that was started with JDWP agent. Start your JVM with JDWP enabled: ```bash -java -agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=y \ +java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:5005,suspend=y \ -cp . MyProgram ``` @@ -244,7 +244,7 @@ javac -g Calculator.java ```bash # Terminal 1: Start JVM with JDWP javac -g MyServer.java -java -agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=y \ +java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:5005,suspend=y \ -cp . MyServer # Output: "Listening for transport dt_socket at address: 5005" ``` diff --git a/examples/java/InfiniteWait.java b/examples/java/InfiniteWait.java index d62e33749..6a4e5ca7f 100644 --- a/examples/java/InfiniteWait.java +++ b/examples/java/InfiniteWait.java @@ -2,7 +2,7 @@ * Simple Java program for testing attach-mode debugging. * * Launch with JDWP agent to allow debugger attach: - * java -agentlib:jdwp=transport=dt_socket,server=y,address=,suspend=y \ + * java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:,suspend=y \ * -cp . InfiniteWait * * With suspend=y the JVM pauses at startup, so the program just needs diff --git a/packages/shared/src/interfaces/adapter-policy-go.ts b/packages/shared/src/interfaces/adapter-policy-go.ts index ba69b0cd4..12b741f09 100644 --- a/packages/shared/src/interfaces/adapter-policy-go.ts +++ b/packages/shared/src/interfaces/adapter-policy-go.ts @@ -2,7 +2,7 @@ * GoAdapterPolicy - policy for Go Debug Adapter (Delve/dlv) * * Encodes Delve-specific behaviors and variable handling logic. - * Delve operates in DAP mode via `dlv dap --listen=:port` + * Delve operates in DAP mode via `dlv dap --listen=127.0.0.1:` */ import type { DebugProtocol } from '@vscode/debugprotocol'; import * as path from 'path'; diff --git a/skills/debugging/SKILL.md b/skills/debugging/SKILL.md index 98e7244ed..3a986bf12 100644 --- a/skills/debugging/SKILL.md +++ b/skills/debugging/SKILL.md @@ -83,7 +83,7 @@ attach_to_process {sessionId, host: "localhost", port: 5678, sourcePaths: [": ...`; to address breakpoints by local-checkout path, map it onto the debuggee tree with `adapterConfig: {pathMappings: [{localRoot: "", remoteRoot: "/app"}]}` - **Ruby**: target ran `rdbg --open --port ...` (works through `kubectl port-forward`); `localfsMap: "/app:"` maps paths - **JavaScript**: target ran `node --inspect=: ...` → attach by `host`/`port`; a plain `node app.js` on the same host → attach by `processId` (mcp-debugger opens its inspector on 9229, and it stays open, unauthenticated, after detach and close: #1261 — pass `port` too if the target set `--inspect-port=`) -- **Java**: target JVM has `-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:`; breakpoints in not-yet-loaded classes are deferred automatically, and a fully-qualified class name as `file` needs no source files at all +- **Java**: target JVM has `-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:`; replace `127.0.0.1` with `*` only for attach from another machine or container. For a container publish the port on the host's loopback: `-p 127.0.0.1::`. JDWP has no authentication; restrict network access to trusted debugger clients. Breakpoints in not-yet-loaded classes are deferred automatically, and a fully-qualified class name as `file` needs no source files at all - **C/C++ (and other native)**: attach by PID instead of port — `attach_to_process {sessionId, processId: , adapterConfig: {program: ""}}`; in a Kubernetes ephemeral debug container use `processId: 1` with `program: "/proc/1/root/"` (on Linux, mind `kernel.yama.ptrace_scope`) - **COBOL**: attach by PID like C/C++, plus `adapterConfig: {sources: ["", …], dialect: "ibm"}` (the manifest is regenerated by a translate-only `cobc -C`; pass the options the binary was built with) or `adapterConfig: {manifestDirs: [""]}` (an earlier source launch's `.debug-mcp/cobol/-[-container]///`, needs no cobc) so variables are COBOL-shaped; without either only the engine's C view is available. A job paused inside libcob still shows its program's data division (scopes from the nearest COBOL frame up the stack) - **Dart/Flutter**: attach by VM-service URI, never by PID — `attach_to_process {sessionId, adapterConfig: {vmServiceUri: "ws://127.0.0.1:/=/ws"}}` (the URI a `dart --enable-vm-service … run` target prints, or `flutter run --machine`'s `app.debugPort` event) or `adapterConfig: {vmServiceInfoFile: ""}`; a bare `host`/`port` only works for a VM started with `--disable-service-auth-codes`. The `dart-test`/`flutter-test` runners refuse attach. An isolate idle in an `await` shows an empty stack at the attach pause — set a breakpoint and `continue_execution`, or attach with `stopOnEntry: false` diff --git a/skills/debugging/references/java.md b/skills/debugging/references/java.md index 43e8090da..300ff2815 100644 --- a/skills/debugging/references/java.md +++ b/skills/debugging/references/java.md @@ -53,7 +53,7 @@ close_debug_session {"sessionId": ""} Start the target JVM with the JDWP agent (`suspend=y` pauses until a debugger attaches; `suspend=n` for already-running servers): ```bash -java -agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=y -cp . MyServer +java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:5005,suspend=y -cp . MyServer ``` ```json diff --git a/src/server/tool-schemas.ts b/src/server/tool-schemas.ts index d1a7ddc20..8f7c8658a 100644 --- a/src/server/tool-schemas.ts +++ b/src/server/tool-schemas.ts @@ -262,7 +262,7 @@ export function buildToolDefinitions(options: BuildToolDefinitionsOptions): Tool } }, { name: 'restart_debugging', description: 'Restart the debuggee: terminate the current program (if still running) and relaunch it with the same configuration as the last start_debugging. All current breakpoints are re-applied automatically. The get_output buffer starts fresh — read from since=0 after a restart. A Flutter session hot-restarts in place instead, an attached one included: same process, output buffer kept, and the answer carries hotRestart: true. Works while running, paused, or after the program has exited. Not available for sessions never launched, or for attach sessions of the other adapters (detach and re-attach). Answers like start_debugging, including "running" with pending:true when the relaunch has not stopped within the same short hold (then call wait_for_stop)', inputSchema: { type: 'object', properties: { sessionId: { type: 'string' } }, required: ['sessionId'] } }, - { name: 'attach_to_process', description: `Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state "running" with pending:true; the late event alone changes the session to "paused" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: ${attachPathForms} (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap ":"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo`, inputSchema: { + { name: 'attach_to_process', description: `Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state "running" with pending:true; the late event alone changes the session to "paused" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: ${attachPathForms} (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap ":"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo`, inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Debug session ID' }, diff --git a/src/skill-content.ts b/src/skill-content.ts index b5bbb407a..ee7ee1ea5 100644 --- a/src/skill-content.ts +++ b/src/skill-content.ts @@ -206,7 +206,7 @@ attach_to_process {sessionId, host, port, sourcePaths, adapterConfig} - Python: target started with "python -m debugpy --listen host:port ..."; map a local checkout onto the debuggee tree with adapterConfig: {pathMappings: [{localRoot, remoteRoot}]} - Ruby: target started with "rdbg --open --port N ..." (works via kubectl port-forward); localfsMap: "/app:" maps paths - JavaScript: host/port of a "node --inspect" target, or processId of a plain local node process (its inspector is opened for you on 9229 and stays open, unauthenticated, after detach and close: #1261; pass port too for an --inspect-port target) -- Java: JVM flag -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:PORT (breakpoints defer until class load); FQCN as "file" needs no source at all +- Java: JVM flag -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:PORT (breakpoints defer until class load); replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1:PORT:PORT. FQCN as "file" needs no source at all - C/C++ (and other native): attach by PID — attach_to_process {sessionId, processId, adapterConfig: {program: ""}} - COBOL: attach by PID like C/C++; add adapterConfig: {sources: ["", …]} (the manifest is regenerated by a translate-only cobc -C) or adapterConfig: {manifestDirs: ["<.debug-mcp/cobol/-// dir of the running build>"]} so the shim finds the symbol manifest, or variables show only the engine's C view - Dart/Flutter: attach to a running VM service — pass adapterConfig.vmServiceUri or vmServiceInfoFile, not a PID (the SDK adapter is spawned locally and connects to the VM service); a Flutter app on an Android device or emulator takes adapterConfig.deviceId alone with no URI (flutter attach discovers it; the app.debugPort URI of another flutter run is that tool's own DDS and never connects) diff --git a/tests/core/unit/loopback-bindings.test.ts b/tests/core/unit/loopback-bindings.test.ts index 0d74290aa..15f0199a6 100644 --- a/tests/core/unit/loopback-bindings.test.ts +++ b/tests/core/unit/loopback-bindings.test.ts @@ -4,12 +4,24 @@ * paths to forward slashes and compare both additions and removals with a record. * Walk the requested source roots directly so new, untracked files count too. * - * This is not an AST or a network audit: comments and strings count; variable - * values, aliases, computed calls and multiline arguments cannot be resolved. A - * listen line without a literal loopback host is reviewed, including calls with - * a host variable or arguments continued on the next line. Of the listeners that - * are not Node's, only the Java bridge's `new ServerSocket(` is recognised; what - * a spawned debug adapter binds by its own default is outside this scan. + * Scope: src and each package's src (.ts/.js/.mjs/.cjs), each package's java + * tree (.java), packages/mcp-debugger/extensions and tools (.js/.mjs/.cjs), + * and the skills tree (.md). + * docs/, examples/ and READMEs outside those roots are not scanned: #1390 owns + * their wildcards. dist output, dependencies and other languages are out. + * + * Rules: an IPv4 wildcard address, [::], --listen with a colon-leading value, + * address=* anywhere and, on a line that names JDWP, address= without a + * loopback host, .listen without a literal loopback host, and + * ServerSocket/InetSocketAddress constructors without loopback arguments. + * Calls are bounded by matching parentheses on this line, respecting quotes. + * A call that continues on the next line is judged on the arguments it has + * already finished, so `listen(0, '127.0.0.1', () => {` passes and + * `listen({` goes to review. Fallbacks, ternaries and spreads cannot establish + * a literal host. Comments and strings still count as text. + * This is not a language parser or a network audit: aliases, computed calls, + * runtime values and native adapters' defaults cannot be resolved. Only these + * shapes are covered; another listener API or spelling may need a new rule. */ import { describe, expect, it } from 'vitest'; import fs from 'fs'; @@ -21,9 +33,13 @@ const ROOT = fileURLToPath(new URL('../../..', import.meta.url)); interface Occurrence { file: string; line: string; + number: number; + rules: string[]; } -interface AllowedOccurrence extends Occurrence { +interface AllowedOccurrence { + file: string; + line: string; reason: string; } @@ -37,7 +53,7 @@ const ALLOWED: AllowedOccurrence[] = [ { "file": "packages/adapter-mock/src/mock-adapter-process.ts", "line": " this.server.listen(port, host, () => {", - "reason": "Mock adapter receives the session adapterHost, 127.0.0.1, as its host argument." + "reason": "Mock receives the session adapterHost, 127.0.0.1; a standalone start defaults to localhost." }, { "file": "packages/shared/src/utils/deadline.ts", @@ -82,17 +98,17 @@ const ALLOWED: AllowedOccurrence[] = [ { "file": "src/cli/bind-address.ts", "line": "/** 0.0.0.0 or :: — every interface (`::` is dual-stack unless ipv6Only). */", - "reason": "Documents the wildcard-address predicate used by HTTP bind validation." + "reason": "Documents the wildcard-address predicate used by bindNotice and describeEndpoint." }, { "file": "src/cli/bind-address.ts", "line": " return bare === '0.0.0.0' || bare === '::';", - "reason": "Detects explicit wildcard HTTP binds so their handling can be validated." + "reason": "Identifies wildcard addresses for bindNotice and describeEndpoint." }, { "file": "src/cli/bind-address.ts", "line": " * softening: the image's own `MCP_HTTP_BIND=0.0.0.0` under `MCP_CONTAINER=true`", - "reason": "Explains that Docker wildcard binding does not soften remote-attach policy." + "reason": "Documents info instead of warn for the startup notice of the image's own wildcard bind." }, { "file": "src/cli/bind-address.ts", @@ -121,43 +137,135 @@ function walk(directory: string): string[] { } function sourceFiles(): string[] { + const script = /\.(?:js|mjs|cjs)$/; + const source = /\.(?:ts|js|mjs|cjs)$/; const packageSources = fs.readdirSync(path.join(ROOT, 'packages'), { withFileTypes: true }) - .filter(entry => entry.isDirectory() && fs.existsSync(path.join(ROOT, 'packages', entry.name, 'src'))) - .flatMap(entry => walk(`packages/${entry.name}/src`).filter(file => file.endsWith('.ts'))); + .filter(entry => entry.isDirectory()) + .flatMap(entry => ['src', 'java'].flatMap(directory => { + const root = `packages/${entry.name}/${directory}`; + if (!fs.existsSync(path.join(ROOT, root))) return []; + return walk(root).filter(file => directory === 'java' ? file.endsWith('.java') : source.test(file)); + })); return [ - ...walk('src').filter(file => file.endsWith('.ts')), + ...walk('src').filter(file => source.test(file)), ...packageSources, - ...walk('packages/adapter-java/java').filter(file => /^packages\/adapter-java\/java\/[^/]+\.java$/.test(file)), + ...walk('packages/mcp-debugger/extensions').filter(file => script.test(file)), ...walk('skills').filter(file => file.endsWith('.md')), - ...walk('tools/dev-proxy').filter(file => /^tools\/dev-proxy\/[^/]+\.mjs$/.test(file)) + ...walk('tools').filter(file => script.test(file)) ].sort(); } -function suspicious(line: string): boolean { - // Stop at the first closing parenthesis: unrelated text later on the line - // must not supply a host, and a second listen call needs its own host. - const listens = [...line.matchAll(/\.listen\s*\(([^)]*)/g)]; - // The Java bridge: a ServerSocket constructed without a bind address listens - // on every interface (the free-port probe did, until #1387). - const javaListener = /new\s+ServerSocket\s*\(/.test(line) && - !/getLoopbackAddress\s*\(\s*\)|"(?:127\.0\.0\.1|localhost|::1)"/.test(line); - return line.includes('address=*') || line.includes('0.0.0.0') || javaListener || - listens.some(listen => !/['"](?:127\.0\.0\.1|localhost|::1)['"]/.test(listen[1])); +/** Only this line: balance parentheses, skipping parentheses inside quotes. */ +function callArguments(line: string, opening: number): { text: string; complete: boolean } { + let depth = 1; + let quote = ''; + for (let index = opening + 1; index < line.length; index++) { + const char = line[index]; + if (quote) { + if (char === '\\') index++; + else if (char === quote) quote = ''; + } else if (char === '"' || char === "'" || char === '`') { + quote = char; + } else if (char === '(') { + depth++; + } else if (char === ')' && --depth === 0) { + return { text: line.slice(opening + 1, index), complete: true }; + } + } + return { text: line.slice(opening + 1), complete: false }; +} + +/** + * The arguments of an unfinished call that are already complete on this line: + * everything before the last comma that sits outside any bracket or quote. + * `0, '127.0.0.1', () => {` settles `0, '127.0.0.1'`; `{ port, host: 'x',` + * settles nothing, because the object is still open. + */ +function settledArguments(text: string): string { + let depth = 0; + let quote = ''; + let lastComma = -1; + for (let index = 0; index < text.length; index++) { + const char = text[index]; + if (quote) { + if (char === '\\') index++; + else if (char === quote) quote = ''; + } else if (char === '"' || char === "'" || char === '`') { + quote = char; + } else if (char === '(' || char === '{' || char === '[') { + depth++; + } else if (char === ')' || char === '}' || char === ']') { + depth--; + } else if (char === ',' && depth === 0) { + lastComma = index; + } + } + return lastComma === -1 ? '' : text.slice(0, lastComma); +} + +function rulesFor(line: string): string[] { + const rules: string[] = []; + if (/(? match[1].startsWith('*')) || + (/jdwp/i.test(line) && addresses.some(match => !loopbackAddress.test(match[1])))) { + rules.push('jdwp-address'); + } + + const calls: Array<[string, RegExp]> = [ + ['listen-host', /\.listen\s*\(/g], + ['java-server-socket', /\bnew\s+(?:java\.net\.)?ServerSocket\s*\(/g], + ['java-inet-socket-address', /\bnew\s+(?:java\.net\.)?InetSocketAddress\s*\(/g] + ]; + for (const [rule, pattern] of calls) { + for (const match of line.matchAll(pattern)) { + const args = callArguments(line, match.index + match[0].length - 1); + // A call that continues on the next line is judged on the arguments it has + // already finished: `listen(0, '127.0.0.1', () => {` names its host before + // the callback opens. With none finished, the line goes to review. + const text = args.complete ? args.text : settledArguments(args.text); + // Strip quoted text only for the operator check; a string containing '?' is inert. + const expressions = text.replace(/(['"`])(?:\\.|(?!\1).)*\1/g, ''); + const dynamic = /\?\?|\|\||(?(); for (const occurrence of found) { const index = remaining.findIndex(entry => entry.file === occurrence.file && entry.line === occurrence.line); if (index === -1) { - problems.push(`New occurrence: ${occurrence.file}\n${occurrence.line}\nBind loopback (127.0.0.1), or add this exact line to ALLOWED with a one-line reason.`); + newFiles.add(occurrence.file); + problems.push(`New occurrence: ${occurrence.file}:${occurrence.number} [${occurrence.rules.join(', ')}]\n${occurrence.line}\nBind loopback (127.0.0.1), or add this exact line to ALLOWED with a one-line reason.`); } else { remaining.splice(index, 1); } } for (const entry of remaining) { - problems.push(`Stale allowance: ${entry.file}\n${entry.line}\nRemove this entry from ALLOWED; it no longer matches an occurrence.`); + problems.push(`Stale allowance: ${entry.file} [${rulesFor(entry.line).join(', ') || 'no rule still matches'}; no matching source line]\n${entry.line}\nRemove this entry from ALLOWED; it no longer matches an occurrence.`); + } + for (const file of new Set(remaining.map(entry => entry.file))) { + if (newFiles.has(file)) { + problems.push(`${file}: If you edited a recorded line, update its text in ALLOWED.`); + } } return problems; } @@ -165,7 +273,10 @@ function differences(found: Occurrence[], allowed: AllowedOccurrence[]): string[ describe('loopback bindings and guidance', () => { it('records every reviewed occurrence and rejects stale allowances', () => { const found = sourceFiles().flatMap(file => fs.readFileSync(path.join(ROOT, file), 'utf8') - .split(/\r?\n/).filter(suspicious).map(line => ({ file, line }))); + .split(/\r?\n/).flatMap((line, index) => { + const rules = rulesFor(line); + return rules.length ? [{ file, line, number: index + 1, rules }] : []; + })); for (const entry of ALLOWED) { expect(entry.reason.trim(), `${entry.file}: give a one-line reason`).not.toBe(''); expect(entry.reason).not.toMatch(/[\r\n]/); @@ -174,29 +285,100 @@ describe('loopback bindings and guidance', () => { }); it.each([ - ['address=*:', true], - ['address=0.0.0.0:5005', true], - ['server.listen(0, () => {', true], - ['server.listen({', true], - ['server.listen(port, host);', true], - ['server.listen(port); log("127.0.0.1");', true], - ['a.listen(0, "127.0.0.1"); b.listen(0);', true], - ['server.listen(0, "127.0.0.1", callback);', false], - ["server.listen({ port, host: '127.0.0.1' }, callback);", false], - ['address=127.0.0.1:', false], - ['try (ServerSocket ss = new ServerSocket(0)) {', true], - ['try (ServerSocket ss = new ServerSocket(port)) {', true], - ['try (ServerSocket ss = new ServerSocket(0, 1, InetAddress.getLoopbackAddress())) {', false] - ])('classifies %s', (line, expected) => { - expect(suspicious(line)).toBe(expected); + ['0.0.0.0', ['ipv4-wildcard']], + ['// 10.0.0.0/8', []], + ['// 0.0.0.01', []], + ['[::]:5005', ['ipv6-wildcard']], + ['[::1]:5005', []], + ['dlv dap --listen=:port', ['wildcard-listen-option']], + ['dlv dap --listen :port', ['wildcard-listen-option']], + ['dlv dap --listen=127.0.0.1:5005', []], + ['address=*:5005', ['jdwp-address']], + ['address=*:', ['jdwp-address']], + ['address=5005', []], + ['(address=${attachHost})', []], + ['address=[::]:5005', ['ipv6-wildcard']], + ['address=0.0.0.0:5005', ['ipv4-wildcard']], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=5005', ['jdwp-address']], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=', ['jdwp-address']], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=*:5005', ['jdwp-address']], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=[::]:5005', ['ipv6-wildcard', 'jdwp-address']], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=0.0.0.0:5005', ['ipv4-wildcard', 'jdwp-address']], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:', []], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=localhost:5005', []], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=[::1]:5005', []], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=::1:5005', []], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.10:5005', ['jdwp-address']], + ['-agentlib:jdwp=transport=dt_socket,server=y,address=', ['jdwp-address']], + ['-agentlib:jdwp=transport=dt_socket,server=y,myaddress=5005', []], + ['JDWP: address=5005', ['jdwp-address']], + ['server.listen(0, () => {', ['listen-host']], + ['server.listen({', ['listen-host']], + ['server.listen(0, "127.0.0.1",', []], + ["server.listen(0, '127.0.0.1', () => {", []], + ["server.listen({ port, host: '127.0.0.1' }, () => {", []], + ["server.listen({ port, host: '127.0.0.1',", ['listen-host']], + ["server.listen(port, host ?? '127.0.0.1', () => {", ['listen-host']], + ["server.listen(0, () => { log('127.0.0.1');", ['listen-host']], + ["server.listen(0, [1, '127.0.0.1'", ['listen-host']], + ['server.listen(port, host);', ['listen-host']], + ['server.listen(port); log("127.0.0.1");', ['listen-host']], + ['server.listen(0) // not "localhost"', ['listen-host']], + ['a.listen(0, "127.0.0.1"); b.listen(0);', ['listen-host']], + ['server.listen(0, "127.0.0.1", callback);', []], + ["server.listen(0, 'localhost', callback);", []], + ["server.listen(0, '::1', callback);", []], + ["server.listen({ port, host: '127.0.0.1' }, callback);", []], + ["server.listen(Number(port), '127.0.0.1', cb)", []], + ["server.listen(Number(')'), '127.0.0.1', cb)", []], + ['server.listen(Number("("), "127.0.0.1", cb)', []], + ["server.listen(port, host ?? '127.0.0.1');", ['listen-host']], + ["server.listen(port, host || 'localhost');", ['listen-host']], + ["server.listen(port, local ? '127.0.0.1' : host);", ['listen-host']], + ["server.listen({ port, host: '127.0.0.1', ...rest });", ['listen-host']], + ["server.listen(port, '127.0.0.1', () => log('?'));", []], + ['server.listen(port, "127.0.0.1", () => log("?"));', []], + ['server.listen(port, "127.0.0.1", () => log(`?`));', []], + [String.raw`server.listen(Number('\')'), '127.0.0.1', cb)`, []], + ['new ServerSocket(0)', ['java-server-socket']], + ['renew ServerSocket(port)', []], + ['new java.net.ServerSocket(port)', ['java-server-socket']], + ['new ServerSocket(port); log("127.0.0.1");', ['java-server-socket']], + ['new ServerSocket(0) // not "localhost"', ['java-server-socket']], + ['new ServerSocket(0, 1, InetAddress.getLoopbackAddress())', []], + ['new ServerSocket(0, 1, InetAddress.getByName("127.0.0.1"))', []], + ['new ServerSocket(0, 1, InetAddress.getByName("localhost"))', []], + ['new ServerSocket(0, 1, InetAddress.getByName("::1"))', []], + ['new java.net.ServerSocket(0, 1, InetAddress.getLoopbackAddress())', []], + ['new ServerSocket(0, 1, InetAddress.getByName("127.0.0.1"),', []], + ['new ServerSocket(0, 1,', ['java-server-socket']], + ['new InetSocketAddress(port)', ['java-inet-socket-address']], + ['new java.net.InetSocketAddress(port)', ['java-inet-socket-address']], + ['new InetSocketAddress(port); log("127.0.0.1");', ['java-inet-socket-address']], + ['new InetSocketAddress(InetAddress.getLoopbackAddress(), port)', []], + ['new InetSocketAddress("127.0.0.1", port)', []], + ['new InetSocketAddress("localhost", port)', []], + ['new InetSocketAddress("::1", port)', []], + ['new java.net.InetSocketAddress("127.0.0.1", port)', []], + ['new InetSocketAddress("127.0.0.1",', []], + ['new InetSocketAddress(', ['java-inet-socket-address']] + ] satisfies Array<[string, string[]]>)('classifies %s', (line, expected) => { + expect(rulesFor(line)).toEqual(expected); }); it('requires exact text and counts repeated occurrences separately', () => { const allowed = { file: 'src/example.ts', line: 'server.listen(port);', reason: 'Example reviewed for this test.' }; - expect(differences([allowed], [allowed])).toEqual([]); + const occurrence = { ...allowed, number: 3, rules: ['listen-host'] }; + expect(differences([occurrence], [allowed])).toEqual([]); expect(differences([], [allowed]).join()).toContain('Stale allowance'); - expect(differences([allowed, allowed], [allowed]).join()).toContain('New occurrence'); - const changed = { ...allowed, line: ` ${allowed.line}` }; - expect(differences([changed], [allowed]).join()).toMatch(/New occurrence[\s\S]*Stale allowance/); + expect(differences([occurrence, occurrence], [allowed]).join()).toContain('New occurrence'); + const changed = { ...occurrence, line: ` ${allowed.line}` }; + const message = differences([changed], [allowed]).join('\n'); + expect(message).toContain('src/example.ts:3 [listen-host]'); + expect(message).toMatch(/New occurrence[\s\S]*Stale allowance/); + expect(message).toContain('If you edited a recorded line, update its text in ALLOWED.'); + expect(differences([occurrence], []).join()).not.toContain('If you edited'); + const stale = { ...allowed, line: 'other.listen(port);' }; + expect(differences([occurrence, occurrence], [allowed, stale]).join()).toContain('If you edited'); }); }); diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json index 4ceb592ef..636e98e9e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json index 5e4ee3e7c..50aca8adf 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json index b1685408f..441fdba48 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json index 18287d7a0..f3a40b1cd 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json index b1685408f..441fdba48 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json index 18287d7a0..f3a40b1cd 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json index bfc2b4f90..649363036 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json index 17a90a9b0..87d29cc74 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json index 6a891d9ab..2bb37d18e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json index 58129c43e..0f342c2fc 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json index 6a891d9ab..2bb37d18e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json index 58129c43e..0f342c2fc 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json index d51ff560b..9b10dd0b7 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json index 167e7990c..24a36b45a 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json index 6980f793b..b6bf45b1d 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json index bea550623..544151527 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json index 6980f793b..b6bf45b1d 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json index bea550623..544151527 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json index bfc2b4f90..649363036 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json index 17a90a9b0..87d29cc74 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json index 6a891d9ab..2bb37d18e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json index 58129c43e..0f342c2fc 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json index 6a891d9ab..2bb37d18e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json index 58129c43e..0f342c2fc 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:; C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/server-instructions.test.ts b/tests/core/unit/server/server-instructions.test.ts index 4e7f558b5..07aeb7dc4 100644 --- a/tests/core/unit/server/server-instructions.test.ts +++ b/tests/core/unit/server/server-instructions.test.ts @@ -336,7 +336,10 @@ describe('Java attach guidance (#1389)', () => { const attach = tools.find(tool => tool.name === 'attach_to_process')?.description ?? ''; for (const text of [DEBUGGING_WORKFLOW_PROMPT, skill, attach]) { expect(text).toContain('-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:'); + expect(text).toContain('only for attach from another machine or container'); + expect(text).toMatch(/-p 127\.0\.0\.1:(?:|PORT):(?:|PORT)/); } + expect(skill).toContain('JDWP has no authentication'); }); }); diff --git a/tests/unit/implementations/network-manager-impl.test.ts b/tests/unit/implementations/network-manager-impl.test.ts index efef55a42..37ff352ea 100644 --- a/tests/unit/implementations/network-manager-impl.test.ts +++ b/tests/unit/implementations/network-manager-impl.test.ts @@ -71,7 +71,8 @@ describe('NetworkManagerImpl', () => { const freePort = 12345; // Setup mock behavior - mockServer.listen.mockImplementation(((port: number, host: string, callback?: Function) => { + mockServer.listen.mockImplementation(((...args: unknown[]) => { + const callback = args.find((arg): arg is () => void => typeof arg === 'function'); if (callback) { process.nextTick(() => callback()); } @@ -113,7 +114,8 @@ describe('NetworkManagerImpl', () => { it('should handle invalid address format', async () => { - mockServer.listen.mockImplementation(((port: number, host: string, callback?: Function) => { + mockServer.listen.mockImplementation(((...args: unknown[]) => { + const callback = args.find((arg): arg is () => void => typeof arg === 'function'); if (callback) { process.nextTick(() => callback()); } @@ -135,7 +137,8 @@ describe('NetworkManagerImpl', () => { it('should handle null address', async () => { - mockServer.listen.mockImplementation(((port: number, host: string, callback?: Function) => { + mockServer.listen.mockImplementation(((...args: unknown[]) => { + const callback = args.find((arg): arg is () => void => typeof arg === 'function'); if (callback) { process.nextTick(() => callback()); } @@ -158,7 +161,8 @@ describe('NetworkManagerImpl', () => { it('should clean up server resources on success', async () => { const freePort = 54321; - mockServer.listen.mockImplementation(((port: number, host: string, callback?: Function) => { + mockServer.listen.mockImplementation(((...args: unknown[]) => { + const callback = args.find((arg): arg is () => void => typeof arg === 'function'); if (callback) { process.nextTick(() => callback()); } From 6cc2f8bba75895d4c63b4060c83ef61f72a8d32d Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 29 Nov 2026 18:10:46 -0500 Subject: [PATCH 4/5] fix: the loopback guard records every listener instead of judging it (#1389) Second review round on the guard (Gemini with a mutation pass, Claude Opus). Both found the same thing in different lines: the guard tried to tell from one line of text whether a listen call binds loopback, and a loopback literal can sit in a callback, a nested call, a template, a fallback, or on a key that is not the host. Four of Gemini's mutants survived; each patch of the heuristic opened the next hole. The premise was wrong, so it is gone. The guard no longer judges what a listener binds. Every .listen( call and every Java ServerSocket or InetSocketAddress constructor in scope is on the recorded list with what it binds and why, and a new one fails until someone has looked at it and written that down. The text rules are unchanged (0.0.0.0, [::], a --listen value that starts with a colon, a wildcard or non-loopback JDWP address=), except that 0.0.0.0 at the end of a sentence is now seen. 23 recorded lines, seven of them listeners that the previous version let through unrecorded because they looked right. 47 recognition rows; sixteen text-only mutants all fail it, among them a correct-looking new loopback listener, a recorded listener given a variable host, and the two old bridge lines. Guidance. The sentence added in the previous commit sent an in-pod sidecar, which shares the pod's loopback, to a wildcard address, and gave no tunnel for another machine. The three general texts now name the one case that needs more than loopback, a JVM in a Docker container reached through a published port, and the skill says what loopback already serves. The changelog entry follows: the hint is unchanged, and the probe also runs on a dry run. Written by the manager session. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs --- changelog.d/1389.fixed.md | 2 +- skills/debugging/SKILL.md | 2 +- src/server/tool-schemas.ts | 2 +- src/skill-content.ts | 2 +- tests/core/unit/loopback-bindings.test.ts | 214 +++++++----------- .../bp-assert.va-explicit.container-true.json | 2 +- ...bp-assert.va-explicit.container-unset.json | 2 +- .../bp-assert.va-open.container-true.json | 2 +- .../bp-assert.va-open.container-unset.json | 2 +- .../bp-assert.va-unset.container-true.json | 2 +- .../bp-assert.va-unset.container-unset.json | 2 +- ...bp-content.va-explicit.container-true.json | 2 +- ...p-content.va-explicit.container-unset.json | 2 +- .../bp-content.va-open.container-true.json | 2 +- .../bp-content.va-open.container-unset.json | 2 +- .../bp-content.va-unset.container-true.json | 2 +- .../bp-content.va-unset.container-unset.json | 2 +- .../bp-line.va-explicit.container-true.json | 2 +- .../bp-line.va-explicit.container-unset.json | 2 +- .../bp-line.va-open.container-true.json | 2 +- .../bp-line.va-open.container-unset.json | 2 +- .../bp-line.va-unset.container-true.json | 2 +- .../bp-line.va-unset.container-unset.json | 2 +- .../bp-unset.va-explicit.container-true.json | 2 +- .../bp-unset.va-explicit.container-unset.json | 2 +- .../bp-unset.va-open.container-true.json | 2 +- .../bp-unset.va-open.container-unset.json | 2 +- .../bp-unset.va-unset.container-true.json | 2 +- .../bp-unset.va-unset.container-unset.json | 2 +- .../unit/server/server-instructions.test.ts | 2 +- 30 files changed, 107 insertions(+), 165 deletions(-) diff --git a/changelog.d/1389.fixed.md b/changelog.d/1389.fixed.md index bee055466..b050d2646 100644 --- a/changelog.d/1389.fixed.md +++ b/changelog.d/1389.fixed.md @@ -1 +1 @@ -**The Java attach guidance and the server's free-port probe keep to loopback** — the text an agent reads before attaching to a JVM (the `attach_to_process` description, the Java adapter's attach hint, the workflow prompt and the debugging skill) told it to start the JVM with `address=*:`, which opens the unauthenticated JDWP port on every network interface. It now gives `address=127.0.0.1:`, and says when a wider address is needed (an attach from another machine or into a container) and how to publish a container's port on the host's loopback. The Java docs and skill reference name `127.0.0.1` where they gave a bare port, which is every interface on a JDK 8 target. The server's own free-port probe, on every launch, attach and restart, listened with no host and so on every interface for an instant; it binds `127.0.0.1`. A check in the unit suite now scans the server's and adapters' sources, the Java bridge and the skill text for the shapes this class takes (`0.0.0.0`, `[::]`, a `--listen` value that starts with a colon, a wildcard or non-loopback JDWP `address=`, a `listen` call or a Java socket constructor that names no loopback host) against a recorded list of reviewed lines, each with its reason: a new one fails until it is bound to loopback or recorded on purpose, and so does a recorded line that no longer matches (#1389) +**The Java attach guidance and the server's free-port probe keep to loopback** — the text an agent reads before attaching to a JVM (the `attach_to_process` description, the Java adapter's attach hint, the workflow prompt and the debugging skill) told it to start the JVM with `address=*:`, which opens the unauthenticated JDWP port on every network interface. All four now give `address=127.0.0.1:`, and the three general ones name the case that needs more: a JVM in a Docker container reached through a published port, which is then published on the host's loopback. The Java docs and skill reference name `127.0.0.1` where they gave a bare port, which is every interface on a JDK 8 target. The server's own free-port probe, each time a launch or an attach is prepared (a dry run included), listened with no host and so on every interface for an instant; it binds `127.0.0.1`. A check in the unit suite now holds a recorded list of every listening socket in the server's and adapters' sources and the Java bridge, each with what it binds and why, and of every line there or in the skill text that writes a wildcard address (`0.0.0.0`, `[::]`, a `--listen` value that starts with a colon, a wildcard or non-loopback JDWP `address=`): a new listener or a new wildcard fails until someone has looked at it and recorded it, and so does a recorded line that no longer matches (#1389) diff --git a/skills/debugging/SKILL.md b/skills/debugging/SKILL.md index 3a986bf12..c0af49428 100644 --- a/skills/debugging/SKILL.md +++ b/skills/debugging/SKILL.md @@ -83,7 +83,7 @@ attach_to_process {sessionId, host: "localhost", port: 5678, sourcePaths: [": ...`; to address breakpoints by local-checkout path, map it onto the debuggee tree with `adapterConfig: {pathMappings: [{localRoot: "", remoteRoot: "/app"}]}` - **Ruby**: target ran `rdbg --open --port ...` (works through `kubectl port-forward`); `localfsMap: "/app:"` maps paths - **JavaScript**: target ran `node --inspect=: ...` → attach by `host`/`port`; a plain `node app.js` on the same host → attach by `processId` (mcp-debugger opens its inspector on 9229, and it stays open, unauthenticated, after detach and close: #1261 — pass `port` too if the target set `--inspect-port=`) -- **Java**: target JVM has `-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:`; replace `127.0.0.1` with `*` only for attach from another machine or container. For a container publish the port on the host's loopback: `-p 127.0.0.1::`. JDWP has no authentication; restrict network access to trusted debugger clients. Breakpoints in not-yet-loaded classes are deferred automatically, and a fully-qualified class name as `file` needs no source files at all +- **Java**: target JVM has `-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:`. JDWP has no authentication, so keep it on loopback: that serves this machine, an in-pod sidecar and an SSH tunnel to another machine. A JVM in a Docker container reached through a published port needs `*` in place of `127.0.0.1`: publish that port on the host's loopback (`-p 127.0.0.1::`). Breakpoints in not-yet-loaded classes are deferred automatically, and a fully-qualified class name as `file` needs no source files at all - **C/C++ (and other native)**: attach by PID instead of port — `attach_to_process {sessionId, processId: , adapterConfig: {program: ""}}`; in a Kubernetes ephemeral debug container use `processId: 1` with `program: "/proc/1/root/"` (on Linux, mind `kernel.yama.ptrace_scope`) - **COBOL**: attach by PID like C/C++, plus `adapterConfig: {sources: ["", …], dialect: "ibm"}` (the manifest is regenerated by a translate-only `cobc -C`; pass the options the binary was built with) or `adapterConfig: {manifestDirs: [""]}` (an earlier source launch's `.debug-mcp/cobol/-[-container]///`, needs no cobc) so variables are COBOL-shaped; without either only the engine's C view is available. A job paused inside libcob still shows its program's data division (scopes from the nearest COBOL frame up the stack) - **Dart/Flutter**: attach by VM-service URI, never by PID — `attach_to_process {sessionId, adapterConfig: {vmServiceUri: "ws://127.0.0.1:/=/ws"}}` (the URI a `dart --enable-vm-service … run` target prints, or `flutter run --machine`'s `app.debugPort` event) or `adapterConfig: {vmServiceInfoFile: ""}`; a bare `host`/`port` only works for a VM started with `--disable-service-auth-codes`. The `dart-test`/`flutter-test` runners refuse attach. An isolate idle in an `await` shows an empty stack at the attach pause — set a breakpoint and `continue_execution`, or attach with `stopOnEntry: false` diff --git a/src/server/tool-schemas.ts b/src/server/tool-schemas.ts index 8f7c8658a..6122bc7cc 100644 --- a/src/server/tool-schemas.ts +++ b/src/server/tool-schemas.ts @@ -262,7 +262,7 @@ export function buildToolDefinitions(options: BuildToolDefinitionsOptions): Tool } }, { name: 'restart_debugging', description: 'Restart the debuggee: terminate the current program (if still running) and relaunch it with the same configuration as the last start_debugging. All current breakpoints are re-applied automatically. The get_output buffer starts fresh — read from since=0 after a restart. A Flutter session hot-restarts in place instead, an attached one included: same process, output buffer kept, and the answer carries hotRestart: true. Works while running, paused, or after the program has exited. Not available for sessions never launched, or for attach sessions of the other adapters (detach and re-attach). Answers like start_debugging, including "running" with pending:true when the relaunch has not stopped within the same short hold (then call wait_for_stop)', inputSchema: { type: 'object', properties: { sessionId: { type: 'string' } }, required: ['sessionId'] } }, - { name: 'attach_to_process', description: `Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state "running" with pending:true; the late event alone changes the session to "paused" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: ${attachPathForms} (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap ":"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo`, inputSchema: { + { name: 'attach_to_process', description: `Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state "running" with pending:true; the late event alone changes the session to "paused" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: ${attachPathForms} (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap ":"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo`, inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Debug session ID' }, diff --git a/src/skill-content.ts b/src/skill-content.ts index ee7ee1ea5..e741bd3d0 100644 --- a/src/skill-content.ts +++ b/src/skill-content.ts @@ -206,7 +206,7 @@ attach_to_process {sessionId, host, port, sourcePaths, adapterConfig} - Python: target started with "python -m debugpy --listen host:port ..."; map a local checkout onto the debuggee tree with adapterConfig: {pathMappings: [{localRoot, remoteRoot}]} - Ruby: target started with "rdbg --open --port N ..." (works via kubectl port-forward); localfsMap: "/app:" maps paths - JavaScript: host/port of a "node --inspect" target, or processId of a plain local node process (its inspector is opened for you on 9229 and stays open, unauthenticated, after detach and close: #1261; pass port too for an --inspect-port target) -- Java: JVM flag -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:PORT (breakpoints defer until class load); replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1:PORT:PORT. FQCN as "file" needs no source at all +- Java: JVM flag -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:PORT (breakpoints defer until class load); a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1:PORT:PORT; reach another machine through an SSH tunnel. FQCN as "file" needs no source at all - C/C++ (and other native): attach by PID — attach_to_process {sessionId, processId, adapterConfig: {program: ""}} - COBOL: attach by PID like C/C++; add adapterConfig: {sources: ["", …]} (the manifest is regenerated by a translate-only cobc -C) or adapterConfig: {manifestDirs: ["<.debug-mcp/cobol/-// dir of the running build>"]} so the shim finds the symbol manifest, or variables show only the engine's C view - Dart/Flutter: attach to a running VM service — pass adapterConfig.vmServiceUri or vmServiceInfoFile, not a PID (the SDK adapter is spawned locally and connects to the VM service); a Flutter app on an Android device or emulator takes adapterConfig.deviceId alone with no URI (flutter attach discovers it; the app.debugPort URI of another flutter run is that tool's own DDS and never connects) diff --git a/tests/core/unit/loopback-bindings.test.ts b/tests/core/unit/loopback-bindings.test.ts index 15f0199a6..12b40b907 100644 --- a/tests/core/unit/loopback-bindings.test.ts +++ b/tests/core/unit/loopback-bindings.test.ts @@ -10,18 +10,18 @@ * docs/, examples/ and READMEs outside those roots are not scanned: #1390 owns * their wildcards. dist output, dependencies and other languages are out. * - * Rules: an IPv4 wildcard address, [::], --listen with a colon-leading value, - * address=* anywhere and, on a line that names JDWP, address= without a - * loopback host, .listen without a literal loopback host, and - * ServerSocket/InetSocketAddress constructors without loopback arguments. - * Calls are bounded by matching parentheses on this line, respecting quotes. - * A call that continues on the next line is judged on the arguments it has - * already finished, so `listen(0, '127.0.0.1', () => {` passes and - * `listen({` goes to review. Fallbacks, ternaries and spreads cannot establish - * a literal host. Comments and strings still count as text. - * This is not a language parser or a network audit: aliases, computed calls, - * runtime values and native adapters' defaults cannot be resolved. Only these - * shapes are covered; another listener API or spelling may need a new rule. + * Two kinds of rule. + * An address written as text: an IPv4 wildcard address, [::], a --listen value + * that starts with a colon, address=* anywhere and, on a line that names JDWP, + * address= without a loopback host. + * A listening socket: every `.listen(` call and every Java ServerSocket or + * InetSocketAddress constructor. The check does not judge what such a line + * binds. A line scan cannot do that soundly (a literal may sit in a callback, a + * fallback, a nested call), so every one is recorded with what it binds and why, + * and a new one fails until someone has looked at it and written that down. + * Comments and strings count as text. Another listener API or another spelling + * of "every interface" needs a new rule: only these shapes are covered, and what + * a spawned debug adapter binds by its own default is outside this scan. */ import { describe, expect, it } from 'vitest'; import fs from 'fs'; @@ -124,6 +124,41 @@ const ALLOWED: AllowedOccurrence[] = [ "file": "tools/dev-proxy/backend-subscriptions.mjs", "line": " open = await client.listen({", "reason": "MCP client.listen opens a subscription stream to the backend, not a listening socket." + }, + { + "file": "packages/adapter-cobol/src/shim/shim-core.ts", + "line": " probe.listen(0, '127.0.0.1', () => {", + "reason": "The COBOL shim's free-port probe for its CodeLLDB: binds 127.0.0.1 and closes at once." + }, + { + "file": "packages/adapter-cobol/src/shim/shim-core.ts", + "line": " server.listen(config.listenPort, '127.0.0.1', () => {", + "reason": "The COBOL shim's DAP socket for the proxy: binds 127.0.0.1." + }, + { + "file": "packages/adapter-dotnet/src/utils/netcoredbg-bridge-core.ts", + "line": " server.listen(port, '127.0.0.1');", + "reason": "The netcoredbg TCP-to-stdio bridge, for the proxy: binds 127.0.0.1." + }, + { + "file": "packages/adapter-java/java/JdiDapServer.java", + "line": " try (ServerSocket serverSocket = new ServerSocket(port, 1, InetAddress.getLoopbackAddress())) {", + "reason": "The Java bridge's DAP socket for the proxy: binds the JVM's loopback address, one client (#1394 covers a JVM that prefers IPv6)." + }, + { + "file": "packages/adapter-java/java/JdiDapServer.java", + "line": " try (ServerSocket ss = new ServerSocket(0, 1, InetAddress.getLoopbackAddress())) {", + "reason": "The Java bridge's free-port probe for the launched JVM's JDWP port: binds the loopback address and closes at once." + }, + { + "file": "src/implementations/network-manager-impl.ts", + "line": " server.listen(0, '127.0.0.1', () => {", + "reason": "The server's free-port probe for a session's adapter port: binds 127.0.0.1 and closes at once." + }, + { + "file": "src/proxy/dap-mirror-server.ts", + "line": " server.listen({ port, host: '127.0.0.1' }, () => {", + "reason": "The DAP mirror endpoint of expose_session: binds 127.0.0.1 on a random port, behind a token." } ]; @@ -155,57 +190,11 @@ function sourceFiles(): string[] { ].sort(); } -/** Only this line: balance parentheses, skipping parentheses inside quotes. */ -function callArguments(line: string, opening: number): { text: string; complete: boolean } { - let depth = 1; - let quote = ''; - for (let index = opening + 1; index < line.length; index++) { - const char = line[index]; - if (quote) { - if (char === '\\') index++; - else if (char === quote) quote = ''; - } else if (char === '"' || char === "'" || char === '`') { - quote = char; - } else if (char === '(') { - depth++; - } else if (char === ')' && --depth === 0) { - return { text: line.slice(opening + 1, index), complete: true }; - } - } - return { text: line.slice(opening + 1), complete: false }; -} - -/** - * The arguments of an unfinished call that are already complete on this line: - * everything before the last comma that sits outside any bracket or quote. - * `0, '127.0.0.1', () => {` settles `0, '127.0.0.1'`; `{ port, host: 'x',` - * settles nothing, because the object is still open. - */ -function settledArguments(text: string): string { - let depth = 0; - let quote = ''; - let lastComma = -1; - for (let index = 0; index < text.length; index++) { - const char = text[index]; - if (quote) { - if (char === '\\') index++; - else if (char === quote) quote = ''; - } else if (char === '"' || char === "'" || char === '`') { - quote = char; - } else if (char === '(' || char === '{' || char === '[') { - depth++; - } else if (char === ')' || char === '}' || char === ']') { - depth--; - } else if (char === ',' && depth === 0) { - lastComma = index; - } - } - return lastComma === -1 ? '' : text.slice(0, lastComma); -} +const LISTENER_RULES = ['listener', 'java-socket']; function rulesFor(line: string): string[] { const rules: string[] = []; - if (/(? !loopbackAddress.test(match[1])))) { rules.push('jdwp-address'); } - - const calls: Array<[string, RegExp]> = [ - ['listen-host', /\.listen\s*\(/g], - ['java-server-socket', /\bnew\s+(?:java\.net\.)?ServerSocket\s*\(/g], - ['java-inet-socket-address', /\bnew\s+(?:java\.net\.)?InetSocketAddress\s*\(/g] - ]; - for (const [rule, pattern] of calls) { - for (const match of line.matchAll(pattern)) { - const args = callArguments(line, match.index + match[0].length - 1); - // A call that continues on the next line is judged on the arguments it has - // already finished: `listen(0, '127.0.0.1', () => {` names its host before - // the callback opens. With none finished, the line goes to review. - const text = args.complete ? args.text : settledArguments(args.text); - // Strip quoted text only for the operator check; a string containing '?' is inert. - const expressions = text.replace(/(['"`])(?:\\.|(?!\1).)*\1/g, ''); - const dynamic = /\?\?|\|\||(? LISTENER_RULES.includes(rule)) + ? 'A listening socket. Add this exact line to ALLOWED with what it binds and why; bind 127.0.0.1 unless an operator chooses the address.' + : 'Write a loopback address, or add this exact line to ALLOWED with a one-line reason.'; +} + function differences(found: Occurrence[], allowed: AllowedOccurrence[]): string[] { const remaining = [...allowed]; const problems: string[] = []; @@ -254,7 +226,7 @@ function differences(found: Occurrence[], allowed: AllowedOccurrence[]): string[ const index = remaining.findIndex(entry => entry.file === occurrence.file && entry.line === occurrence.line); if (index === -1) { newFiles.add(occurrence.file); - problems.push(`New occurrence: ${occurrence.file}:${occurrence.number} [${occurrence.rules.join(', ')}]\n${occurrence.line}\nBind loopback (127.0.0.1), or add this exact line to ALLOWED with a one-line reason.`); + problems.push(`New occurrence: ${occurrence.file}:${occurrence.number} [${occurrence.rules.join(', ')}]\n${occurrence.line}\n${advice(occurrence.rules)}`); } else { remaining.splice(index, 1); } @@ -286,8 +258,11 @@ describe('loopback bindings and guidance', () => { it.each([ ['0.0.0.0', ['ipv4-wildcard']], + ['binds 0.0.0.0.', ['ipv4-wildcard']], + ['--host 0.0.0.0 --port 1', ['ipv4-wildcard']], ['// 10.0.0.0/8', []], ['// 0.0.0.01', []], + ['// 0.0.0.0.1', []], ['[::]:5005', ['ipv6-wildcard']], ['[::1]:5005', []], ['dlv dap --listen=:port', ['wildcard-listen-option']], @@ -312,56 +287,23 @@ describe('loopback bindings and guidance', () => { ['-agentlib:jdwp=transport=dt_socket,server=y,address=', ['jdwp-address']], ['-agentlib:jdwp=transport=dt_socket,server=y,myaddress=5005', []], ['JDWP: address=5005', ['jdwp-address']], - ['server.listen(0, () => {', ['listen-host']], - ['server.listen({', ['listen-host']], - ['server.listen(0, "127.0.0.1",', []], - ["server.listen(0, '127.0.0.1', () => {", []], - ["server.listen({ port, host: '127.0.0.1' }, () => {", []], - ["server.listen({ port, host: '127.0.0.1',", ['listen-host']], - ["server.listen(port, host ?? '127.0.0.1', () => {", ['listen-host']], - ["server.listen(0, () => { log('127.0.0.1');", ['listen-host']], - ["server.listen(0, [1, '127.0.0.1'", ['listen-host']], - ['server.listen(port, host);', ['listen-host']], - ['server.listen(port); log("127.0.0.1");', ['listen-host']], - ['server.listen(0) // not "localhost"', ['listen-host']], - ['a.listen(0, "127.0.0.1"); b.listen(0);', ['listen-host']], - ['server.listen(0, "127.0.0.1", callback);', []], - ["server.listen(0, 'localhost', callback);", []], - ["server.listen(0, '::1', callback);", []], - ["server.listen({ port, host: '127.0.0.1' }, callback);", []], - ["server.listen(Number(port), '127.0.0.1', cb)", []], - ["server.listen(Number(')'), '127.0.0.1', cb)", []], - ['server.listen(Number("("), "127.0.0.1", cb)', []], - ["server.listen(port, host ?? '127.0.0.1');", ['listen-host']], - ["server.listen(port, host || 'localhost');", ['listen-host']], - ["server.listen(port, local ? '127.0.0.1' : host);", ['listen-host']], - ["server.listen({ port, host: '127.0.0.1', ...rest });", ['listen-host']], - ["server.listen(port, '127.0.0.1', () => log('?'));", []], - ['server.listen(port, "127.0.0.1", () => log("?"));', []], - ['server.listen(port, "127.0.0.1", () => log(`?`));', []], - [String.raw`server.listen(Number('\')'), '127.0.0.1', cb)`, []], - ['new ServerSocket(0)', ['java-server-socket']], + ['server.listen(0, () => {', ['listener']], + ['server.listen({', ['listener']], + ['server .listen (port);', ['listener']], + ['a.listen(0); b.listen(1);', ['listener']], + ["server.listen(0, '127.0.0.1', callback);", ['listener']], + ["server.listen({ port, host: '127.0.0.1' }, callback);", ['listener']], + ['tree.listen(outside);', ['listener']], + ['emitter.listening(port);', []], + ['const listen = 1;', []], + ['new ServerSocket(0)', ['java-socket']], + ['new ServerSocket(0, 1, InetAddress.getLoopbackAddress())', ['java-socket']], + ['new java.net.ServerSocket(port)', ['java-socket']], ['renew ServerSocket(port)', []], - ['new java.net.ServerSocket(port)', ['java-server-socket']], - ['new ServerSocket(port); log("127.0.0.1");', ['java-server-socket']], - ['new ServerSocket(0) // not "localhost"', ['java-server-socket']], - ['new ServerSocket(0, 1, InetAddress.getLoopbackAddress())', []], - ['new ServerSocket(0, 1, InetAddress.getByName("127.0.0.1"))', []], - ['new ServerSocket(0, 1, InetAddress.getByName("localhost"))', []], - ['new ServerSocket(0, 1, InetAddress.getByName("::1"))', []], - ['new java.net.ServerSocket(0, 1, InetAddress.getLoopbackAddress())', []], - ['new ServerSocket(0, 1, InetAddress.getByName("127.0.0.1"),', []], - ['new ServerSocket(0, 1,', ['java-server-socket']], - ['new InetSocketAddress(port)', ['java-inet-socket-address']], - ['new java.net.InetSocketAddress(port)', ['java-inet-socket-address']], - ['new InetSocketAddress(port); log("127.0.0.1");', ['java-inet-socket-address']], - ['new InetSocketAddress(InetAddress.getLoopbackAddress(), port)', []], - ['new InetSocketAddress("127.0.0.1", port)', []], - ['new InetSocketAddress("localhost", port)', []], - ['new InetSocketAddress("::1", port)', []], - ['new java.net.InetSocketAddress("127.0.0.1", port)', []], - ['new InetSocketAddress("127.0.0.1",', []], - ['new InetSocketAddress(', ['java-inet-socket-address']] + ['ServerSocket serverSocket;', []], + ['new InetSocketAddress(port)', ['java-socket']], + ['new java.net.InetSocketAddress("127.0.0.1", port)', ['java-socket']], + ['InetSocketAddress remote;', []] ] satisfies Array<[string, string[]]>)('classifies %s', (line, expected) => { expect(rulesFor(line)).toEqual(expected); }); diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json index 636e98e9e..b5f3131b0 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json index 50aca8adf..18bfdd55d 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-explicit.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json index 441fdba48..9ccab4223 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json index f3a40b1cd..103be0e45 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-open.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json index 441fdba48..9ccab4223 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-true.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json index f3a40b1cd..103be0e45 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-assert.va-unset.container-unset.json @@ -299,7 +299,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json index 649363036..d71bb0718 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json index 87d29cc74..5a6e88fc3 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-explicit.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json index 2bb37d18e..68b321205 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json index 0f342c2fc..8a0653aea 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-open.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json index 2bb37d18e..68b321205 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json index 0f342c2fc..8a0653aea 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-content.va-unset.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json index 9b10dd0b7..1c43d9d74 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json index 24a36b45a..8ec3aa133 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-explicit.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json index b6bf45b1d..0a62fc9d5 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json index 544151527..21746ff9e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-open.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json index b6bf45b1d..0a62fc9d5 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-true.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json index 544151527..21746ff9e 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-line.va-unset.container-unset.json @@ -295,7 +295,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them) or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json index 649363036..d71bb0718 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json index 87d29cc74..5a6e88fc3 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-explicit.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json index 2bb37d18e..68b321205 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json index 0f342c2fc..8a0653aea 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-open.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json index 2bb37d18e..68b321205 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-true.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json index 0f342c2fc..8a0653aea 100644 --- a/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json +++ b/tests/core/unit/server/__snapshots__/tool-list/bp-unset.va-unset.container-unset.json @@ -309,7 +309,7 @@ }, { "name": "attach_to_process", - "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (replace 127.0.0.1 with * only for attach from another machine or container; for a container publish -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", + "description": "Attach to a running process for debugging. After the handshake the target is verified by polling for threads; if none are reported within verifyTimeout (~20s default) the attach fails and the proxy is torn down. When a requested post-attach pause is accepted but no stopped event arrives within its bounded wait, returns state \"running\" with pending:true; the late event alone changes the session to \"paused\" — call wait_for_stop to block until it does. The target is started under its debugger or named by processId: Python python -m debugpy --listen ; Ruby rdbg --open --port ; Node.js node --inspect (host, port), or a local node process by processId; Java -agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1: (a JVM in a Docker container reached through a published port needs * in place of 127.0.0.1, with -p 127.0.0.1::); C/C++, COBOL and .NET by processId; Dart and Flutter a VM service (adapterConfig.vmServiceUri or vmServiceInfoFile; a Flutter app on an Android device: adapterConfig.deviceId). list_supported_languages shows each language's forms (attachBy). Breakpoint paths are resolved on the target's filesystem: use the paths the target sees (get_stack_trace shows them), function breakpoints, or a mapping (Python: adapterConfig.pathMappings [{localRoot, remoteRoot}]; Ruby: adapterConfig.localfsMap \":\"). Kubernetes pods (port-forward or an ephemeral sidecar, per-language presets): docs/kubernetes.md in the mcp-debugger repo", "inputSchema": { "type": "object", "properties": { diff --git a/tests/core/unit/server/server-instructions.test.ts b/tests/core/unit/server/server-instructions.test.ts index 07aeb7dc4..4959f8c14 100644 --- a/tests/core/unit/server/server-instructions.test.ts +++ b/tests/core/unit/server/server-instructions.test.ts @@ -336,7 +336,7 @@ describe('Java attach guidance (#1389)', () => { const attach = tools.find(tool => tool.name === 'attach_to_process')?.description ?? ''; for (const text of [DEBUGGING_WORKFLOW_PROMPT, skill, attach]) { expect(text).toContain('-agentlib:jdwp=transport=dt_socket,server=y,address=127.0.0.1:'); - expect(text).toContain('only for attach from another machine or container'); + expect(text).toContain('in a Docker container reached through a published port'); expect(text).toMatch(/-p 127\.0\.0\.1:(?:|PORT):(?:|PORT)/); } expect(skill).toContain('JDWP has no authentication'); From 6efa94e12f84795e4a4ce81d04a664cde979aaa4 Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 29 Nov 2026 18:24:44 -0500 Subject: [PATCH 5/5] test: confirmation-pass corrections to the loopback guard (#1389) Both reviewers confirmed the previous commit with nothing above minor. Their remaining points, all recognition or wording: - The guard also recognises inspector.open( and dgram.createSocket(, and in Java ServerSocketChannel.open(, createServerSocket( and startListening(. None exists in the tree today. A quoted '::' was tried as a wildcard spelling and dropped: pytest node ids are written with it. - The header and the failure text no longer call every match a listening socket (DeadlineTree.listen and the MCP client's listen are on the list too), and the header names what the scan does not see: the line elsewhere that sets a recorded listener's host, and a host handed to a spawned debug adapter on its command line. - The changelog entry says what the list holds by its spelling. - One stale rule name in the exact-text test. 55 recognition rows; 22 text-only mutants all fail the guard. Written by the manager session. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_015BDrn82vMcRzWFDD9aUbZs --- changelog.d/1389.fixed.md | 2 +- tests/core/unit/loopback-bindings.test.ts | 40 ++++++++++++++++------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/changelog.d/1389.fixed.md b/changelog.d/1389.fixed.md index b050d2646..c01f3defd 100644 --- a/changelog.d/1389.fixed.md +++ b/changelog.d/1389.fixed.md @@ -1 +1 @@ -**The Java attach guidance and the server's free-port probe keep to loopback** — the text an agent reads before attaching to a JVM (the `attach_to_process` description, the Java adapter's attach hint, the workflow prompt and the debugging skill) told it to start the JVM with `address=*:`, which opens the unauthenticated JDWP port on every network interface. All four now give `address=127.0.0.1:`, and the three general ones name the case that needs more: a JVM in a Docker container reached through a published port, which is then published on the host's loopback. The Java docs and skill reference name `127.0.0.1` where they gave a bare port, which is every interface on a JDK 8 target. The server's own free-port probe, each time a launch or an attach is prepared (a dry run included), listened with no host and so on every interface for an instant; it binds `127.0.0.1`. A check in the unit suite now holds a recorded list of every listening socket in the server's and adapters' sources and the Java bridge, each with what it binds and why, and of every line there or in the skill text that writes a wildcard address (`0.0.0.0`, `[::]`, a `--listen` value that starts with a colon, a wildcard or non-loopback JDWP `address=`): a new listener or a new wildcard fails until someone has looked at it and recorded it, and so does a recorded line that no longer matches (#1389) +**The Java attach guidance and the server's free-port probe keep to loopback** — the text an agent reads before attaching to a JVM (the `attach_to_process` description, the Java adapter's attach hint, the workflow prompt and the debugging skill) told it to start the JVM with `address=*:`, which opens the unauthenticated JDWP port on every network interface. All four now give `address=127.0.0.1:`, and the three general ones name the case that needs more: a JVM in a Docker container reached through a published port, which is then published on the host's loopback. The Java docs and skill reference name `127.0.0.1` where they gave a bare port, which is every interface on a JDK 8 target. The server's own free-port probe, each time a launch or an attach is prepared (a dry run included), listened with no host and so on every interface for an instant; it binds `127.0.0.1`. A check in the unit suite now holds a recorded list of every `.listen(` call and Java socket constructor in the server's and adapters' sources and the Java bridge, each with what it binds and why, and of every line there or in the skill text that writes one of the wildcard shapes it knows (`0.0.0.0`, `[::]`, a `--listen` value that starts with a colon, a wildcard or non-loopback JDWP `address=`): a new one fails until someone has looked at it and recorded it, and so does a recorded line that no longer matches. It does not see a host handed to a spawned debug adapter on its command line (#1389) diff --git a/tests/core/unit/loopback-bindings.test.ts b/tests/core/unit/loopback-bindings.test.ts index 12b40b907..1631ec76a 100644 --- a/tests/core/unit/loopback-bindings.test.ts +++ b/tests/core/unit/loopback-bindings.test.ts @@ -14,11 +14,17 @@ * An address written as text: an IPv4 wildcard address, [::], a --listen value * that starts with a colon, address=* anywhere and, on a line that names JDWP, * address= without a loopback host. - * A listening socket: every `.listen(` call and every Java ServerSocket or - * InetSocketAddress constructor. The check does not judge what such a line - * binds. A line scan cannot do that soundly (a literal may sit in a callback, a - * fallback, a nested call), so every one is recorded with what it binds and why, - * and a new one fails until someone has looked at it and written that down. + * A listener by its spelling: every `.listen(` call, `inspector.open(` and + * `dgram.createSocket(`, and in Java every ServerSocket or InetSocketAddress + * constructor, `ServerSocketChannel.open(`, `createServerSocket(` and + * `startListening(`. Some of these are not sockets, and an + * InetSocketAddress may be for an outgoing connection: the recorded reason says + * so. The check does not judge what such a line binds. A line scan cannot do + * that soundly (a literal may sit in a callback, a fallback, a nested call), so + * every one is recorded with what it binds and why, and a new one fails until + * someone has looked at it and written that down. Two things it does not see: + * the line elsewhere that sets a recorded listener's host, and a host handed to + * a spawned debug adapter on its command line. * Comments and strings count as text. Another listener API or another spelling * of "every interface" needs a new rule: only these shapes are covered, and what * a spawned debug adapter binds by its own default is outside this scan. @@ -195,6 +201,7 @@ const LISTENER_RULES = ['listener', 'java-socket']; function rulesFor(line: string): string[] { const rules: string[] = []; if (/(? LISTENER_RULES.includes(rule)) - ? 'A listening socket. Add this exact line to ALLOWED with what it binds and why; bind 127.0.0.1 unless an operator chooses the address.' + ? 'A .listen( call or a Java socket constructor. Add this exact line to ALLOWED with what it binds and why, or why it opens no socket; bind 127.0.0.1 unless an operator chooses the address.' : 'Write a loopback address, or add this exact line to ALLOWED with a one-line reason.'; } @@ -265,6 +274,7 @@ describe('loopback bindings and guidance', () => { ['// 0.0.0.0.1', []], ['[::]:5005', ['ipv6-wildcard']], ['[::1]:5005', []], + ["nodeId.split('::')", []], ['dlv dap --listen=:port', ['wildcard-listen-option']], ['dlv dap --listen :port', ['wildcard-listen-option']], ['dlv dap --listen=127.0.0.1:5005', []], @@ -296,6 +306,10 @@ describe('loopback bindings and guidance', () => { ['tree.listen(outside);', ['listener']], ['emitter.listening(port);', []], ['const listen = 1;', []], + ['inspector.open(0);', ['listener']], + ["inspector.open(9229, '::');", ['listener']], + ["dgram.createSocket('udp4');", ['listener']], + ['handler.bind(this);', []], ['new ServerSocket(0)', ['java-socket']], ['new ServerSocket(0, 1, InetAddress.getLoopbackAddress())', ['java-socket']], ['new java.net.ServerSocket(port)', ['java-socket']], @@ -303,20 +317,24 @@ describe('loopback bindings and guidance', () => { ['ServerSocket serverSocket;', []], ['new InetSocketAddress(port)', ['java-socket']], ['new java.net.InetSocketAddress("127.0.0.1", port)', ['java-socket']], - ['InetSocketAddress remote;', []] + ['InetSocketAddress remote;', []], + ['ServerSocketChannel.open().bind(null);', ['java-socket']], + ['factory.createServerSocket(port)', ['java-socket']], + ['connector.startListening(args)', ['java-socket']] ] satisfies Array<[string, string[]]>)('classifies %s', (line, expected) => { expect(rulesFor(line)).toEqual(expected); }); it('requires exact text and counts repeated occurrences separately', () => { const allowed = { file: 'src/example.ts', line: 'server.listen(port);', reason: 'Example reviewed for this test.' }; - const occurrence = { ...allowed, number: 3, rules: ['listen-host'] }; + const occurrence = { ...allowed, number: 3, rules: ['listener'] }; expect(differences([occurrence], [allowed])).toEqual([]); expect(differences([], [allowed]).join()).toContain('Stale allowance'); expect(differences([occurrence, occurrence], [allowed]).join()).toContain('New occurrence'); const changed = { ...occurrence, line: ` ${allowed.line}` }; const message = differences([changed], [allowed]).join('\n'); - expect(message).toContain('src/example.ts:3 [listen-host]'); + expect(message).toContain('src/example.ts:3 [listener]'); + expect(message).toContain('A .listen( call or a Java socket constructor.'); expect(message).toMatch(/New occurrence[\s\S]*Stale allowance/); expect(message).toContain('If you edited a recorded line, update its text in ALLOWED.'); expect(differences([occurrence], []).join()).not.toContain('If you edited');