Skip to main content
Glama
browser-stream

browser-stream

by sgreen7979

browser-stream

MCP server that collapses browser act-then-observe into single tool calls. Every action returns its consequences — what appeared, disappeared, changed, or shifted — so agents see the effect of each action without a separate observation step.

~50% fewer tool calls. ~90% fewer tokens.

Tools

Tool

Description

browser_navigate

Navigate to a URL. Returns a snapshot of interactive elements.

browser_snapshot

Take a snapshot of the current page. Returns interactive elements with @e refs.

browser_click

Click an element by ref. Returns consequences.

browser_fill

Fill a text input by ref. Returns consequences.

browser_press_key

Press a key or key combination (e.g. Enter, Control+a). Returns consequences.

browser_scroll

Scroll the viewport or a container. Detects DOM churn and layout shifts.

browser_wait_for

Wait for text to appear or a ref to become visible. Polls every 500ms.

Related MCP server: Charlotte

Refs

Every interactive element gets a globally unique ref like @e1, @e5, @e23. Refs are stable across actions — use them to target clicks, fills, and scrolls. When an element leaves the DOM, its ref is never reused.

Refs resolve through a 3-tier system: backendNodeId (fast) → CSS domPath (fallback) → REF_STALE error.

Consequences

Every action returns what changed:

  • appeared — new interactive elements in the DOM

  • disappeared — elements that left the DOM

  • changed — elements with modified properties (name, value, checked, etc.)

  • network — Fetch/XHR requests triggered by the action

  • dom-churn — remove-then-re-add pairs (e.g. React re-rendering an entire list on scroll)

  • layout-shift — CLS events without recent user input

Scroll detection

browser_scroll detects rendering pathologies that are invisible to before/after snapshot diffing:

→ browser_scroll({ ref: "@e12", direction: "down", amount: "page" })

consequences: [
  { type: "dom-churn", churnCount: 36, desc: "DOM churn detected: 36 remove/re-add pairs" },
  { type: "layout-shift", cls: 0.042, shiftCount: 2, desc: "Layout shift: cls=0.042 (2 shifts)" }
]

Setup

npm install
npm run build

Usage

Launch Chrome automatically:

node dist/index.js

Connect to an existing Chrome instance:

node dist/index.js --cdp-url ws://127.0.0.1:9222/devtools/browser/...

With Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "browser-stream": {
      "command": "node",
      "args": ["/path/to/browser-stream/dist/index.js"]
    }
  }
}

Development

npm run dev          # watch mode build
npm test             # run tests
npm run test:watch   # watch mode tests

Architecture

src/
├── index.ts              # CLI entrypoint, MCP server setup
├── types.ts              # All shared types and response schemas
├── cdp/
│   └── client.ts         # CDP connection (chrome-launcher + chrome-remote-interface)
├── state/
│   ├── ref-map.ts        # @e ref registry with 3-tier resolution
│   ├── snapshot.ts       # AX tree → ref assignment → compact line format
│   └── differ.ts         # Pre/post snapshot diffing → consequences
├── actions/
│   ├── interactable.ts   # Scroll-into-view + box model + center point
│   ├── stability.ts      # DOM mutation debounce + network tracking + churn detection
│   └── engine.ts         # Action orchestration (click, fill, scroll, etc.)
└── tools/
    ├── actions.ts        # MCP tool registrations for actions
    └── observation.ts    # MCP tool registrations for snapshot/wait_for

License

MIT

Available Tools

8 tools
browser_clickC

Click an element by ref. Returns action consequences.

Inputs: ref (required).

browser_execute_scriptC

Execute JavaScript in the browser page context. Returns the script result and action consequences.

Inputs: script (required).

browser_fillC

Fill a text input by ref. Returns action consequences.

Inputs: ref (required), value (required).

browser_navigateA

Navigate to a URL. Returns snapshot of the new page.

Inputs: url (required).

browser_press_keyC

Press a key or key combination. Returns action consequences.

Inputs: key (required).

browser_scrollA

Scroll the viewport or the nearest scrollable ancestor of a ref.

Inputs: direction (required), ref, amount.

browser_snapshotA

Take a snapshot of the current page. Returns interactive elements with @e refs.

Inputs: no named parameters.

browser_wait_forA

Wait for text to appear or a ref to become visible. Polls every 500ms.

Inputs: ref, text, timeout.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool maps to a clearly distinct browser action: click, fill, navigate, press_key, execute_script, scroll, snapshot, and wait_for. The boundary between snapshot (read page state) and the mutation tools (click/fill/scroll) is explicit, and descriptions reinforce the distinction rather than blur it.

    Naming Consistency5/5

    All eight tools share a uniform `browser_` prefix followed by a snake_case verb or verb_noun form (browser_navigate, browser_press_key, browser_wait_for). No mixed casing or inconsistent verb styles.

    Tool Count5/5

    Eight tools is well within the sweet spot for a browser automation server. Each operation (act, read, wait, escape hatch) earns its place with no redundant entries.

    Completeness4/5

    Core interaction loop is covered (navigate, snapshot, click/fill/press/scroll, wait, script escape hatch). Minor gaps remain: no select_option for native dropdowns, no hover for menus that only appear on pointer-over, and no back/forward/reload history control — though most are workaroundable via click or execute_script.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI agents to browse and interact with web pages through a persistent headless Chromium session, serving compact structured orientations, targeted element queries, and full detail only when explicitly requested. It supports navigation, observation, form filling, monitoring, and session management while cutting token overhead by up to ~140x versus raw accessibility-tree dumps.
      4 npm
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to browse and interact with websites through a persistent headless Chromium session, returning compact structured page representations instead of full accessibility-tree dumps. Agents can navigate, query specific elements and forms, click, type, manage tabs and cookies, and monitor console or network activity while paying a fraction of the tokens.
      4 npm
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to browse and interact with web pages through a token-efficient, structured page representation — orientation summaries, targeted element queries, and full detail only on request — instead of raw accessibility-tree dumps. Supports navigation, interaction, forms, screenshots, console and network monitoring, session/tab management, and browser-based development auditing.
      4 npm
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to browse the web through a persistent headless Chromium session that returns compact, structured page summaries and targeted queries instead of full accessibility-tree dumps. Agents can navigate, observe, search, and interact with pages using configurable detail levels and tool profiles, cutting token costs by up to ~140x on content-heavy sites.
      4 npm
      MIT