Sandeep
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
๐ Agent First Browse
Fast, token-efficient autonomous browser control for AI agents. Accessibility-tree-first perception ยท LangGraph verification ยท Native zero-API MCP & CLI
Live Demo

โก Perception Speed | ๐ช Prompt Efficiency | ๐ Zero-API Agent Control | โ Automated Verification |
12.0ร faster | 54.8% fewer tokens | Native MCP + CLI | 528 passing tests |
| Up to 95% saved behind modals | 7 stdio tools + |
|
Related MCP server: BAP MCP
Why Agent First Browse?
Most browser agents burn thousands of tokens per step on raw DOM dumps, sleep on fixed timers, or click stale coordinates behind overlays. Agent First Browse treats the browser as a structured, verifiable environment for AI agents:
Pillar | How It Works |
โก Adaptive DOM Settle |
|
๐ฏ Paint-Order Occlusion Pruning | Live |
๐ Incremental Delta Snapshots | Consecutive same-URL steps emit only |
๐ณ Tier-2 Accessibility-Tree Rescue | Automatically escalates to CDP/Playwright Accessibility Trees whenever Tier-1 DOM scans go sparse ( |
๐ Stale-Ref Rebind & 4-Tier CDP | Verifies live |
๐ก๏ธ Defense-in-Depth Safety | Masks passwords, OTPs, PINs, and cards before they reach prompts or logs; enforces RFC 6890 SSRF URL policies, typed errors, and full-jitter retries ( |
Architecture
Drive real Chromium either autonomously through the LangGraph verification brain or directly from any AI coding agent (Antigravity, Claude Code, Cursor, VS Code, Gemini CLI) with zero external LLM API keys:
flowchart LR
subgraph Entry["Entry Surfaces"]
E1["Autonomous Brain\nLangGraph StateGraph"]
E2["External AI Agent\nNative MCP stdio or CLI"]
end
subgraph Perception["V2 Perception Pipeline"]
P1["Adaptive Settle\nMutationObserver"]
P2["DOM + Tier-2 A11y\nSecret Redaction"]
P3["Occlusion Filter\nPaint-Order Hit-Test"]
P4["Delta Compressor\nCompact Ref Roster"]
P1 --> P2 --> P3 --> P4
end
subgraph Execution["Verification and Action Engine"]
X1["Overwatch Gate\nL1-L5 Grounding and Reality"]
X2["Stale-Ref Rebind\n4-Tier CDP + Stealth Chromium"]
X1 --> X2
end
subgraph Core["Shared Core Primitives"]
C1["URL Policy and Redaction\nTyped Errors and Retries\nContextVar DI and Telemetry"]
end
E1 --> P1
E2 --> P1
P4 --> X1
X2 -. "Next state" .-> P1
Core -. "Guards and observes" .-> ExecutionVerified Benchmarks
Measured on live headed Chromium (headless=False, zero external LLM API keys, AI agent acting directly as the decision-making brain across live websites and diagnostic stress scenarios):
Scenario | Legacy Baseline | V2 Engine | Measured Impact |
Hacker News ( |
|
| 10.0ร faster ยท 35โ78% fewer tokens |
Blocking Modal ( |
|
| 10.7ร faster ยท 95.0% fewer tokens ( |
SPA Mid-Step Rerender ( | โ FAIL (clicked stale coords) | โ
PASS ( | Live stale-ref semantic recovery |
Custom ARIA Widgets ( |
|
| Automatic Tier-2 A11y escalation |
Cumulative Session Average |
|
| 12.0ร faster ยท 54.8% fewer tokens/step |
Test | Legacy ( | V2 ( | Gain |
|
|
| 10.3โ10.8ร faster, 42โ51% fewer tokens |
|
|
| 9.9โ10.1ร faster, 35โ78% fewer tokens |
|
|
| 10.7ร faster, 95.0% fewer tokens, 44 occluded pruned |
| FAIL ( | PASS ( | Stale-ref semantic recovery |
|
|
| Automatic Tier-2 A11y rescue |
|
|
| 10.8ร faster, 52.6% fewer tokens |
|
|
| 11.0ร faster, 34.1% fewer tokens |
Quick Start
Requires Python 3.11+ on Linux, WSL, or macOS.
# Install from PyPI
pip install agent-first-browse && python -m playwright install chromium
# Or install from source
git clone https://github.com/SandeepAi369/Agent-first-browse.git && cd Agent-first-browse
python3 -m venv .venv && source .venv/bin/activate
pip install -e . && python -m playwright install chromiumRun Your First Task
# Autonomous LangGraph run (configure keys once via: cp .env.example .env)
agent-first-browse run --mode v2 "Open https://news.ycombinator.com and find the top 3 stories"Want zero external API keys? Connect Antigravity, Claude Code, Cursor, VS Code, or Gemini CLI directly via native MCP or the stateful CLI daemon:
Copy .mcp.json.example into your MCP client config:
{
"mcpServers": {
"agent-first-browse-eval": {
"command": ".venv/bin/python",
"args": ["-m", "eval_connector.mcp_server"],
"env": {
"PYTHONPATH": "src"
}
}
}
}Tool | Purpose |
| Launch a |
| Run live perception and return compact ref elements + step telemetry. |
| Execute |
| Diff |
| Save a viewport or full-page PNG screenshot to disk. |
| Export cumulative Markdown/JSON telemetry and scenario catalog. |
| Close one session or shut down all active sessions cleanly. |
# Start paired Legacy + V2 sessions on any live URL (add --headed to watch on screen)
agent-eval start-pair live --url https://news.ycombinator.com --headed
# Compare speed, tokens, occlusion pruning, and element visibility side-by-side
agent-eval compare live_legacy live_v2
# Step-by-step perception and actions
agent-eval perceive live_v2
agent-eval act live_v2 click e1 --auto-perceive
agent-eval screenshot live_v2
# Export cumulative report and shut down cleanly
agent-eval report --json-out eval_report.json
agent-eval stop --daemon(Without pip install -e ., replace agent-eval with .venv/bin/python scripts/agent_eval.py.)
# Optional on headless Linux/WSL for stealth headed display inside Xvfb
sudo apt-get install -y xvfb
# Run with baseline legacy mode for side-by-side comparison
./agent.sh --mode legacy "Open https://news.ycombinator.com and find the top 3 stories"
# Invoke Python directly (add --headless to run without a display)
.venv/bin/python src/run_v16.py run --mode v2 "Log in to https://the-internet.herokuapp.com/login and verify the secure area"# Full offline unit + local-Chromium test suite (528 tests)
.venv/bin/pytest -q
# Architectural guardrails (frozen modules, universal-only perception, exports, secrets, test hygiene)
.venv/bin/python scripts/check_guardrails.py --strict-test-hygiene
# Scoped lint & progressive typecheck (mirrors GitHub Actions CI)
.venv/bin/ruff check src/core src/v2_engine src/eval_connector scripts/check_guardrails.py
.venv/bin/mypy src/core src/v2_engine src/eval_connector scripts/check_guardrails.py
# Built-in side-by-side Legacy vs V2 local stress benchmark (zero API keys)
.venv/bin/python scripts/benchmark_v2_vs_legacy.py --suite localDocumentation
Guide | Contents |
Engineering handbook, package boundaries, frozen-file rules, and verification commands. | |
Complete Zero-API MCP + CLI connector guide, scenarios, and headed benchmark results. | |
Subsystem-by-layer test coverage rollup and CI gate mapping. | |
V2 perception & resilient action engine design rationale. | |
V29 cognitive reliability layers (Reality Monitor, Intent Journal, Sub-Goal Lock). |
License & Support
Licensed under the Apache License 2.0 โ see
LICENSE.If you find Agent First Browse useful, consider starring the repo or supporting ongoing open-source development via GitHub Sponsors.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Web search and page reading for AI agents with zero API credits
Visual testing for coding agents: your agent sees every UI change it makes and triages each diff.
Firecrawl, the context API for AI agents: search, scrape, interact with the web, plus paper search.
Graph-native persistent memory for AI agents โ 33 MCP tools, zero-LLM writes.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenancethe open automation engine for AI agents. Control live browsers and desktop apps locally with instant execution241 npm3AGPL 3.0

BAP MCPofficial
AlicenseNot gradedqualityDmaintenanceLightweight browser automation server for AI agents, enabling fast (10-25ms per action), structured observations and semantic selectors with zero token overhead.6Apache 2.0- AlicenseBqualityCmaintenanceEnables LLM agents to automate web browsers with token-efficient perception, stealth anti-detection, captcha solving, network interception, and isolated persistent sessions.51MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to browse and interact with web pages through compact, structured representations โ page summaries, targeted element queries, and full detail on demand โ instead of paying for a full accessibility-tree dump on every call. This cuts the token cost of reading content-heavy pages by up to ~140x while still supporting navigation, forms, clicks, screenshots, and session management.4 npm-