A browser MCP pattern that saves agent context
agents can use up a lot of context just by reading pages. A Playwright-based MCP snapshot of one Hacker News page can take about 14,700 tokens, and the full page tree is sent again after every click. agent-browser is a Go binary built to reduce that waste.
It uses chromedp under the hood and connects through MCP over . Instead of long -tree dumps, it gives the agent compact reference lines, then returns only what changed after an action. The claimed size is about 1,200 tokens for Hacker News and about 1,250 tokens for a page.
Commands can be written by intent, such as `act "Sign in"` or filling a field by name, and unclear matches return ranked choices instead of guessing. Each action returns a verdict, such as navigation, dialog opened, status, visible change, no visible effect, or CHALLENGE, plus the XHRs that ran.
Key points
- A Playwright-based MCP snapshot of Hacker News is described as about 14,700 tokens.
- agent-browser claims to reduce that Hacker News snapshot to about 1,200 tokens.
- After an action, it returns a delta instead of sending the full page again.
- Intent commands like `act "Sign in"` can click or fill controls by name.
- If a target is ambiguous, it returns ranked choices instead of guessing.