Add a page.evaluate / JS-execution tool to the MCP bridge
The problem
The MCP bridge exposes 30 tools, but none of them can run JavaScript in the page. That blocks the single most common job an agent has: pulling structured data out of a list.
Concrete case: scraping the Hacker News front page for title + URL + points. Through the bridge, browser_extract returned an empty object {} for both "story titles and points" and "titles", and browser_get_state returned a 12 KB accessibility tree that did not contain a single points value or rank number. The agent can see links, not the data next to them. With page-level JS the same extraction is 10 rows of clean JSON in one call, under a second.
Why the accessibility tree is not a substitute:
- it carries only what is exposed as an accessibility node, so table cells, computed styles, canvas contents, and framework state are invisible
- on a plain static HTML table it cost ~3,000 tokens and still missed every numeric column
- there is no way to read a computed value, run a bulk DOM query, or call the page's own fetch()
Requested capability:
1. A browser_evaluate tool taking a JS expression or function body and returning a JSON-serialisable result, executed in the active pane's main world, subject to the connection's capability preset.
2. A browser_cdp escape hatch (Page, Runtime, DOM, Network, Input) for the cases a wrapper cannot cover.
3. Gate both behind the Developer and Full presets so Read only / Browse / Operate keep their current guarantees.
Who it helps: anyone pointing Claude Code, Codex, Cursor or another MCP client at Stoic Browser for research, QA, or data collection. Without JS execution the agent can navigate and click but cannot answer questions about page content, so it falls back to a separate headless browser and the logged-in workspace goes unused.
When it matters: on any list, table, dashboard, or SPA where the interesting values are not individual interactive elements. That is most real sites.
Secondary, smaller issue: browser_extract returning {} silently instead of an explicit unsupported or empty-result error makes it look like the page had no data. An error would have been clearer.
Roadmap progress
SHIPPED · 1.9.1PENDING
REVIEWING
—
PLANNED
—
IN PROGRESS
COMPLETED
- — Khang Nguyen submitted this request
- — Khoa - StoicSoft Team moved it to In progress
- — Khoa - StoicSoft Team moved it to Completed “Shipped in Stoic Browser 1.9.1: MCP connections on the Developer and Full presets get `browser_evaluate`, which runs JavaScript in the page and returns the result as JSON (for example title, link and points for every Hacker News story in one call), plus `browser_cdp` for single DevTools commands. The current version is 1.11.1.”
Discussion0
Newest first- No comments yet. Add context or ask a question below.
Sign in to comment, vote and follow this request.
Sign in to reply