Skip to content

refactor: migrate sandbox iframe to a shared directory and update bui…#967

Merged
sugoi-yuzuru merged 1 commit intomainfrom
move_sandbox
Mar 25, 2026
Merged

refactor: migrate sandbox iframe to a shared directory and update bui…#967
sugoi-yuzuru merged 1 commit intomainfrom
move_sandbox

Conversation

@sugoi-yuzuru
Copy link
Copy Markdown
Collaborator

@sugoi-yuzuru sugoi-yuzuru commented Mar 24, 2026

…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.

…ld configuration to support centralized serving
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sugoi-yuzuru sugoi-yuzuru enabled auto-merge (squash) March 24, 2026 21:56
Copy link
Copy Markdown
Collaborator

@wrenj wrenj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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**.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MCP_APPS_IFRAME_BASE_PATH
MCP_APPS_IFRAME_ENTRY_NAME
MCP_APPS_IFRAME_IFRAME_PATH

@@ -49,6 +49,6 @@
</style>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mcp_apps_iframe.ts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mcp_apps_iframe.ts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is the shared mcp_apps_iframe_component.json going to go? in here?

@sugoi-yuzuru sugoi-yuzuru merged commit 4126a53 into main Mar 25, 2026
10 checks passed
@sugoi-yuzuru sugoi-yuzuru deleted the move_sandbox branch March 25, 2026 12:58
@github-project-automation github-project-automation bot moved this from Todo to Done in A2UI Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants