ai newsMi., 25. Nov.
EilmeldungCan Claude’s storage webhooks miss an hour-long outage?

101 Stars Building a Pure-Rust Browser Engine for LLM Agents

flashbrowse just crossed 101 stars on GitHub and shipped v1.2.1 . It is a single-binary headless browser controller and accessibility-tree compressor written in pure Rust. No Node.js, no Python, no JVM, and no Playwright or Puppeteer shims. It talks raw Chrome DevTools Protocol (CDP JSON-RPC 2.0) o

dev.toDienstag 16:16 · 24.11.5 Min. Lesezeit
Bild: dev.to

flashbrowse just crossed 101 stars on GitHub and shipped v1.2.1.

It is a single-binary headless browser controller and accessibility-tree compressor written in pure Rust. No Node.js, no Python, no JVM, and no Playwright or Puppeteer shims. It talks raw Chrome DevTools Protocol (CDP JSON-RPC 2.0) over WebSocket and exposes both a CLI and a native MCP stdio server for Claude Code, Cursor, and Codex.

If you have wired a browser MCP into an agent, you already know the two bottlenecks: context windows fill up with DOM or AXTree noise, and wrapper runtimes add cold-start and memory overhead. Here is what the token difference looks like on real sites (measured with interestingOnly: false for Puppeteer and Playwright, which is the full accessibility tree an agent actually has to sift through):

(Token estimate: 1 token = 4 characters.)

curl -fsSL https://raw.githubusercontent.com/nhrbuilds/flashbrowse/main/install.sh | sh Enter fullscreen mode Exit fullscreen mode Windows (PowerShell):

irm https: // raw. githubusercontent. com / nhrbuilds / flashbrowse / main / install. ps1 | iex Enter fullscreen mode Exit fullscreen mode Or via Cargo:

cargo install --locked --git https://github.com/nhrbuilds/flashbrowse flashbrowse-cli Enter fullscreen mode Exit fullscreen mode Download managed Chrome-for-Testing once (~120 MB, or skip if Chrome is already on your PATH ), then open a page or start the MCP server:

flashbrowse setup flashbrowse open example.com flashbrowse mcp Enter fullscreen mode Exit fullscreen mode For multi-step workflows from the shell, pass --session-id to keep Chromium alive between calls:

flashbrowse open example.com --session-id s1 flashbrowse act a3 --session-id s1 --action click flashbrowse close --session-id s1 Enter fullscreen mode Exit fullscreen mode If you need pre-flight diagnostics in CI or before debugging an agent failure, run flashbrowse doctor (exits 1 on any blocking check):

flashbrowse doctor (v1.0.2) [PASS] chromium /usr/bin/google-chrome-stable (Google Chrome 147.0.7727.116) [PASS] managed-chrome installed at /home/user/.cache/flashbrowse/chrome [PASS] cache-dir /home/user/.cache/flashbrowse (writable=true) [PASS] temp-space 6327 MB free in /tmp [PASS] memory 15526 MB available [PASS] sessions 0 stored (flashbrowse close --session-id <id> to stop) [PASS] orphan-browsers 0 flashbrowse-managed browser(s) still running Enter fullscreen mode Exit fullscreen mode How It Works Under the Hood The workspace is split into focused crates:

crates/flashbrowse-cdp CDP client, launcher, transport, protocol types crates/flashbrowse-bidi Firefox BiDi groundwork (discovery only) crates/flashbrowse-core session, stealth, interceptor, tree compression, actions crates/flashbrowse-mcp MCP JSON-RPC stdio server crates/flashbrowse-cli CLI binary (`flashbrowse`) Enter fullscreen mode Exit fullscreen mode Three design choices drive most of the behavior:

Playwright and Puppeteer snapshots often fire after domcontentloaded + a short delay. On Hacker News, a domcontentloaded snapshot can yield 65 tokens instead of 1,770.

flashbrowse polls Runtime.evaluate every 100 ms and exits only when:

Repeated opens produce byte-identical trees, which is enforced by a truncation guard test in CI.

Chromium returns the accessibility tree breadth-first. flashbrowse-core rebuilds the hierarchy and walks it depth-first in document order, folding layout wrappers and deduplicating repeated nodes while keeping every piece of visible text and every interactive element mapped to an ephemeral action ID ( ActionMap ).

In agent-default mode, images, fonts, and trackers are blocked at the network layer. When an agent calls browser_screenshot on the same MCP session, flashbrowse temporarily lifts the blocklist and re-requests blocked images (because Chrome never retries a blocked request on its own) until images report img.complete, then captures the screenshot without changing the compressed action tree.

Building a browser controller for agents surfaces bugs that do not show up in happy-path demos. A few real ones we hit:

Blocking images saves 17-42% of page bytes and fonts save 2-12%. Blocking CSS only saves 1-3% (18% on Hacker News), so early on it looked like an easy win.

It was not. Chromium excludes display:none and visibility:hidden elements from the accessibility tree because of CSS. On a local test page with CSS blocked, a display:none element containing SECRET HIDDEN CONTENT appeared directly in the AX tree. An agent could read text no user can see and try to click invisible elements.

So interceptor.rs blocks trackers, fonts, and images (keeping alt text, which Chromium 147 still exposes as the accessible name), and never blocks CSS.

On our 30-row benchmark table, an earlier version of flashbrowse reported 813 tokens. When we built a fidelity oracle comparing raw Accessibility.getFullAXTree JSON against our compressed output, we discovered the compressor was dropping table cells.

Fixing that bug raised the payload to 1,215 tokens. We kept the fix and updated the README numbers. A smaller token count earned by silently dropping visible data is a bug, not an optimization. Across all 8 fidelity fixture pages, the compressor now hits 100% visible text recall (0 missing strings) with 90.6%-98.7% byte reduction vs raw AXTree JSON.

Getting persistent --session-id sessions right across OSes took two targeted fixes:

Every benchmark in the repo runs sequentially (one tool at a time, one page open at a time) against the same Chrome 147 binary on a 30-row table with 60 links (30 iterations, 0 failures, 0 leaked processes):

(The single 1,579 ms max on flashbrowse is the initial session open that spawns Chromium.)

For long-running stability, scripts/soak.mjs drives sequential MCP loops ( open -> act -> scroll -> markdown -> screenshot ) across local and public URLs. In a 90-minute mixed soak ( 5,401 s, 7 URLs):

You can also measure your own workloads locally with flashbrowse bench <url> and inspect historical latency/token stats via flashbrowse stats (backed by ~/.cache/flashbrowse/metrics.jsonl ).

flashbrowse is an agent layer on top of Chrome, not a full replacement for Playwright or Puppeteer:

If you are building coding or web agents and want to cut your browser token bill without maintaining a Node/Python sidecar:

What is the biggest pain point you hit with browser MCPs today: token bloat, stale element IDs, or process cleanup? Drop a comment below.

Quelle: dev.to (dev.to). Original öffnen