Chrome Agent is a command-line tool that lets AI coding agents observe and drive Chrome or Chromium through the Chrome DevTools Protocol (CDP). Instead of a browser MCP server with a curated set of tools, it passes any CDP method name and parameters straight to the running browser and streams back the events an agent subscribes to. Because nothing is validated against a bundled schema, it reaches every domain the installed Chrome exposes, including ones added after a given Chrome Agent release.
It works over two channels. One-shot mode connects, sends a single CDP command, prints the JSON response, and disconnects, which suits screenshots, navigation, and quick queries. Attach mode keeps a persistent connection and streams subscribed events as JSON lines, so an agent can observe network traffic or page loads in the background while sending commands in the foreground. Agents interact with pages through a locate, act, verify loop: find an element's coordinates with JavaScript, dispatch real mouse and keyboard input events, then confirm the result. Chrome processes those events the same way as physical input.
Several humans and agents can share one browser at once, each with an isolated CDP session and event subscriptions, so one agent drives while another watches for errors. Instances are named, tracked in a registry, and addressable by glob, and sessions (profile, cookies including in-memory session cookies, tabs, window layout, and observers) can be saved as encrypted snapshots and restored after a reboot. A typed Python API with 54 domain classes is available as an optional layer, and an agent guide ships with the package.
Features
- Full CDP access: sends any DevTools Protocol command to the running browser, with no curated subset or version gate
- One-shot commands: connect, send one command, print JSON, and disconnect for spot checks and screenshots
- Attach mode: persistent, isolated event subscriptions streamed as JSON lines
- Real input: dispatches mouse and keyboard events that Chrome treats as physical input
- Shared browsers: multiple humans and agents work in one browser with independent sessions
- Named instances: auto-named, registry-tracked browsers addressable by name or glob pattern
- Session snapshots: saves and restores profiles, cookies, tabs, windows, and observers, encrypted with AES-256-GCM under an OS keyring key
- Fingerprint profiles: spoofs user agent, viewport, language, and timezone through launch flags, without JavaScript injection
- Window marking: a per-instance colored border and title prefix distinguish agent-driven windows
- Protocol discovery: a help command and zsh completion read methods and events from the running browser's own protocol
- Python API: 54 typed domain classes generated from Chrome's protocol schema
- Claude Code Monitor: event-driven observation through Claude Code's Monitor tool, with a wait script for other harnesses
