Skip to content

Mcp Apps 2 : Introducing MCP Apps to A2UI Agent#815

Merged
sugoi-yuzuru merged 3 commits intomainfrom
mcp_2_mcp_relay_agent
Mar 16, 2026
Merged

Mcp Apps 2 : Introducing MCP Apps to A2UI Agent#815
sugoi-yuzuru merged 3 commits intomainfrom
mcp_2_mcp_relay_agent

Conversation

@sugoi-yuzuru
Copy link
Collaborator

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

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 content for 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_check argument to the shared A2uiPartConverter allowing agents to circumvent the need for passing the A2UI JSON message through the send_a2ui_json_to_client tool 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.

Generated Image March 11, 2026 - 12_03PM

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

Copy link
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 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.

)

# TODO: Load examples from files.
examples = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

@sugoi-yuzuru sugoi-yuzuru force-pushed the mcp_2_mcp_relay_agent branch from bd3d34c to 4a028dd Compare March 11, 2026 16:30
@sugoi-yuzuru sugoi-yuzuru changed the base branch from main to mcp_1_sample_agent March 11, 2026 16:33
Copy link
Collaborator

@dmandar dmandar left a comment

Choose a reason for hiding this comment

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

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.

@sugoi-yuzuru sugoi-yuzuru force-pushed the mcp_2_mcp_relay_agent branch from 4a028dd to cb064e6 Compare March 12, 2026 18:12
@sugoi-yuzuru sugoi-yuzuru requested review from dmandar and jgindin March 12, 2026 18:12
Base automatically changed from mcp_1_sample_agent to main March 13, 2026 17:32
@sugoi-yuzuru sugoi-yuzuru force-pushed the mcp_2_mcp_relay_agent branch from ac1b930 to 83764f8 Compare March 13, 2026 17:43
@sugoi-yuzuru sugoi-yuzuru force-pushed the mcp_2_mcp_relay_agent branch from 83764f8 to ff422da Compare March 14, 2026 22:17
@sugoi-yuzuru sugoi-yuzuru merged commit f904ded into main Mar 16, 2026
12 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in A2UI Mar 16, 2026
@sugoi-yuzuru sugoi-yuzuru deleted the mcp_2_mcp_relay_agent branch March 16, 2026 14:08
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.

4 participants