Skip to content

feat(mcp): add --cdp-timeout CLI option for CDP connection timeout#39120

Merged
Skn0tt merged 1 commit intomicrosoft:mainfrom
ditingdapeng:feat/mcp-cdp-timeout-cli
Feb 4, 2026
Merged

feat(mcp): add --cdp-timeout CLI option for CDP connection timeout#39120
Skn0tt merged 1 commit intomicrosoft:mainfrom
ditingdapeng:feat/mcp-cdp-timeout-cli

Conversation

@ditingdapeng
Copy link
Contributor

This PR adds the --cdp-timeout CLI option to complement the browser.cdpTimeout config file option added in #38746.

Changes

  • Added --cdp-timeout CLI option in program.ts
  • Added cdpTimeout to CLIOptions type in config.ts
  • Added mapping from CLI option to config in configFromCLIOptions()
  • Added PLAYWRIGHT_MCP_CDP_TIMEOUT environment variable support

Usage

npx @playwright/mcp --cdp-endpoint ws://... --cdp-timeout 120000

or via environment variable:

PLAYWRIGHT_MCP_CDP_TIMEOUT=120000 npx @playwright/mcp --cdp-endpoint ws://...

Related

This PR adds the --cdp-timeout CLI option to complement the browser.cdpTimeout
config file option added in microsoft#38746.

Changes:
- Added --cdp-timeout <timeout> CLI option in program.ts
- Added cdpTimeout to CLIOptions type in config.ts
- Added mapping from CLI option to config in configFromCLIOptions()
- Added PLAYWRIGHT_MCP_CDP_TIMEOUT environment variable support

Usage:
npx @playwright/mcp --cdp-endpoint ws://... --cdp-timeout 120000

Related:
- Implements CLI portion of microsoft#38741
@ditingdapeng
Copy link
Contributor Author

@microsoft-github-policy-service agree

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Test results for "MCP"

11 failed
❌ [firefox] › mcp/core.spec.ts:45 › browser_navigate allows about:, data: and javascript: protocols @mcp-ubuntu-latest
❌ [chrome] › mcp/autowait.spec.ts:19 › racy navigation destroys context @mcp-windows-latest
❌ [chrome] › mcp/console.spec.ts:205 › console log file is created on snapshot @mcp-windows-latest
❌ [chromium] › mcp/console.spec.ts:205 › console log file is created on snapshot @mcp-windows-latest
❌ [firefox] › mcp/console.spec.ts:205 › console log file is created on snapshot @mcp-windows-latest
❌ [firefox] › mcp/core.spec.ts:45 › browser_navigate allows about:, data: and javascript: protocols @mcp-windows-latest
❌ [webkit] › mcp/console.spec.ts:205 › console log file is created on snapshot @mcp-windows-latest
❌ [msedge] › mcp/cli-session.spec.ts:126 › config should work @mcp-windows-latest
❌ [msedge] › mcp/cli-storage.spec.ts:100 › state-save and state-load roundtrip @mcp-windows-latest
❌ [msedge] › mcp/console.spec.ts:205 › console log file is created on snapshot @mcp-windows-latest
❌ [firefox] › mcp/core.spec.ts:45 › browser_navigate allows about:, data: and javascript: protocols @mcp-macos-15

1 flaky ⚠️ [chrome] › mcp/cdp.spec.ts:24 › cdp server `@mcp-windows-latest`

4601 passed, 145 skipped


Merge workflow run.

@ditingdapeng
Copy link
Contributor Author

@Skn0tt ohoh, The failing tests don't seem to reference cdpTimeout, they're likely unrelated to my changes. happy to investigate further if needed!

@Skn0tt
Copy link
Member

Skn0tt commented Feb 4, 2026

No worries, those failing tests are known fellons.

@Skn0tt Skn0tt merged commit c04cd01 into microsoft:main Feb 4, 2026
3 of 6 checks passed
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