v1.0.0 · Zero-middleware CDP browser automation

Browser automation,
zero middleware.

browsy-bot talks directly to the Chrome DevTools Protocol — no Puppeteer, no Playwright, no ChromeDriver. One CDP core, three adapters: an OpenCode plugin, a universal MCP server, and a CLI. It even remembers selectors and flows across sessions.

$ npm i -g browsy-bot
Zero middleware Direct CDP WebSocket MIT · Node ≥ 18
Why browsy-bot

The raw protocol, with nothing in the way.

Every call gets an explicit browserUrl and optional targetId — no hidden driver state, no extra binaries. These are the pillars.

Zero middleware

No ChromeDriver, Puppeteer, or Playwright. A direct CDP WebSocket — minimal latency, full protocol fidelity, deterministic lifecycle.

Zero hidden state

Addressed explicitly per call. Sessions cache when you want them, tear down when you don't — you always know what's connected.

Granular targeting

Operate on specific tabs and windows via targetId, or auto-discover the first page target. Full multi-tab control.

Protocol-complete

Domain wrappers for Page, Runtime, Performance, Accessibility, Target, Network, Emulation — the CDP surface you actually need, typed.

Multi-tool

One core, three adapters: OpenCode plugin, universal MCP server, CLI — 25+ `browsy_*` tools spanning dialogs, uploads, downloads, a11y, visual regression, stealth, record/replay, cross-tab, performance, mobile emulation, DOM diff, cookies, storage.

Learns across sessions

Optional memorius integration stores selectors, quirks, and navigation flows — and surfaces them before the next task.

One core, three ways in

Meet it through the tool you already use.

The same CDP client powers an OpenCode plugin, a universal MCP server, and a CLI. Pick your surface — the core is identical.

8 tools

OpenCode plugin

Drop it into your OpenCode config and agents get a first-class browsy_* toolset, plus an optional bundled agent skill.

  • navigate · screenshot · evaluate
  • recall · wait · console
  • network_log · list_tabs
25+ tools

Universal MCP server

Speak MCP over stdio. Works with Claude Code, Cursor, Gemini CLI, Cline, Continue, Zed, Hermes — and OpenCode's own MCP support.

  • Dialogs · uploads · downloads · network idle
  • Accessibility · visual regression · stealth · record/replay
  • Cross-tab · retry · iframe · mobile emulation
  • DOM diff · cookies · storage · performance
  • One config line in any MCP client
  • Node or Bun, out of the box
full set

CLI

Any agent with a terminal can shell out. Stable exit codes and a --json machine-readable contract for scripted use.

  • navigate · screenshot · eval
  • extract · doctor · ensure-browser
  • tabs · console · network
  • dialog · upload · download
  • a11y · visual-baseline · visual-compare
  • intercept · stealth · record · replay
  • track-tabs · switch-tab · retry
  • enter-frame · exit-frame · performance
  • emulate-device · set-geolocation · set-device-orientation
  • capture-dom · diff-dom · get-cookies
  • set-cookies · delete-cookies · get-storage
v1.0.0 toolkit

Primitives that remove the tedious parts.

Beyond raw CDP, browsy-bot ships a small toolkit covering the jobs people actually automate. Follow the steps — each one is a real command.

  • 01 Diagnose with doctor
  • 02 Pull data with extract
  • 03 Own the browser lifecycle
  • 04 Send real input events
  • 05 Capture screenshots
  • 06 Handle dialogs & uploads
  • 07 Compare DOM baselines
  • 08 Manage cookies & storage
doctorRead-only diagnostics

Probes the CDP endpoint, target count, browser-binary discovery, and memorius availability, then returns an actionable report. The first thing to run when nothing works.

browsy doctor --json
# not ready: CDP endpoint unreachable. Launch Chrome with:
#   chrom… --headless --no-sandbox, or run "browsy ensure-browser".
extractStructured data pull

Pulls typed records from matching elements in a single in-page script — no bespoke evaluate boilerplate. Field specs: text, html, value, or attr:<name>.

browsy extract "article.card" text "attr:src" value
# → [ { "text": "...", "src": "..." }, ... ]
ensure-browser · stop-browserSelf-service lifecycle

ensure-browser probes the endpoint and, if it's down, spawns a Chrome/Chromium on a dedicated profile dir (never your logged-in one), writes a pidfile, and waits for CDP to answer. stop-browser SIGTERMs the recorded pid.

browsy ensure-browser --port 9222 --no-headless
browsy stop-browser
--trusted inputRenderer-trusted events

click and fill gain an opt-in --trusted flag that dispatches renderer-trusted CDP input events (Input.dispatchMouseEvent / Input.insertText) instead of JS-dispatched ones — so the page sees a real user event.

browsy click ".save" --trusted
browsy fill "#email" "a@b.c" --trusted
capture-dom · diff-domStructural visual diff

Capture the page DOM as a snapshot, save it as a baseline, then diff later captures against it — catching added, removed, or changed elements without pixel-level noise.

browsy capture-dom "homepage"
browsy diff-dom "homepage"
get/set-cookiesAuthenticated sessions

Get, set, and delete cookies over CDP — so you can log in once and carry auth state across captures for dashboard and checkout flows.

browsy get-cookies
browsy set-cookies '[{"name":"session","value":"abc123","domain":"example.com"}]'
browsy delete-cookies "session" "example.com"
get-storagelocalStorage / sessionStorage

Read localStorage and sessionStorage for the page's current origin — inspect persisted state without JS evaluation hacks.

browsy get-storage --origin https://example.com
browsy-bot v1.0.0176 tests, fully typed

Screenshots auto-save to dev-notes/browsy-captures/, preflight health-checks catch issues before capture, and every feature is typed and unit-tested.

browsy ensure-browser
browsy screenshot --full
browsy doctor --json
Get started

From zero to a driven tab in three lines.

As a standalone library there is no build step on the consumer side — import, connect, act.

import { getSession, navigatePage, click, extract } from "browsy-bot";

const s = await getSession("ws://localhost:9222");
await navigatePage(s, "https://example.com");
await click(s, ".save", { trusted: true });
const rows = await extract(s, "article.card", ["text", "value"]);
  1. 01Point it at a browser. Start Chrome with remote debugging, or let browsy ensure-browser start a dedicated one for you.
  2. 02Get a session. getSession(browserUrl, { targetId? }) returns a cached CDP socket keyed by endpoint + tab.
  3. 03Act. Navigate, click, fill, extract, capture console and network — all over the same session.
Operating notes

CDP is a powerful channel. Know the blast radius.

A live endpoint is equivalent to a shell on the machine that runs Chrome. Here's the posture.

  • Loopback only. The default is ws://localhost:9222. Don't bind the CDP port to 0.0.0.0 unless it's behind a firewall and you own the blast radius.
  • Profile-scoped launch. ensure-browser only ever starts a browser on a dedicated user-data-dir — never your logged-in profile. If you want a logged-in browser, launch it yourself and point -u at it.
  • --trusted is still JS-gated. The trusted path measures an element's rect in-page then dispatches input events at that coordinate. A page can move the target between measure and dispatch; "trusted" means the listener sees a user-originated event, not a synthetic el.click().
  • Memorius learns persist. Learnings live on disk; if the vault is shared, learned selectors and flows become information to other agents on the host. Use a per-user or per-project vault.

Drive a real browser today.

MIT-licensed, dependency-light, and built so any agent can pick it up. Install it, point it at a browser, start automating.