Skip to content

fix(mcp): forward browser-level CDP commands in extension mode#40706

Merged
yury-s merged 1 commit intomicrosoft:mainfrom
yury-s:fix-40687
May 7, 2026
Merged

fix(mcp): forward browser-level CDP commands in extension mode#40706
yury-s merged 1 commit intomicrosoft:mainfrom
yury-s:fix-40687

Conversation

@yury-s
Copy link
Copy Markdown
Member

@yury-s yury-s commented May 7, 2026

Summary

  • v2 relay rejected browser-level CDP commands (Storage., Browser.) because they carry no sessionId. Route them through any attached tab's chrome.debugger session — the command is browser-scoped, so any tab works.
  • This unblocks cookie-list, cookie-set, state-save, etc. in extension mode.

Fixes #40687

In MCP extension mode (protocol v2), browser-level CDP commands like
Storage.getCookies / Storage.setCookie carry no sessionId — they are
routed by browserContextId — and the relay rejected them outright with
"Unsupported command without sessionId". Route them through any attached
tab's chrome.debugger session instead; the result is browser-scoped, so
any tab works.

Fixes microsoft#40687
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Test results for "MCP"

7 failed
❌ [chrome] › mcp/headed.spec.ts:24 › mcpHeadless: false › browser @mcp-macos-latest-chrome
❌ [chrome] › mcp/annotate.spec.ts:57 › should capture multiple screenshots in one annotation @mcp-windows-latest-chrome
❌ [chrome] › mcp/annotate.spec.ts:110 › should abort annotation when last screenshot is removed @mcp-windows-latest-chrome
❌ [firefox] › mcp/tracing.spec.ts:54 › check that trace is saved with browser_start_tracing (no output dir) @mcp-windows-latest-firefox
❌ [msedge] › mcp/annotate.spec.ts:57 › should capture multiple screenshots in one annotation @mcp-windows-latest-msedge
❌ [msedge] › mcp/annotate.spec.ts:110 › should abort annotation when last screenshot is removed @mcp-windows-latest-msedge
❌ [msedge] › mcp/test-run.spec.ts:126 › test_run should stop when aborted @mcp-windows-latest-msedge

7011 passed, 1068 skipped


Merge workflow run.

@yury-s yury-s merged commit 4b00518 into microsoft:main May 7, 2026
14 of 18 checks passed
@yury-s yury-s deleted the fix-40687 branch May 7, 2026 16:25
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.

[Bug]: cli-client extension mode rejects all browser-level CDP commands (cookie-list, state-save) with "Unsupported command without sessionId"

2 participants