[Feature]: t3 browser CLI — drive the collaborative browser without MCP #7469
Replies: 1 comment
|
Arrived at nearly this design from the token-cost side, so rather than open a competing thread: strong +1 on routing through Measurements (at
Harnesses that load MCP definitions up front pay that in every thread, browser or not. Claude's SDK defers them by default, so the idle cost there is just the 21 names (~650 B), but each first use still pulls whole definitions in ( Change 1: reuse the thread credential instead of minting an admin session. The Delivering it can also fix #10020 on the way: Change 2: the same treatment applies to the pull-request tools, and they're the cheaper place to start. They're 3 tools plus an always-on On drift, which you flagged as the main cost: it may not need a separate operation registry. The handlers already read scope from One more piece worth folding in: The precedent for all of this is the maintainers' own, in Full write-up with per-adapter notes and a test plan: blas0#1 |
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/server
Problem or use case
The collaborative browser is only reachable through the MCP
preview_*tools, so an agent without MCP cannot drive it at all. That covers a plain shell, a script, a provider whose harness has no MCP, and a second agent that wants to look at what the first one is building. Those callers currently reach for Playwright, which opens a browser nobody is watching — losing the one property that makes the preview worth having, that a human can see and take over the same tab.There is a second, quieter problem for callers that do have MCP.
preview_snapshotis budgeted and viewport-shaped, which is right for orientation and wrong for reading data. Getting a 240-row table means scrolling and re-snapshotting, paying for nav and chrome on every pass, with no way to tell a truncated read from a complete one.Proposed solution
A
t3 browsersubcommand that goes through the samePreviewAutomationBrokerthe MCP tools use, so a CLI-driven tab is the same collaborative tab a human sees. It reads the running server's origin from the persisted runtime state and mints a short-lived scoped session, so there is nothing to configure.Two smaller pieces that turned out to matter more than the transport:
@e1-style handles and actions accept a ref instead of a selector. This removes the guessing game of writing a locator that matches, and a stale ref fails as a distinct "stale ref, take a new snapshot" error rather than silently clicking the wrong element.extract. Structured row reading with cursor pagination, so a whole table is one call and the response states the true total rather than however many rows happened to fit.Why this matters
It makes the collaborative browser usable from anything that can run a command, instead of only from a provider with MCP wired up. And it turns "what does this dashboard actually say" into one call rather than a scroll-and-hope loop.
Smallest useful scope
The CLI alone, over the existing broker, with
open,snapshot,click,type, andstatus. Refs andextractare separable and could land later, or never.Alternatives considered
Playwright or raw CDP. Both drive a browser the human cannot see, which gives up the collaborative tab.
Expanding the MCP tool surface instead. This seems like the wrong direction given #6792 and #6863, where people are asking for fewer preview tools, not more. A CLI adds no MCP tools at all — it is reachable only by callers that deliberately run it.
Doing nothing. Reasonable if MCP-less agents are not a case you care about. That is the main thing I would like a read on.
Risks or tradeoffs
extractis a genuinely new capability rather than a transport change, and is the piece most reasonable to say no to.Examples or references
Related, and pulling the opposite way on tool surface: #6792 (disable built-in browser/preview MCP tools), #6863 (skip injecting preview tools when no host is connected).
Contribution
Being upfront: I have this working on a fork and have been using it daily, which is how the refs and
extractparts surfaced. I am raising it here rather than opening a PR because CONTRIBUTING.md asks for an issue first on non-trivial work, and because a large unsolicited feature PR is explicitly what you have asked people not to do. Happy to break it into small pieces if it is a direction you want, and equally happy to hear it is out of scope.All reactions