interceptor_chrome_devtools_attach
Attach Chrome DevTools to a running browser instance for debugging network traffic, inspecting web pages, and modifying HTTP/HTTPS requests through the proxy-mcp server.
Instructions
Start a chrome-devtools-mcp sidecar session bound to a specific interceptor_chrome_launch target_id.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_id | Yes | Target ID from interceptor_chrome_launch | |
| include_targets | No | Include current CDP tab targets in output (default: false) | |
| timeout_ms | No | Timeout when fetching optional CDP target list |
Implementation Reference
- src/tools/devtools.ts:459-510 (handler)Handler implementation for interceptor_chrome_devtools_attach tool.
server.tool( "interceptor_chrome_devtools_attach", "Start a chrome-devtools-mcp sidecar session bound to a specific interceptor_chrome_launch target_id.", { target_id: z.string().describe("Target ID from interceptor_chrome_launch"), include_targets: z.boolean().optional().default(false).describe("Include current CDP tab targets in output (default: false)"), timeout_ms: z.number().optional().default(1500).describe("Timeout when fetching optional CDP target list"), }, async ({ target_id, include_targets, timeout_ms }) => { try { const port = await getChromeTargetPort(target_id); const browserUrl = getCdpBaseUrl(port); const session = await devToolsBridge.createSession(target_id, browserUrl); let cdpTargets: Array<Record<string, unknown>> | null = null; let targetsError: string | null = null; if (include_targets) { try { cdpTargets = await getCdpTargets(port, { timeoutMs: timeout_ms }); } catch (e) { targetsError = errorToString(e); } } return { content: [{ type: "text", text: truncateResult({ status: "success", session, ...(session.mode === "native-fallback" ? { warning: "chrome-devtools-mcp binary was not found. Session is running in native-fallback mode: " + "navigation works; cookie/storage list/get tools still work via direct CDP; " + "snapshot/network/console/screenshot require installing chrome-devtools-mcp.", } : {}), cdp: { httpUrl: browserUrl, }, cdpTargets, ...(targetsError ? { targetsError } : {}), }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", error: errorToString(e) }) }] }; } }, );