Skip to main content
Glama

PyPI CI Tests Python MCP License: Apache-2.0 Glama MCP Server Benni OS

High-Speed, Zero-Token-Waste Autonomous Browser Engine for AI Agents & MCP.
Eliminates the 1,500-token vision tax. Built-in Tier-0 indirect prompt injection firewall (<0.4ms overhead), semantic multi-attribute element grounding, and native Model Context Protocol (MCP) server.

Quick Start • Architecture • Benchmarks vs Global Competitors • MCP Setup • Ecosystem


⚡ The Problem with Current Browser Agents

Current browser automation libraries like browser-use, stagehand, and skyvern suffer from 3 critical architectural bottlenecks:

  1. Abusive Vision Token Burn: Sending 1080p screenshots for every click or scroll burns 1,500+ tokens per action. A simple 10-step flow costs $0.40–$0.90 and takes 30–50 seconds.

  2. Brittle Numeric/XPath Grounding: Floating numeric bounding boxes or raw XPaths invalidate the moment React or Vue components re-render during hydration, causing hallucinated clicks.

  3. Zero Pre-Execution Guardrails: Ingesting untrusted third-party DOM text directly into LLM context leaves agents completely vulnerable to Indirect Prompt Injection hidden in CSS or comments.


Related MCP server: openmcp

🏗️ The agent-browser-mesh Architecture

  Claude Code / Cursor / Codex / Autonomous Web Agents
         │
         ├──► Python SDK  BrowserMesh.navigate() / snapshot() / click()
         └──► STDIO JSON-RPC 2.0 (agent-browser mcp)
                       │
                       ▼
  ┌─────────────────────────────────────────────────────────────────────┐
  │                     agent-browser-mesh (ABM)                        │
  │                                                                     │
  │  ┌───────────────────┐  ┌───────────────────┐  ┌─────────────────┐  │
  │  │  Tier-0 Guard     │  │  DOM-Delta A11y   │  │  Semantic       │  │
  │  │  (SG-4 & SG-5)    │─►│  Compiler         │─►│  Fingerprinting │  │
  │  │ • SSRF / RFC1918  │  │ • >90% Token Save │  │ • Invariant Hash│  │
  │  │ • Prompt Shield   │  │ • Noise Stripping │  │ • Fuzzy Anchor  │  │
  │  └───────────────────┘  └───────────────────┘  └─────────────────┘  │
  │                                                                     │
  │  ┌───────────────────┐  ┌───────────────────┐  ┌─────────────────┐  │
  │  │  Action Executor  │  │  Live Telemetry   │  │ Browser Doctor  │  │
  │  │  (Click / Type)   │  │  & Health Monitor │  │ & Bench Matrix  │  │
  │  │ • CDP / HTTP Core │  │ • P50/P90/P99 ms  │  │ • Guard Probe   │  │
  │  └───────────────────┘  └───────────────────┘  └─────────────────┘  │
  └─────────────────────────────────────────────────────────────────────┘
         │                                         │
         ▼                                         ▼
   Compact DOMDelta (<150 tokens)           ActionResult & Audit Trail
   (Markdown View + Anchor Registry)        (SSRF & Injection Verdicts)
  • ⚡ 92%+ Token Reduction (DOM-Delta A11y Tree): Compiles the web accessibility tree into a compact semantic markdown view (<120 tokens/action). Vision screenshots are only triggered as an emergency fallback on canvas or visual ambiguity.

  • 🎯 Semantic Fingerprinting: Anchors elements by invariant tuples (role, aria-label, text_hash, quadrant). Immune to Tailwind class scrambles and DOM re-ordering.

  • 🛡️ Tier-0 Guardrails (SG-4 SSRF + SG-5 Injection Firewall): Blocks private RFC1918 subnets and cloud metadata endpoints (169.254.169.254) while sanitizing adversarial prompts in-place.

  • 🔌 Native Model Context Protocol (MCP) Server: Plug-and-play with Claude Desktop, Cursor, and Codex with zero custom adapter code.

  • 🚀 Zero Heavy Infrastructure: Pure Python. No Docker Compose, no Redis, no PostgreSQL required.


🏆 Benchmarks vs Global Competitors

Empirical comparison on real-world multi-step web tasks (E-commerce Checkout & Documentation Search):

Metric

browser-use (118k ⭐)

stagehand (25k ⭐)

skyvern (23k ⭐)

agent-browser-mesh (Ours)

Token Cost per Action

~1,500 tokens (Vision)

~800 tokens

~2,000 tokens

⚡ <120 tokens (92% cheaper)

Action Execution Latency

~4,500 ms

~3,800 ms

~8,200 ms

⚡ <650 ms (CDP Native)

Prompt Injection Defense

❌ None

❌ None

❌ None

🛡️ Built-in SG-5 Real-time Firewall

SSRF / Intranet Blocking

❌ None

⚠️ Partial

❌ None

🔒 SG-4 Cloud Metadata & RFC1918 Gate

Element Stability on Re-render

❌ Fragile indices

⚠️ XPath fallback

⚠️ OCR fallback

🎯 Multi-Attribute Invariant Hash

Setup Complexity

Playwright + Chromium

Browserbase API Key

Docker + Redis + Postgres

⚡ 1-Line pip install

Native MCP Server

⚠️ Community wrapper

⚠️ Cloud-only

❌ No

💎 Built-in First-Class MCP


🚀 Quick Start

1. Installation

pip install agent-browser-mesh

2. Python SDK

from agent_browser_mesh import BrowserMesh

# Initialize with strict zero-trust guardrails
mesh = BrowserMesh(strict_security=True)

# 1. Navigate (with automatic SSRF & prompt-injection sanitization)
result = mesh.navigate("https://news.ycombinator.com")
print(result.message)

# 2. Get ultra-compact DOM-Delta (<150 tokens)
delta = mesh.snapshot()
print(f"Token savings: {delta.token_savings_pct}% (~{delta.estimated_tokens} tokens)")
print(delta.markdown_view[:500])

# 3. Click actionable semantic anchor
click_res = mesh.click("@link-comments-4a12")
print(click_res.message)

# 4. Extract structured data with zero visual overhead
data = mesh.extract()

3. Command-Line Interface (CLI)

# Inspect any URL and view token compression analysis
agent-browser inspect https://github.com/trending

# Run token savings benchmark
agent-browser benchmark

# Start native MCP stdio server
agent-browser mcp

🏗️ Claude Desktop & Cursor MCP Integration

Add agent-browser-mesh directly to your claude_desktop_config.json:

{
  "mcpServers": {
    "browser-mesh": {
      "command": "agent-browser",
      "args": ["mcp"]
    }
  }
}

Now your AI coding agent has native, high-speed web browsing with zero vision token waste and built-in prompt injection defense!


📁 Project Structure

agent-browser-mesh/
├── src/agent_browser_mesh/
│   ├── __init__.py                   # Backwards-compatible public API exports
│   ├── cli.py                        # CLI entrypoint bridge
│   ├── core/
│   │   ├── __init__.py               # Core browser mesh primitives package
│   │   ├── actions.py                # Deterministic ActionExecutor (click, type, extract)
│   │   ├── dom_compiler.py           # Semantic DOM-Delta compiler (>90% token savings)
│   │   ├── engine.py                 # BrowserMesh session & navigation orchestrator
│   │   ├── fingerprint.py            # Multi-attribute invariant SemanticAnchor & registry
│   │   └── guardrails.py             # SG-4 SSRF gate & SG-5 prompt-injection sanitizer
│   ├── serve/
│   │   ├── __init__.py               # Serving & observability exports
│   │   ├── __main__.py               # Unified Click CLI (inspect, mcp, doctor, matrix, health)
│   │   ├── health_monitor.py         # DOMCompiler & BrowserGuardrails health probe
│   │   ├── mcp_bridge.py             # Native MCP JSON-RPC 2.0 stdio server
│   │   └── telemetry.py              # Thread-safe P50/P90/P99 latency & savings telemetry
│   └── tools/
│       ├── __init__.py               # Diagnostics & benchmarking exports
│       ├── bench_matrix.py           # Multi-page DOM-Delta compaction matrix
│       └── doctor.py                 # End-to-end browser mesh diagnostic probe
├── examples/
│   ├── quickstart_browser_mesh.py    # Minimal offline DOM-Delta & anchor click example
│   └── guardrails_and_telemetry.py   # SSRF blocking, prompt sanitization & telemetry
├── scripts/
│   ├── benchmark_dom_delta.py        # Multi-page DOM-Delta compaction benchmark
│   └── gate_ssrf_guardrails.py       # SSRF, injection & runtime health gate runner
├── docs/
│   └── ARCHITECTURE.md               # Three-tier package architecture reference
└── tests/                            # Full pytest suite (18 tests)

🌐 The Benni OS Open-Source Ecosystem

agent-browser-mesh is part of the coordinated Benni Master OS v9.4 open-source infrastructure suite:

Repository

Focus & Architecture

Stars

conductor-sdd

Zero-Dependency Spec-Driven Development, Static AST Drift Detector & MCP Guardrail

GitHub Stars

benni-inference-engine

High-Throughput Sovereign Local Inference for 8GB–16GB Consumer GPUs

GitHub Stars

agent-eval-harness

Deterministic Zero-Cloud Agent Evaluation, Red-Teaming & Benchmark Harness

GitHub Stars

agent-code-sandbox

Micro-Second Zero-Dependency Code Sandbox & Execution Shield for AI Agents

GitHub Stars

agent-deep-research

Autonomous Multi-Source Deep Research & Evidence Synthesis Engine

GitHub Stars

agent-browser-mesh

Token-Saving Resilient Headless Browser Automation & A11y DOM Compiler

GitHub Stars

agent-intent-compiler

Deterministic Intent Compiler & Typed DAG Execution Planner for AI Agents

GitHub Stars

agent-token-optimizer

Sub-Millisecond Context Compression & Semantic Deduplication Engine

GitHub Stars

bio-sync-operator-os

Real-Time Biometric Swarm Governance & 120 FPS Resonant Kinetic Interface

GitHub Stars

agent-cyber-sentinel

Zero-Trust Runtime Security, Prompt Injection Firewall & Secrets Redaction

GitHub Stars

agent-run-ledger

Deterministic Multi-Step Task Execution Ledger & Anti-Looping Engine

GitHub Stars

reality-lock

Cryptographic State Verification & Invariant Proof Engine for Agents

GitHub Stars

agent-memory-mesh

Hybrid Vector + BM25 Hierarchical Session Memory & Continuity Engine

GitHub Stars

benni-operator-gateway

Human-in-the-Loop Approval & Policy Enforcement Gateway

GitHub Stars

mcp-forge

Rapid Model Context Protocol (MCP) Server Scaffolding & Dynamic Tooling

GitHub Stars

benni-nexus

Autonomous Multi-Agent Intent Routing & Swarm Coordination Hub

GitHub Stars

community-autopilot

Autonomous GitHub Community Triaging & PR Feedback Agent

GitHub Stars


🏛️ Commercial & Sovereign Architecture

Need autonomous multi-agent swarm orchestration, private datacenter infrastructure, or enterprise governance?


📄 License & Provenance

  • License: Distributed under the Apache License, Version 2.0 (Apache-2.0).

  • Author: Benni Alencar (benni@benni.ai)

  • Architecture: Benni Master OS v9.4 Tier-0 Governance Standard

agent-browser-mesh — Token-Saving Resilient Headless Browser Automation & A11y DOM Compiler • benni-os.net • Apache-2.0 License

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Browser automation for AI agents via the Model Context Protocol, enabling web navigation, form filling, screenshots, and more using Chromium.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to automate web tasks such as browsing, clicking, typing, and taking screenshots via the Model Context Protocol.
      1
      MIT