Skip to content

docs(mcp): drop allow-same-origin from the iframe example - #110

Open
asasemahmed wants to merge 1 commit into
CopilotKit:mainfrom
asasemahmed:docs/mcp-iframe-sandbox
Open

asasemahmed wants to merge 1 commit into
CopilotKit:mainfrom
asasemahmed:docs/mcp-iframe-sandbox

Conversation

@asasemahmed

Copy link
Copy Markdown

The assemble_document example in the MCP README suggests rendering the result with sandbox="allow-scripts allow-same-origin". A srcdoc iframe inherits the embedding page's origin, so with both flags generated scripts can reach parent.document and the host's localStorage, and can even remove their own sandbox. The web app already avoids this; see #3 and the sandbox notes in CLAUDE.md.

The bridge only uses postMessage(..., "*"), so allow-scripts alone is enough. The example now uses it, with a short note on why.

This branch has not been deployed

No deployments
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.

1 participant