How to Connect AI Agents to Web Apps with Durable Action Receipts & Clean DOM Inspection: An MCP Browser Bridge
Description and use
В 2026 году автономные ИИ агенты (Claude Desktop, Cursor, OpenAI Codex, LangGraph) регулярно взаимодействуют с веб-приложениями.开发人员 сталкиваются с тремя серьезными проблемами: источение контекстного окна при передаче сырого HTML (1–5 МБ с вложенными SVG, JSON
Problem
Autonomous AI agents (Claude Desktop, Cursor, OpenAI Codex, LangGraph) routinely interact with live web applications for checkout forms, SaaS portal invoice retrieval, CI/CD pipeline triggering, and dashboard scraping. Three severe production bottlenecks emerge: context window exhaustion from dumping raw HTML (1–5MB with inline SVG, JSON hydration payloads, and telemetry scripts), lack of cryptographic action receipts for irreversible agent actions (e.g., payment form submissions, permission modifications), and zombie memory leaks from unmanaged headless browser contexts consuming gigabytes of host RAM.
Outcome
BrowserBridge reduces token costs by ~95% compared to raw HTML parsing, provides tamper-evident cryptographic receipts for all agent actions, and prevents zombie memory leaks through automated session reaping.
Workflow
- Agent connects to BrowserBridge via MCP JSON-RPC tools
- BrowserBridge receives target web app DOM from the agent
- AOM DOM Filter extracts interactive elements (buttons, links, text fields) from raw HTML
- Session Pool Manager manages browser sessions with anti-zombie TTL
- Agent performs actions on the compact AOM representation
- Durable Receipts module generates a cryptographic SHA-266 receipt for each action
- Agent retrieves receipts for audit trail verification
Evidence
Dumping raw HTML (often 1MB to 5MB with inline SVG, JSON hydration payloads, and telemetry scripts) exhausts the LLM's context window within 2 or 3 turns, driving token costs through the roof.
If an agent performs an irreversible transaction—like submitting a payment form or modifying permissions—there is no tamper-evident audit record proving what the DOM state was before and after the action.
Unmanaged headless browser contexts stay resident in RAM when agents drop connections or fail unexpectedly, consuming gigabytes of host memory.
transforms noisy web pages into compact, token-efficient Accessibility Object Models (~95% token reduction)
seals every agent action with a cryptographic SHA-266 receipt
enforces strict session pooling with automated zombie reaping
- Record date: 2026-10-21T05:56:22.449Z