Skip to main content
Glama

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
NameRequiredDescriptionDefault
target_idYesTarget ID from interceptor_chrome_launch
include_targetsNoInclude current CDP tab targets in output (default: false)
timeout_msNoTimeout when fetching optional CDP target list

Implementation Reference

  • 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) }) }] };
        }
      },
    );

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yfe404/proxy-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server