Brocogni is an open-source MCP server that compiles web pages into structured semantic maps for AI agents. Instead of dumping raw HTML (noisy, fragile, token-wasting), it delivers pre-computed selectors with confidence scores and fallback chains. The LLM gets understanding, not data.
npx browser-cognition-mcp
Every time your AI agent observes a page, someone pays for the tokens. The standard @playwright/mcp returns a raw accessibility tree with ephemeral ref IDs (e.g. e5, e10, e23).
The LLM must parse 62–93 mixed nodes, figure out what is actionable, and then guess selectors from scratch. Because these references expire dynamically, each new session starts from zero.
less tokens than @playwright/mcp for a complete observe → act → export workflow.
| Metric | @playwright/mcp | Brocogni | Brocogni (compact) |
|---|---|---|---|
| Observation tokens | 351 | 1,365 | 1,365 |
| Attempts to working script | 3 | 1 | 1 |
| Total tokens (all attempts) | 3,211 | 1,535 | 1,535 |
| Total cost per script | $0.04 | $0.01 | $0.01 |
| Selector durability | Expire per snapshot | Persistent (CSS/XPath) | Persistent (CSS/XPath) |
| Works after page refresh? | No | Yes | Yes |
| LLM must filter elements? | Yes (62-93 nodes) | No (9 nodes, pre-filtered) | No (9 nodes, pre-filtered) |
The hidden cost of @playwright/mcp isn't the observation. It's the iteration. Each failed attempt burns another snapshot + LLM reasoning tokens. Brocogni's richer observation eliminates ALL downstream reasoning and retries.
Brocogni strips away everything that isn't actionable. Only 7 ARIA roles survive filtering: button, link, textbox, combobox, checkbox, radio, menuitem, and tab.
Everything else is noise. The LLM never sees layout containers, empty headings, or static decorational DOM nodes.
| Feature | @playwright/mcp | Brocogni |
|---|---|---|
| Pre-computed selectors | ✗ | ✓ |
| Bounding boxes | ✗ | ✓ |
| Purpose inference | ✗ | ✓ |
| Fallback chains | ✗ | ✓ |
| Confidence scores | ✗ | ✓ |
CDP accessibility tree, DOM snapshot, and CSSOM geometries are extracted in a single combined execution to minimize context switches.
Filters down to the 7 actionable ARIA roles, fuses visual bounding boxes, and infers purpose. No static structure or noise reaches the LLM.
Generates ranked fallback selector chains. Each locator is scored based on uniqueness, layout stability, and accessibility hierarchy.
1await page.click('.btn-primary');
2await page.fill('.css-x83kf2 > input', 'hello');
Works today. Fails tomorrow on tailwind updates or DOM shifts.
1await page.click('role=button[name="Sign in"]');
2await page.fill('role=textbox[name="Email"]', 'hello');
Direct ARIA locator matches that persist across style and structural updates.
Watch how Brocogni orchestrates browser tasks by providing semantic node mapping.
An AI agent uses Brocogni to navigate a hotel booking page — observes the page, finds input fields and buttons by purpose, fills the form, and exports a reusable Playwright script. All in one shot.
No API keys. No telemetry. No telemetry servers or cloud relays. Everything runs locally on your machine via Node.js and Playwright.
Simply install the chromium binary on your local machine and hook the stdio bridge into your agent.
npx playwright install chromium
claude mcp add brocogni -- npx -y browser-cognition-mcp
Settings → Features → MCP → Add New
Name: brocogni
Type: stdio
Command: npx -y browser-cognition-mcp
npx browser-cognition-mcp install
Zero setup.
Brocogni reads your project's opencode.json automatically during runtime mapping.