chat: fix SecurityError with cross-origin MCP App iframes and enable by default - #289453
Merged
Conversation
…by default - Change event.source.origin check to event.origin to avoid SecurityError when accessing cross-origin frames in patched postMessage handlers - Enable MCP Apps UI by default (mcpAppsEnabledConfig changed from false to true) since the feature is now stable and ready for general use Fixes #289386 (Commit message generated by Copilot)
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes cross-origin SecurityError in MCP App message handling and turns MCP Apps UI on by default.
Changes:
- Update the patched
messageevent listener wrapper to useevent.origininstead of readingevent.source.origin(avoids cross-origin access errors). - Change
chat.mcp.apps.enableddefault fromfalsetotrue.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.ts |
Avoids SecurityError by switching origin checks to event.origin in the injected postMessage/event-listener shim. |
src/vs/workbench/contrib/chat/browser/chat.contribution.ts |
Enables MCP Apps UI by default via configuration default change. |
Daniel Imms (Tyriar)
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when accessing cross-origin frames in patched postMessage handlers
to true) since the feature is now stable and ready for general use
Fixes #289386
(Commit message generated by Copilot)