Skip to content

feat(mcp): default codegen language from PW_LANG_NAME - #42150

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
Skn0tt:skn0tt-mcp-codegen-client-language
Aug 6, 2026
Merged

feat(mcp): default codegen language from PW_LANG_NAME#42150
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
Skn0tt:skn0tt-mcp-codegen-client-language

Conversation

@Skn0tt

Copy link
Copy Markdown
Contributor

Language ports already set PW_LANG_NAME when they spawn the driver (python / java / csharp). MCP codegen now defaults from that, so playwright mcp under playwright-python emits Python without needing --codegen=python.

Also wires PLAYWRIGHT_MCP_CODEGEN through configFromEnv, which the flag docs already advertised.

Language ports already set PW_LANG_NAME when spawning the driver, so
MCP can pick python/java/csharp codegen without an explicit --codegen.

Also wire PLAYWRIGHT_MCP_CODEGEN through configFromEnv.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b66268bd-baf7-4b5b-9a0c-8ac2a0350447
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/cli-core.spec.ts:140 › uncheck @mcp-windows-latest-firefox

8062 passed, 1284 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a look at the failing CI.

🟢 The one failure is a pre-existing flake — this PR looks clear

[firefox] › mcp/cli-core.spec.ts:140 › uncheck (mcp-windows-latest-firefox) is unrelated to this change. The PR only adjusts the default codegen language (config.ts, program.ts), which the uncheck CLI flow never touches, and the test has a track record of flaking on SHAs this PR can't be responsible for.

Details

Overall: one failed test in the merged report, no real failures traced back to the diff. This PR defaults MCP codegen from PW_LANG_NAME and wires PLAYWRIGHT_MCP_CODEGEN through configFromEnv — it doesn't alter check/uncheck behavior. On CI PW_LANG_NAME is unset, so the default stays typescript and behavior is unchanged.

Pre-existing flake / infra

  • [firefox] › mcp/cli-core.spec.ts:140 › uncheck — pre-existing flake. In the test-results DB this test's final verdict flips across runs on firefox: failed 2 of 1722 runs, passed the other 1720, including on unrelated work — PR test(websocket): cover setExtraHTTPHeaders and locale on the handshake request #42037 (sha dc298405) and a July 30 main push (sha 30d5b2ec). Scoped to the mcp-windows-latest-firefox bot it's 2 red in 413 runs. It also flaked once on msedge (1/460). None of those SHAs involve this PR, and the diff doesn't reach the CLI uncheck path.

Triaged by the Playwright bot - agent run

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 75dbf17 into microsoft:main Aug 6, 2026
17 of 18 checks passed
Yury Semikhatsky (yury-s) added a commit to microsoft/playwright-mcp that referenced this pull request Sep 1, 2026
## What's New

### New Tools

- **`browser_start_recording` / `browser_stop_recording`** (opt-in via
`--caps=devtools`) — Record actions that the user performs manually in
the browser and return them as Playwright code. Useful when the user
wants to demonstrate a flow instead of describing it
([#42359](microsoft/playwright#42359))

## Bug Fixes

- The default `--codegen` language is inferred from the environment
([#42150](microsoft/playwright#42150))
- Honor `--user-data-dir` in extension mode
([#42190](microsoft/playwright#42190))
- Do not treat orphaned browser preferences entries as an installed
extension ([#42224](microsoft/playwright#42224))
- `browser_take_screenshot` returns the original screenshot bytes
instead of silently downscaling them to model-specific limits
([#42406](microsoft/playwright#42406))
- Drop the cached browser backend after `browser_close` with a shared
browser context, so subsequent tool calls from the same client no longer
fail ([#42365](microsoft/playwright#42365))
- When connected to a remote endpoint, `browserInfo` reports the browser
actually running remotely instead of the configured one
([#42228](microsoft/playwright#42228))
- Do not clobber the `chromiumSandbox` setting from the config file
([#42288](microsoft/playwright#42288))
- Do not run the heartbeat for HTTP clients that have not opened an
event stream
([#42189](microsoft/playwright#42189))
- The internal `/killkillkill` endpoint is no longer registered outside
of tests ([#42133](microsoft/playwright#42133))
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.

2 participants