engine

v0.1.1
@whittlebrowser/engine Checked 4 days ago Published 1 month ago

Token-lean, ref-stable, privacy-first browser protocol for AI agents (core + Playwright/CDP driver + MCP server).

A token-lean, ref-stable, privacy-first browser protocol for AI agents: an in-page agent (runs in a CDP isolated world), a serializer and differ that send models compact text and only what changed, a privacy filter that keeps secrets and hidden prompt injections away from the model, a Playwright/CDP driver, and an MCP server (whittlebrowser). Needs Node 22 or newer, and either Google Chrome or a downloaded Chromium (npx playwright-core install chromium, once). Server flags go after the package name (--headless, --ephemeral, --budget 4000; the full list is in the docs).

Summary extracted from the README.

@whittlebrowser/engine

A token-lean, ref-stable, privacy-first browser protocol for AI agents: an in-page agent (runs in a CDP isolated world), a serializer and differ that send models compact text and only what changed, a privacy filter that keeps secrets and hidden prompt injections away from the model, a Playwright/CDP driver, and an MCP server (whittlebrowser).

Install

Needs Node 22 or newer, and either Google Chrome or a downloaded Chromium (npx playwright-core install chromium, once).

claude mcp add whittlebrowser -- npx -y @whittlebrowser/engine     # Claude Code
codex mcp add whittlebrowser -- npx -y @whittlebrowser/engine      # Codex

Server flags go after the package name (--headless, --ephemeral, --budget 4000; the full list is in the docs). For Cursor, VS Code, Gemini CLI and other clients, use "command": "npx", "args": ["-y", "@whittlebrowser/engine"]. Claude Desktop needs full paths; see the docs below. Source code, issues and docs: https://github.com/vasanth7781/whittlebrowser-engine

Work on it from source

git clone https://github.com/vasanth7781/whittlebrowser-engine.git && cd whittlebrowser-engine
npx playwright-core install chromium     # once
pnpm install && pnpm --filter @whittlebrowser/engine build
node packages/engine/dist/mcp/cli.js              # launch Chromium with a persistent profile
node packages/engine/dist/mcp/cli.js --headless   # headless

From a source checkout, pnpm connect adds your build to Claude Code and prints the config JSON for other clients. Or by hand, with the absolute path to that file:

claude mcp add whittlebrowser -- node /absolute/path/to/packages/engine/dist/mcp/cli.js

Setup for Claude, Cursor, Codex, VS Code and others: docs/use-with-ai-tools.md.

Tools

Nine MCP tools with short schemas (the whole list is about 1,000 tokens):

Tool What it does
observe Compact view of the page (or one subtree) within a token budget
act One or more steps (click, type, select, check, hover, press, scroll, upload); returns outcome + diff
navigate URL, search words, back, forward, reload
find Search the whole page, including off-screen, ranked. role:button pay filters by role; css:SELECTOR counts visible matches and lists their class and attributes
extract table, list (repeated cards as rows), text (main content as markdown), paged
research Open several pages in parallel and return a compact digest of each
tabs list, open, switch, close
screenshot JPEG with sensitive fields blurred (last resort)
wait For text, for a delay, or hand control to you (CAPTCHA, 2FA)

Full argument reference: docs/PROTOCOL.md in the repository.

Use it as a library:

import { Session, launch, StaticPolicy } from '@whittlebrowser/engine';
import { render, Privacy } from '@whittlebrowser/engine/core';

Exports: . (session, driver, policy), ./core (serializer, differ, privacy, detectors), ./page (the in-page agent source) and ./humanpath.

Docs, benchmark and protocol: see the repository root. Security reports: see SECURITY.md.

MIT licensed.