DEV Community

TOPHET
TOPHET

Posted on • Originally published at github.com

Agentic Browser: ~98% fewer tokens than HTML for LLM web agents (Python + MCP)

Agentic Browser is an agent-first Python browser built on Playwright/Chromium so LLMs can drive the web with compact observations, stable element refs, and outcome-verified actions ? not raw HTML dumps.

Why it exists

Traditional scrapers hand models 100k+ tokens of markup. Agents need:

  1. Small structured observations (roles, labels, refs)
  2. Actions that mean success (URL/DOM outcomes)
  3. A plug-in for any host (MCP + OpenAI/Anthropic tool schemas)

Measured token efficiency

Scenario Raw HTML Compact observation Reduction
Quotes scrape ~2.8k?6.2k ~0.45k?1.3k ~78?84%
Rockstar GTA VI landing ~225,000 ~1,300 ~99.4%
GitHub vercel/next.js ~110,000 ~1,900 ~98.3%

Features

  • Stable refs + scoped grounding
  • Outcome verification (e.g. Issues click only OK if URL is /issues)
  • Page gates for challenges (detect & report ? not a bypass tool)
  • MCP server for Cursor / Claude Desktop
  • tools_as_openai() / tools_as_anthropic()
  • 118 automated tests; milestones M1?M10

Install

pip install agent-browser
playwright install chromium
agent-browser --help
# MCP
python -m agent_browser.mcp
Enter fullscreen mode Exit fullscreen mode

Links

MIT ? Python 3.11+

Top comments (0)