Mcp Apps 1 : Introducing McpApps A2UI Component#801
Conversation
d3a7e57 to
8d73f8a
Compare
There was a problem hiding this comment.
Code Review
This PR introduces a new McpApps A2UI component for sandboxing web applications using a double iframe approach. However, the current implementation has several critical security flaws that undermine this isolation. Specifically, the sandbox iframe lacks origin validation for incoming messages, and the sandbox configuration for both the outer and inner iframes includes allow-same-origin, which allows untrusted content to potentially access the main application's DOM if they share the same origin. These issues could lead to Cross-Site Scripting (XSS) and sandbox escape. Additionally, there's a minor point about code brittleness due to bypassing type safety.
samples/client/angular/projects/orchestrator/public/sandbox_iframe/sandbox.ts
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/public/sandbox_iframe/sandbox.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Outdated
Show resolved
Hide resolved
|
Can we fix the Gemini code review comments first? |
ecc5226 to
773c1ac
Compare
773c1ac to
436b804
Compare
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/public/sandbox_iframe/sandbox.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/public/sandbox_iframe/sandbox.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/public/sandbox_iframe/sandbox.ts
Outdated
Show resolved
Hide resolved
jonsharkey
left a comment
There was a problem hiding this comment.
Overall LGTM, but I don't feel like I'm an expert enough in MCP or Angular to really know. I'll watch the other reviews come in too.
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/public/sandbox_iframe/sandbox.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/public/sandbox_iframe/sandbox.ts
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/src/a2ui-catalog/mcp-app.ts
Outdated
Show resolved
Hide resolved
samples/client/angular/projects/orchestrator/public/sandbox_iframe/README.md
Show resolved
Hide resolved
Squashed commits: - feat: Add MCP Calculator app & McpApp rendering component - chore: Update the package.json in the Angular client samples
…for setup, and ensure sandbox attribute is always present.
…box iframe using an effect.
bd931cd to
d6793ff
Compare
…t for default allowed features.
Description
This PR introduces an Angular A2UI Component named
McpApps. McpApps component leverages the McpApps API to create a double-layered iframe (iframe sandboxing) and inserts a HTML bundle (HTML/JS/CSS) passed into the component as an A2UI data input field into the inner-iframe to load arbitrary web-application into an A2UI component.The idea is that A2UI Agent can load an MCP Application resource from an external MCP server and simply relay that application as a
contentof an McpApp A2UI Component.The McpApp A2UI Component will take care of the double-layered iframing and the MCP Application's message-based communications to its host application and server. Attached is an overview of what this PR achieves.
In forthcoming changes, this McpApp A2UI component will integrate with the
OrchestratorAgent sample and will be loading theCalculatorMCP Application that was introduced in #791Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.