Skip to content

[feature] CDP attach mode — connect to existing Chrome session without extension #2

@FelixIsaac

Description

@FelixIsaac

Summary

Add an alternative server.js mode that connects to a running Chrome via Chrome DevTools Protocol (CDP) instead of requiring the native messaging extension.

Motivation

  • Users are already logged into Chrome — no re-auth needed
  • Lower friction: no extension install, just launch Chrome with a flag
  • Useful on managed devices where extensions can't be installed

How it works

Launch Chrome with:

chrome.exe --remote-debugging-port=9222 --user-data-dir="%USERPROFILE%\ChromeProfile"

Then server.js connects via CDP (raw chrome-remote-interface or Playwright's connectOverCDP).

Implementation

  • Add --mode cdp flag to server.js
  • Auto-discover endpoint via http://localhost:9222/json/version
  • Implement same tool surface (navigate, snapshot, click, etc.) via CDP calls
  • Keep extension mode as default; CDP is opt-in

Notes

  • Chrome M144+: must use --remote-debugging-port startup flag (not chrome://inspect)
  • Same accessibility tree snapshot approach — no token cost regression

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions