feat: re-serve Playwright MCP as browser_* tools under the tool profile (#10) - #11
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.