Skip to content

feat(gateway): read the website browser's card on its MCP port, like every MCP server's (FD-4701) - #558

Merged
earakely-scale merged 2 commits into
mainfrom
edgararakelyan/fd-4701-deploy-reads-browser-card-on-mcp-port
Nov 9, 2026
Merged

earakely-scale merged 2 commits into
mainfrom
edgararakelyan/fd-4701-deploy-reads-browser-card-on-mcp-port

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

What

The VM deploy now proxies the website browser's REST, meaning its env card and its computer-recording/v1 calls, to its MCP port, as it does for every other MCP server. The containers deploy already did this. Before, it sent them to the Playwright MCP recorder's own port 18766, whatever browser filled the slot.

MCPServerConfig.card_port is removed. It existed only for this.

This is FD-4701's PR 2. PR 1 (#548, v0.9.1475) made the recorder front the MCP port and serve the card there. Dev and prod both serve that image since Nov 9 (playwright-mcp v3, sha256:5860038869cc). A browser that serves its card on its MCP port, such as chromium alone for M8.13, now fits the slot with no special case.

Rollout

  • No image change. Nothing under playwright_mcp/ changes, so its source digest, tag and promotions stay as they are. The image keeps serving its card on 18766 as well, for installs from v0.9.1370 that still read it there. Dropping 18766 from the image is FD-5379, for later.
  • Envs already deployed keep 18766. Their compose files still proxy to 18766, and a snapshot reload leaves the compose file as deployed (a new unit test pins this).
  • No startup window. The gateway depends_on each MCP server being healthy, a TCP connect to its MCP port, so the browser's REST is up whenever the gateway is, at deploy and at reload. A killed recorder takes the front and 18766 down together, as before.
  • The rollback floor is v3. With this deploy code, the previous image playwright-mcp v2 has no card on its MCP port, so a rollback to v2 would drop the browser from the deploy's card (its tools still work). Prod's previous is v2 today, and it stops being the rollback target once a newer image is promoted.

Tests

  • Unit: the compose sends every server's REST, the browser's included, to its MCP port. The deploy passes the browser as a plain MCPServerConfig. A reload keeps an older deploy's :18766.
  • Integration:
    • test_gateway_with_single_website_env now also checks the deployed compose's REST_PROXY_URLS.
    • New test_the_browsers_card_and_recording_through_the_gateway_survive_its_recorder_and_container_restarting covers the chaos case. It kills the recorder (the MCP server behind it keeps its pid) and then restarts the browser's container. After each, the card answers through the gateway and a recording through the gateway films the page.
  • VM e2e on agent-environments-admin (amd64 c6i.2xlarge, arm64 m7g.2xlarge), at a9eacea:
    • amd64, 9/9: the four image tests (playwright_mcp_local_test.py), test_gateway_with_single_website_env, the new restart chaos test, test_gateway_with_multi_env_including_website, test_gateway_with_website_env_v1 and test_gateway_website_trigger_fires_on_a_request_through_the_website_proxy. The gateway tests' fixture images build for amd64 only.
    • arm64, 4/4: the image tests.
    • Unit tier on both: 14103 passed. The 5 failures are the VM's environment: no httpx in the system Python for the generated CLIs, no .git in the synced tree, no unzip.
  • A negative control shows the deploy no longer depends on 18766. On the VM only, I moved the image's card-only server from 18766 to 18799, which is what FD-5379 will do to the image.
    • This branch: the website e2e and the restart chaos test pass.
    • Main's deploy code: the browser drops out of the deploy's card (children_environments == []). That is the breakage FD-5379 has to wait out.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge with the stated v3 browser-image rollback floor.

Summary

New VM deployments read the website browser’s card and recording routes on its MCP port, like other MCP servers.

  • VM gateways now read the website browser card and recording calls on its MCP port.

earakely-scale explicitly acknowledged that rolling the browser image back to v2 would remove its card from new deployments; v3 is the stated rollback floor.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  C[Client] --> G[Gateway]
  G -->|Card and recording on MCP port| R[Browser recorder]
  G -->|MCP requests on same port| R
  R -->|Other requests| P[Playwright MCP]
Loading

Reviews (1) · Last reviewed commit: "test(gateway): find the browser's record..." · Reviewed by Greptile

earakely-scale and others added 2 commits November 8, 2026 23:03
…every MCP server's (FD-4701)

The VM deploy proxied the website browser's REST, its env card and computer-recording calls, to
the Playwright MCP recorder's own port 18766, whatever browser filled the slot. Since 0.9.1475 the
recorder fronts the MCP port and serves the card there, and both stages serve that image, so the
gateway now reads every MCP server's card on its MCP port, as the containers deploy already does.
`MCPServerConfig.card_port` goes.

The image keeps serving its card on 18766 too, for installs from 0.9.1370 that still read it
there; deploys made before this keep their compose file, 18766 included, across a snapshot reload.

Tests: the compose and deploy units read the browser on its MCP port, a reload keeps an older
deploy's 18766, the website e2e checks the deployed compose, and a new e2e kills the recorder and
restarts the browser's container, then reads the card and records through the gateway after each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…restart e2e

The local sandbox rewrites /app in a script to the sandbox's own folder, so a
lookup for /app/recorder.py matched nothing there; the recorder is the one
process the image runs with /opt/recorder/bin/python.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale marked this pull request as ready for review November 9, 2026 07:36
@earakely-scale
earakely-scale requested a review from a team as a code owner November 9, 2026 07:36
@earakely-scale

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@earakely-scale
earakely-scale merged commit c6778c0 into main Nov 9, 2026
60 of 62 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/fd-4701-deploy-reads-browser-card-on-mcp-port branch November 9, 2026 16:27
@earakely-scale

Copy link
Copy Markdown
Collaborator Author

Real-provider e2e: 12/12 on Modal VM against dev. It deployed dev's gate-website with this branch's code and the browser dev serves, playwright-mcp v3 (ghcr.io/scaleapi/agentenv-playwright-mcp:src-5fecee7b…), in 47 s:

  • the deploy's card has the browser, and the gateway proxies its REST to playwright-mcp:18765;
  • the browser's card answers through the gateway and declares computer-recording/v1;
  • its tools are listed, it renders the site, and a recording through the gateway films it;
  • after the recorder is killed (it comes back, and Playwright MCP keeps its pid) and after the browser's container restarts, the card answers and a recording films again.

It was torn down afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant