SandeepAi369/Agent-first-browse
MCP browser control with compact page snapshots and resilient element targeting
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Agent First Browse separates task decisions from browser control. An external agent can drive a local Playwright Chromium session through stdio MCP or the stateful agent-eval CLI, while agent-first-browse run puts decision-making inside a LangGraph StateGraph. The Python stack includes Pydantic, LangChain, and LangGraph's SQLite checkpoint package. The MCP tool boundary exposes session management, perception, actions, screenshots, and diagnostics without requiring the host to write Playwright code.
Both entry paths use the same perception and execution pipeline. A MutationObserver waits for a DOM quiet window before scanning; if the scan finds fewer than two elements, the engine falls back to a CDP/Playwright accessibility tree. Paint-order hit testing filters occluded controls, and same-URL snapshots can emit changes alongside a compact reference roster. The action layer verifies targets and can semantically rebind stale references before sending CDP input. Shared code under src/core/ provides URL policy, redaction, typed errors, retry handling, and telemetry.
Key Capabilities & Differentiators
Seven MCP tools cover browser lifecycle, compact page perception, actions, screenshots, legacy/V2 comparison, and metrics export. Actions include navigation, clicks, typing, selection, scrolling, and key presses. The server offers V2, legacy, and paired sessions; screenshots can capture the viewport or full page to a local PNG. The autonomous path lists LangChain integrations for OpenAI and Google GenAI, but the dependencies alone do not establish a model-by-model compatibility matrix.
In the reported headed Chromium comparisons, average perception time fell from 1,164.4 ms to 96.8 ms and estimated prompt tokens per step fell from 754.2 to 341.1. In the blocking-modal scenario, hit testing reduced the snapshot from 46 elements to two. The sparse ARIA fixture went from no detected elements to four through accessibility fallback, and a separate SPA fixture exercised stale-reference recovery. These measurements describe perception and selected recovery cases, not end-to-end task latency or success rates.
Trade-offs & Limitations
Direct Playwright is the simpler choice for stable workflows with known selectors and explicit assertions. Agent First Browse is more useful when a model must choose actions across changing pages: compact observations and reference recovery reduce the browser state the caller needs to manage. The added perception layer also means the model sees a filtered view, not the entire page. If a relevant visual state is missing, a screenshot can help diagnose it, but the screenshot tool saves an artifact rather than supplying a visual understanding backend.
The reported comparisons use the project's legacy mode, whose fixed waits contribute to the latency gap. Validate full-task reliability, model-call overhead, and browser resource use on your own flows before adopting it. Local operation gives you control over browser placement, but URL restrictions and sensitive-field masking are not substitutes for process isolation, network policy, or approval of consequential browser actions. Treat page text and screenshot files as potentially sensitive.
Hardware & Deployment Guide
The self-hosted runtime requires Python 3.11+ on Linux, WSL, or macOS. Install with pip install agent-first-browse and provision Chromium with python -m playwright install chromium. MCP hosts can launch the stdio server with uvx --from agent-first-browse agent-browse-mcp, and the stateful CLI uses a Unix socket with 0600 permissions. Headless execution avoids a display; Xvfb is an option for headed execution on Linux or WSL without a physical display.
MCP and direct CLI control need no separate model API key for the browser layer; standalone LangGraph runs require provider configuration through the environment. The local benchmark suite can exercise the browser engine without model credentials. For capacity planning, measure CPU and memory with representative pages and concurrency, especially when running paired sessions. The listed v0.1.1 release highlights PyPI installation and native MCP/CLI control, with older MCP and tool names retained as aliases.
browser_compare compares paired legacy and V2 sessions; browser_metrics exports Markdown or JSON telemetry.agent-browse-mcp and browser_* coexist with the agent-eval-mcp entry point and eval_* tool aliases.Teams giving an MCP-capable agent local Chromium control for authorized, variable-layout workflows, or comparing browser perception strategies with paired telemetry.
Your workflow is fixed enough for a direct Playwright script, you need pixel-first desktop control beyond Chromium, or you require a managed browser fleet instead of operating local sessions.
Quick Start & Installation
pip install agent-first-browse && python -m playwright install chromium
Comparison vs. Top Agents & Frameworks Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| Agent-first-browse ★ | 36 | — | Python | Apache-2.0 | MCP browser control with compact page snapshots and resilient element targeting |
| browser-use | 122.7k | +477 | Python | MIT | Python REPL and CDP for adaptive browser automation |
| obscura | 38.8k | +1k | Rust | Apache-2.0 | Rust/V8 headless browser for agent automation and capture without Chromium |
| WrenAI | 18.5k | +66 | Python | — | An MCP-ready semantic engine that gives AI agents governed SQL and dashboard wor |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/SandeepAi369/Agent-first-browse.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about Agent-first-browse
Who makes decisions in MCP mode, and how does the host interact with the browser?
browser_start, followed by repeated browser_perceive and browser_act calls, then browser_stop. The standalone agent-first-browse run command instead uses the project's LangGraph workflow to make decisions.Does it require a GPU, and what should I size for?
Can a company self-host and redistribute it?
When should I choose it over writing a Playwright script?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy