Skip to content

feat: re-serve Playwright MCP as browser_* tools under the tool profile (#10) - #11

Merged
chaodu-agent merged 1 commit into
mainfrom
feat/upstream-mcp
Sep 26, 2026
Merged

chaodu-agent merged 1 commit into
mainfrom
feat/upstream-mcp

Conversation

@chaodu-agent

Copy link
Copy Markdown
Contributor

Option A from #10. Details in the commit message and README section. Verified end to end from the lent p1 pod session: sandbox lists 16 browser_* tools, run_code_unsafe is unknown, navigate+snapshot on a YouTube channel returns the first video title as text. Closes #10.

… under the tool profile (#10)

UpstreamMCP: Streamable-HTTP client to a loopback MCP server — initialize, hold the
Mcp-Session-Id, re-init once on 400/404, parse JSON or SSE `data:` bodies, send Host
as the bare host (Playwright's --allowed-hosts compares it verbatim; with the port it
403s). tools/list cached 30 s; down → empty, so the merged list simply lacks them.

MCPServer gains `upstreams` + `upstreamFilter`: upstream tools are appended to
tools/list and routed on tools/call, local names win on collision, results are
relayed verbatim (image blocks survive). scoped(to:) carries the upstreams and the
profile, so the filter travels with the lent server.

ToolProfile.sandbox: browser_* is allowlisted (navigate/back/snapshot/find/click/
type/fill_form/press_key/hover/select_option/wait_for/tabs/take_screenshot/
console_messages/resize/evaluate); everything else browser_* — run_code_unsafe,
file_upload, pdf_save, network_*, mouse_*_xy, drag/drop, dialogs, emulate_media,
close, and anything new — is denied.

CLI: --upstream name=url (repeatable); instructions mention the browser when one is
configured; deploy.sh adds the Playwright upstream when its LaunchAgent exists.

Tests (88 pass): fake SSE upstream — sandbox list/deny/shadowing, owner sees all,
call forwarding + verbatim passthrough, upstream down, session re-establishment,
body parsing; allowlist shape. Verified from a lent pod session against the real
pw-mcp on macmini: navigate → snapshot returned a YouTube channel's first video
title as text. 0.6.0.
@chaodu-agent
chaodu-agent merged commit 309f689 into main Sep 26, 2026
4 checks passed
@chaodu-agent
chaodu-agent deleted the feat/upstream-mcp branch September 26, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser tools for lent sessions: relay pw-mcp (or CDP) through reverse attach, no screenshots needed

1 participant