Mcp Apps 2 : Introducing MCP Apps to A2UI Agent#815
Conversation
f683412 to
bd3d34c
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces the MCP Apps proxy agent to A2UI, enabling the display of external web applications within the A2UI client via an iframe. Key changes include the implementation of a bypass_tool_check mechanism in the A2uiPartConverter to optimize token usage and reduce LLM hallucination for large A2UI JSON payloads. New Angular components are added to handle the rendering of these MCP Apps in a sandboxed iframe. The changes are well-structured and introduce significant new functionality. However, there are some areas related to security and completeness that warrant attention to ensure robustness and maintainability.
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
Show resolved
Hide resolved
| ) | ||
|
|
||
| # TODO: Load examples from files. | ||
| examples = "" |
There was a problem hiding this comment.
The examples variable is currently an empty string with a TODO: Load examples from files. This indicates that the example loading functionality is not yet implemented. While not critical for basic operation, providing examples is important for the LLM's performance and understanding of how to use the A2UI components effectively.
bd3d34c to
4a028dd
Compare
dmandar
left a comment
There was a problem hiding this comment.
How are we testing this on the client? We can pull out the MCP apps custom component from my PR into a shared component that all samples use.
agent_sdks/python/src/a2ui/adk/a2a_extension/send_a2ui_to_client_toolset.py
Show resolved
Hide resolved
bd931cd to
d6793ff
Compare
4a028dd to
cb064e6
Compare
ac1b930 to
83764f8
Compare
83764f8 to
ff422da
Compare
Description
This PR introduces a new Python agent,
mcp_app_proxy, designed to act as a bridge (or "relay") between an A2UI client and an external Model Context Protocol (MCP) server that serves a Calculator web app (ref: #791).When a user asks for a calculator, the agent intelligently understands the intent, fetches the MCP Apps from the MCP server, and dynamically streams it back to the frontend using A2UI's declarative JSON structure.
In this A2UI Json, the MCP App's rawHTML is embedded as
contentfor the A2UI MCP App Component (ref: #801). To improve data integrity, the rawHTML goes through URL encoding. This reduces data loss risk when HTML content full of new line and special characters are embedded in JSON and handled by LLMs.The PR also introduce a
bypass_tool_checkargument to the sharedA2uiPartConverterallowing agents to circumvent the need for passing the A2UI JSON message through thesend_a2ui_json_to_clienttool call. This is critical for Agents that need to return a large A2UI JSON because every Tool call results in the JSON blob to be recorded as chat-history and runs the risk of LLM hallucination compromising the data structure. By bypassing the tool call, A2UI agents can avoid bloating the context from repeated JSON entries, wasting tokens, and take more responsibility for its own reliability.Attached image illustrates the architecture of how the MCP App Proxy A2A Agent handles MCP Apps into A2UI Dataparts.
Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.