Repository navigation
Description
Update 2026-11-26 (infra move): The shared Renovate preset moved to dan-petty/infra.
.github/renovate/base.json is gone. The preset is renovate/base.json of dan-petty/infra, and .github/renovate.json extends it. Validate only .github/renovate.json here. A preset change goes to infra.
Problem or Motivation
Agents in Claude Code and Kilo cannot take browser screenshots. On 2026-11-13, the agents of the retric-ai website redesign could not check their pages visually. The Playwright tools were not loaded, and a local install was refused. The owner asked: "how do I get a browser set up?"
Facts (2026-11-13):
.claude/settings.jsonturns offplaywright@claude-plugins-official(chore(agent): turn off unused Claude Code plugins #4468).- The plugin and the Kilo extension start
npx @playwright/mcp@latest. That has no version pin, so it breaks the project pin rules. - The devcontainer image has no Chromium and no Playwright browser.
The owner chose one shared browser in the cluster (#5356). This item is the client side of that design. The devcontainer gets no browser.
Proposed Solution & Architectural Design
Connect agent sessions and workstation scripts to the cluster browser of #5356. Do not change the devcontainer Dockerfile, and do not put Chromium in the image.
Client pin
- Add
playwright==1.65.1to the dev dependency group inpyproject.toml, hashed inuv.lock. Its driver isplaywright-core1.65.0. It bundles the MCP server, which runs asuv run playwright mcp. - A
git pullmoves the client. Worktrees get it at once. - Add the pep621 manager for the pin to the Renovate group
playwrightof feat(k8s): run a pinned Playwright browser server in namespace devops #5356. - Extend the lockstep test of feat(k8s): run a pinned Playwright browser server in namespace devops #5356: the client major.minor equals the image major.minor. The patch can differ.
Committed MCP config .agents/playwright-mcp.json
It holds no path and no real domain:
browser.remoteEndpoint: exposeNetwork<loopback>:8821,<loopback>:8822,<loopback>:8823, timeout 30000. The timeout keeps a fifth session from waiting forever for a--max-clientsslot.browser.isolated: true,outputDir.data/agent/browser(gitignored).timeouts.idle: 300000. This closes the remote browser and frees a slot. Without it, the remote browser never closes.- allowed-origins: the 3 loopback preview ports,
fonts.googleapis.comandfonts.gstatic.comonly. This is a guard, not a boundary.
Values at run time (never committed)
- The endpoint with the path:
ws://127.0.0.1:13000/<path>?browser=chromium. The path is the keyring valuebrowser_ws_pathof feat(k8s): run a pinned Playwright browser server in namespace devops #5356. The query is necessary: the bundled MCP sends no browser name, and run-server then fails with "launch mode for null". - The tunnel-host origins come from the configured domain at run time, for example from an environment variable that the session sets from config. The agent may open the tunnel hosts (owner decision 2 of feat(k8s): run a pinned Playwright browser server in namespace devops #5356).
- The bundled MCP takes
remoteEndpointonly from its config file. It has no flag and no environment variable for it (playwright mcp --helpof 1.65). allowed-origins has the variablePLAYWRIGHT_MCP_ALLOWED_ORIGINS. - Thus the session needs a per-user config under
.data/agent/browser/(gitignored). It adds the endpoint and the tunnel-host origins to the committed values. The plan picks how that file is written (a person step or a smalldevopsstep) and records the cost (rule 3).
MCP entry
- Add the stdio entry
browserto.mcp.jsonandkilo.jsonconly:uv run playwright mcp --config <the per-user config>. - Do not add it to
claude_mcp.json.j2,mcp.json.j2orkilo_mcp.json.j2.devops devcontainerrenders them for any repository. - The owner's gitignored
.claude/settings.local.jsonsetsenableAllProjectMcpServers, so the entry starts with no extra setting. Other users approve it at the project prompt. - Set
kilo-code.new.browserAutomation.enabledto false in.vscode/settings.json. The Kilo extension hard-codesnpx @playwright/mcp@latest. - Keep
playwright@claude-plugins-officialoff.
Transport
- The user starts
kubectl port-forward -n devops deploy/browser 13000:3000first. Off the home network, rundevops k8s tunnel startbefore it. - When the forward is down, the tool fails with a connect error, and the agent docs name the command.
- When the pod restarts, the forward stops. Then the user runs the command again. There is no fallback URL.
Local previews
- Serve a preview on 127.0.0.1 at port 8821, 8822 or 8823, for example
python -m http.server --bind 127.0.0.1 8821. Only these ports are in the exposeNetwork rule. - The server starts a SOCKS5 proxy for each connection. For the matched ports, the client opens the TCP connection in the devcontainer. Other hosts load directly from the pod.
- A page cannot reach other devcontainer forwards: Argo CD 8080, Grafana 8030, Prometheus 9090, Ollama 11434, Qdrant 6333, Valkey 6379, OTel 4318 and the browser forward 13000.
- Workstation scripts use the Python
connect()API from the same pin. A script for a local preview names only its port in exposeNetwork. A script for public pages or tunnel hosts sets no exposeNetwork.
Docs
Update CONTRIBUTING.md:61, the agent tool docs and the knowledge base:
- the port-forward command, and the rule to run it again after a pod restart
- where the path comes from
- the preview port rule (8821 to 8823)
- the 428 fix:
git pull, then restart the browser MCP server - a Python
connect()script example
After the merge, add a comment on #4720, #4745, #4754, #4755 and #5186 that names these paths.
Target Subsystem
FastMCP & IDE Integrations
Existing Tool Considered
- Client: the MCP server that Playwright bundles (Apache-2.0), from the PyPI wheel
playwright1.65.1 inuv.lock. Scripts use the Playwright connect API from the same wheel. - Transport: plain
kubectl port-forward. - Pins: Renovate, in the group of feat(k8s): run a pinned Playwright browser server in namespace devops #5356.
Rejected options:
@playwright/mcp0.0.85: it pullsplaywright-core1.66.0-alpha, so the 1.65 server answers HTTP 428.- The plugin and the Kilo built-in (
npx @playwright/mcp@latest): no version pin. - A Node client lock in the devcontainer image: it moves only when a person rebuilds the image, and it waits for build(devcontainer): add ping, traceroute, mtr, nc and tcpdump #5343.
- Chromium in the devcontainer image (the first plan of this issue): several hundred MB in each image, sandbox work under rootless Podman, a copy on each workstation, and no path for in-cluster integrations.
Build estimate: about 0.7M to 1.2M agent tokens and half a day, plus the per-user config writer if the plan picks a devops step.
Keep cost:
- A 51 MB wheel in each project venv (uv cache hardlinks).
- The MCP entry adds about 25 deferred tool names to each session.
- At each Playwright minor, a short window of HTTP 428 for sessions on a stale checkout.
Acceptance Criteria
- In the devcontainer with no browser binary, an agent takes full-page shots of a
127.0.0.1:8821preview at 1280 and 400 px, in light and dark. - A request from that page to
127.0.0.1:13000or127.0.0.1:8080fails. - A 1.64 client gets a clear HTTP 428 error.
- Test: the committed exposeNetwork holds no bare
<loopback>and no*. - Test: the committed config and the MCP entries hold no path and no host other than loopback and the 2 font hosts.
- Test: the client pin major.minor equals the image major.minor.
- Kilo starts the pinned entry, and its built-in browser automation does not start.
- The token cost of the tool listing is measured for 7 days, against the 150M tokens a week that the eager plugin listing cost in chore(agent): turn off unused Claude Code plugins #4468. If the cost is material, change to playwright-cli with a skill.
Dependencies
Depends on #5356. The acceptance needs the running server, the path value and the Renovate group.
It does not wait for #5343, because the devcontainer Dockerfile does not change.
Not verified yet
- The PyPI wheel 1.65.1 runs
playwright mcpas a stdio MCP server underuv run, and its process tree exits when Claude Code or Kilo closes stdin. remoteEndpoint.timeoutbounds the wait for a free--max-clientsslot, so a fifth session fails in about 30 s.PLAYWRIGHT_MCP_ALLOWED_ORIGINSreplaces or extends the list of the config file.kilo-code.new.browserAutomation.enabled=falsestops the built-in@playwright/mcp@latestprocess of Kilo 7.8.27, and Kilo accepts the pinned entry inkilo.jsonc.
Alternatives check of 2026-11-28: in-use.
The item already names this tool.
Tool: playwright (https://pypi.org/project/playwright), Apache-2.0, last activity 2026-11-14, maintained.
Reason: Searches found the Playwright PyPI wheel, which the issue already names and which ships both the stdio MCP server and the Python connect() API for the remote cluster browser; the Node @playwright/mcp package is the rejected alternative.
Covers:
- Bundled stdio MCP server for Claude Code and Kilo sessions
- Python connect() API for workstation screenshot scripts
- Remote endpoint with isolated contexts and allowed-origin guard
- Full-page screenshots at chosen widths and color schemes
Lacks:
- No flag or env var for remoteEndpoint, so a per-user config file is needed
- No fallback when the port-forward stops or the pod restarts
- A major.minor mismatch with the server answers HTTP 428
- About 51 MB wheel in each project venv
Proposed design
Problem statement
Agents in Claude Code and Kilo cannot take browser screenshots: .claude/settings.json:4 turns the Playwright plugin off, and the devcontainer image holds no browser. The owner chose one shared browser in the cluster (#5356), so this item is the client side of that design. It pins the playwright client, commits the MCP config, adds the browser entry to .mcp.json and kilo.jsonc, turns the Kilo built-in browser off, and documents the port-forward, the preview ports and the 428 recovery. The devcontainer Dockerfile and the image do not change.
Acceptance criteria
Requirement: Pinned Playwright client
The dev dependency group SHALL pin playwright==1.65.1, and uv.lock SHALL hold its wheel hash.
Scenario: Lock and tree show the pin
- WHEN
uv lock --checkanduv tree --group devrun in the repository - THEN both exit 0 and the tree prints
playwright v1.65.1.
Requirement: Renovate pin group
The Renovate configuration MUST put the pep621 manager for playwright into the playwright group.
Scenario: Renovate config validator passes
- WHEN
npx --yes --package [email protected] renovate-config-validator --strict --no-global .github/renovate.jsonruns - THEN the command exits 0 and prints
Config validated successfully.
Requirement: Client and image lockstep
A test MUST fail when the pinned client major.minor differs from the browser image major.minor.
Scenario: Lockstep test passes
- WHEN
uv run pytest tests/test_playwright_pin.py::test_client_matches_imageruns - THEN the test passes and reports the two equal major.minor values.
Requirement: Committed MCP config
The committed .agents/playwright-mcp.json MUST hold only the three loopback preview ports in exposeNetwork and only loopback and the two font hosts in its allowed origins.
Scenario: Config validator passes
- WHEN
jq -e '.browser.isolated == true and .browser.remoteEndpoint.exposeNetwork == ["127.0.0.1:8821","127.0.0.1:8822","127.0.0.1:8823"] and .browser.remoteEndpoint.timeout == 30000 and .browser.outputDir == ".data/agent/browser" and .timeouts.idle == 300000' .agents/playwright-mcp.jsonruns - THEN the command exits 0 and prints the parsed config.
Requirement: MCP entry scope
The browser stdio entry MUST be in .mcp.json and kilo.jsonc only, and no devcontainer template MUST hold it.
Scenario: Entry scope validator passes
- WHEN
jq -e '.mcpServers.browser' .mcp.jsonandrg -n 'playwright mcp' src/devops_cli/templatesrun - THEN the first command exits 0 and names the
uv run playwright mcp --configcommand, and the search prints no match.
Requirement: Per-user config stays out of git
The per-user MCP config MUST live under .data/agent/browser/ and MUST NOT be tracked by git.
Scenario: Git ignores the per-user config
- WHEN
git check-ignore -v .data/agent/browser/playwright-mcp.jsonruns - THEN the command exits 0 and names the
.data/*rule of.gitignore.
Requirement: Kilo built-in browser off
.vscode/settings.json MUST set kilo-code.new.browserAutomation.enabled to false.
Scenario: Kilo uses the pinned entry
- WHEN a live check starts Kilo and lists its MCP servers
- THEN the list shows
browserwithuv run playwright mcp --config, and no@playwright/mcp@latestprocess runs.
Requirement: Remote screenshots
An agent session MUST take full-page screenshots of a local preview through the cluster browser at 1280 and 400 px in light and dark.
Scenario: Four screenshots
- WHEN a live check starts
kubectl port-forward -n devops deploy/browser 13000:3000and runs thebrowserMCP tool onhttp://127.0.0.1:8821 - THEN the tool writes four PNG files under
.data/agent/browserand exits 0.
Requirement: Preview isolation
A page served on a preview port MUST NOT reach any other devcontainer forward.
Scenario: Blocked forwards
- WHEN a live check loads a page from
127.0.0.1:8821and fetcheshttp://127.0.0.1:13000andhttp://127.0.0.1:8080 - THEN both fetches fail.
Requirement: Stale client error
A client whose major.minor differs from the server MUST receive HTTP 428.
Scenario: 1.64 client
- WHEN a live check runs a 1.64 client against the 1.65 server
- THEN the client prints
HTTP 428and exits non-zero.
Requirement: Agent docs
The agent docs MUST name the port-forward command, the path source, the preview port rule, the 428 recovery and a connect() example.
Scenario: Docs check
- WHEN
rg -nsearchesCONTRIBUTING.mdanddocsforkubectl port-forward -n devops deploy/browser,browser_ws_path,8821,HTTP 428andconnect( - THEN each search prints at least one match.
Requirement: Workstation script
A workstation script MUST connect to the cluster browser with the pinned Python connect() API.
Scenario: Connect script
- WHEN a live check runs a Python script with
connect()from the pinned wheel - THEN the script opens
http://127.0.0.1:8821and writes a screenshot.
Existing Tool Considered
Use playwright (https://pypi.org/project/playwright), Apache-2.0, maintained; the alternatives check of 2026-11-17 gives in-use, and its block names what the tool lacks. The bundled MCP server and the Python connect() API come from the same playwright==1.65.1 wheel, so the change adds no second client. The change builds no code: it pins the wheel, commits the MCP config and edits the MCP entries and the docs. The per-user config is a documented copy step of about five minutes per user, with no build tokens.
Key questions
- Which existing tool covers the browser client need?: Use
playwright1.65.1 from PyPI (Apache-2.0, maintained). The alternatives check of 2026-11-17 givesin-use, and itsblocknames what the tool lacks. The bundled MCP server and the Pythonconnect()API come from the same wheel, so the change pins no second client. (best practice) [sources: https://pypi.org/project/playwright, pyproject.toml:102]- Chosen: playwright 1.65.1. The alternatives check gives in-use, and the wheel bundles the MCP server and the connect API.
- Rejected:
@playwright/mcp 0.0.85. It pulls playwright-core 1.66.0-alpha and gets HTTP 428 from the 1.65 server. - Rejected: the plugin and the Kilo built-in. Both run
npx @playwright/mcp@latest, so neither has a version pin.
- How does the client reach the cluster browser?: Use
kubectl port-forward -n devops deploy/browser 13000:3000, the project's documented way to reach an in-cluster service from a workstation. Off the home network, rundevops k8s tunnel startfirst. The client has no fallback URL, and the user runs the command again after a pod restart. (best practice) [sources: docs/MCP_TOOLS.md:18, docs/CLI_REFERENCE.md:29, k8s/README.md:18]- Chosen: kubectl port-forward. It is the project's documented pattern for an in-cluster service from a workstation, and the devcontainer is not in the cluster.
- Rejected: in-cluster DNS. The devcontainer cannot resolve the cluster service.
- Rejected: fallback URL. A pod restart stops the forward, and no second URL exists.
- How is the per-user MCP config written?: Use a documented person step: the user copies
.agents/playwright-mcp.jsonto.data/agent/browser/playwright-mcp.json, adds thews://127.0.0.1:13000/<path>?browser=chromiumendpoint from the keyring valuebrowser_ws_path, and adds the tunnel-host origins from the configured domain. The file stays out of git under.data/agent/. A newdevopscommand is not worth its build and test cost. (best practice) [sources: AGENTS.md:18, SECURITY.md:17, AGENTS.md:9]- Chosen: documented person step. A copy and edit keeps the path out of git and adds no code, so rule 3 of AGENTS.md needs no build cost.
- Rejected: new devops command. It adds code and tests for a per-user secret, and the issue allows a person step.
- Which preview ports may a page reach?: Only
127.0.0.1:8821,127.0.0.1:8822and127.0.0.1:8823are inexposeNetwork. The devcontainer forwards Argo CD 8080, Grafana 8030, Prometheus 8090, Tempo 3200, Qdrant 6333 and Ollama 11434, and the workstation forwards other services; a page on a preview port must not reach them. The issue body's9090for Prometheus is the in-cluster service port; the devcontainer forward is 8090. (best practice) [sources: src/devops_cli/templates/devcontainer.json.j2:75, k8s/README.md:18, SECURITY.md:18]- Chosen: three loopback ports. Only 8821 to 8823 are in exposeNetwork, so the other forwards stay unreachable.
- Rejected: all loopback. It opens Argo CD, Grafana, Prometheus and the other forwards to the page.
- Rejected: wildcard. It is a boundary hole and the issue forbids it.
- Should the token cost measurement block this item?: No. Defer it to a new issue: the measurement needs seven days of real Claude Code and Kilo sessions after the merge, so it cannot be an acceptance criterion of this pull request. The archive of chore(agent): turn off unused Claude Code plugins #4461 records the 150M tokens a week that the eager plugin listing cost, and that is the comparison the follow-up makes. (best practice) [sources: openspec/changes/archive/2026-11-11-4461-turn-off-unused-claude-code-plugins/proposal.md:5]
- Chosen: defer. The measurement needs seven days of real sessions after the merge.
- Rejected: block. It would hold a workable client change for a week of usage.
- Should the MCP entry go into the devcontainer templates?: No. Add it to
.mcp.jsonandkilo.jsonconly.devops devcontainerrendersmcp.json.j2,claude_mcp.json.j2andkilo_mcp.json.j2for any repository, so a browser entry there would reach repositories that run no cluster browser. (best practice) [sources: src/devops_cli/commands/devcontainer.py:188, src/devops_cli/commands/devcontainer.py:201, src/devops_cli/commands/devcontainer.py:219]- Chosen: agent files only. The templates render for any repository, which may have no cluster browser.
- Rejected: templates too. It would add a broken browser entry to other repositories.
- The issue lists four MCP facts as not verified. How does the plan settle them?: Verify each before the entry is written:
uv run playwright mcp --helpfor the stdio command, the--configoption and the absence of a remoteEndpoint flag or variable; a run of the bundled server with the committed config for thebrowser.remoteEndpoint,browser.isolated,outputDirandtimeouts.idlekeys and thePLAYWRIGHT_MCP_ALLOWED_ORIGINSvariable; a 1.64 client against the 1.65 server for the 428 reply; and Kilo 7.8.27 forkilo-code.new.browserAutomation.enabled. If a fact does not hold, return the item with the evidence and write no compensating entry. (best practice) [sources: AGENTS.md:8]- Chosen: verify first. Rule 2 of AGENTS.md requires the premise to be confirmed against the real system before code is written.
- Rejected: assume the facts hold. An unverified config key or flag would break the entry and cost a later fix.
- Which Renovate manager updates the client pin?: Add the
pep621manager forplaywrightto theplaywrightgroup of feat(k8s): run a pinned Playwright browser server in namespace devops #5356. The shared preset extendsconfig:recommendedand no rule turns pep621 off, so the manager reads the dev dependency group ofpyproject.tomland moves the client with the image. (best practice) [sources: pyproject.toml:102, .github/renovate/base.json:4]- Chosen: pep621. It reads the dev dependency group of pyproject.toml, and the preset leaves pep621 on.
- Rejected: pip_requirements. The pin is not in a requirements file.
- Rejected: no manager. The pin would not update, and the client would drift from the image.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both add tools to the devcontainer, but #4368 changes the mechanism to Dev Container Features while this adds a specific browser and MCP server.dan-petty commentedon Nov 13, 2026
On hold (2026-11-13): the owner prefers a shared browser in the k8s cluster: "It would be better if I could run playwright in the k8s cluster and use it for other service integrations". A design study runs now (in-cluster Playwright service, how agent sessions and Service jobs connect, security). This issue changes to the devcontainer client side of that design or closes as superseded when the study ends.
[-]build(devcontainer): a pinned headless browser for agent screenshots[/-][+]feat(devcontainer): connect agent sessions to the cluster browser[/+]dan-petty commentedon Nov 13, 2026
Re-scoped (2026-11-13): this issue is now the client side of the cluster browser design. The in-image Chromium plan is removed, and the devcontainer Dockerfile does not change.
The browser server, its in-cluster path and the path value are in #5356. The hold on this issue is over when #5356 merges. The issue edit history keeps the old body.
devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: The searches surfaced the Playwright MCP server, shipped in the maintained
playwrightwheel (Apache-2.0), which the issue itself already names as its client ("the MCP server that Playwright bundles"). It gives agent browser automation and screenshots over a remote browser endpoint plus the Pythonconnect()API, so it covers the whole client-side need; the only thing outside it is the in-cluster browser service of #5356.The item already names this tool.
Tool: playwright (https://pypi.org/project/playwright)
Covers:
uv run playwright mcp.browser.remoteEndpoint, with isolated contexts, an output dir, an idle timeout and an allowed-origins guard.connect()API from the same pinned wheel for workstation scripts, so client and scripts share one pin.Lacks:
--max-clientsslot behaviour are feat(k8s): run a pinned Playwright browser server in namespace devops #5356, a separate service this client only talks to.kubectl port-forward(and write a per-user config) to reach the remote endpoint, with no fallback URL.@playwright/mcpnpm package (0.0.85) is rejected by the issue because it pulls playwright-core 1.66.0-alpha and answers HTTP 428 against the 1.65 server.Tools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at 666a03f while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.