refactor: migrate sandbox iframe to a shared directory and update bui…#967
refactor: migrate sandbox iframe to a shared directory and update bui…#967sugoi-yuzuru merged 1 commit intomainfrom
Conversation
…ld configuration to support centralized serving
There was a problem hiding this comment.
Code Review
This pull request refactors the sandbox iframe configuration and serving mechanism for A2UI applications. It centralizes sandbox path definitions into a new shared-constants.ts file, updates mcp-apps-component.ts to use these constants, and significantly modifies vite.config.ts. The vite.config.ts changes include updating Rollup entry points and introducing a new serve-sandbox Vite plugin with custom middleware for URL rewriting to correctly serve the sandbox iframe. A README.md is also added to document the shared sandbox iframe. The review feedback suggests adding unit or integration tests for the new serve-sandbox Vite plugin's custom middleware, citing the repository's guideline that code changes should have tests, to ensure its robustness and prevent future issues with sandbox URL resolution.
wrenj
left a comment
There was a problem hiding this comment.
this is great thanks for putting it together
left comments mostly around branding this as the mcp_apps_iframe, not some sandbox thing we made up. lgtm
| @@ -0,0 +1,28 @@ | |||
| # Shared Sandbox iframe | |||
|
|
|||
| This directory contains the unified and reusable **Sandbox iframe** implementation for **A2UI applications** (Angular, Lit) to run **untrusted third-party Model Context Protocol (MCP) applications**. | |||
There was a problem hiding this comment.
can we call this mcp-apps-iframe
I think the branding is important
| * limitations under the License. | ||
| */ | ||
|
|
||
| export const SANDBOX_BASE_PATH = "shared/sandbox_iframe/"; |
There was a problem hiding this comment.
MCP_APPS_IFRAME_BASE_PATH
MCP_APPS_IFRAME_ENTRY_NAME
MCP_APPS_IFRAME_IFRAME_PATH
| @@ -49,6 +49,6 @@ | |||
| </style> | |||
There was a problem hiding this comment.
where is the shared mcp_apps_iframe_component.json going to go? in here?
…ld configuration to support centralized serving
Description
This PR moves the double-iframe sandbox implementation out of the Lit contact sample and into a new shared directory (
samples/client/shared/sandbox_iframe/). This allows both Lit and Angular samples to reuse the same secure underlying implementation to render third-party MCP applications.Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.