Skip to content

feat(mcp-app-sample): Add new simple MCP App sample#1133

Open
dmandar wants to merge 7 commits intomainfrom
clean-mcp-app-sample
Open

feat(mcp-app-sample): Add new simple MCP App sample#1133
dmandar wants to merge 7 commits intomainfrom
clean-mcp-app-sample

Conversation

@dmandar
Copy link
Copy Markdown
Collaborator

@dmandar dmandar commented Apr 10, 2026

Description:

This PR introduces a new sample application demonstrating how to integrate a secure MCP (Model Context Protocol) App within the A2UI environment. It provides a complete, minimal reference implementation covering both the agent-side logic and the client-side UI components.

Key Features:
Native Module Resolution: Uses an <script type="importmap"> inside the sandboxed iframe to resolve the @modelcontextprotocol/sdk at runtime, avoiding complex bundler workarounds.
Specification Alignment: Implements the recommended "Double-Iframe" security model (Host -> Proxy -> Guest) and uses allow-same-origin as specified by the community guidelines.
Documentation: Includes a detailed README.md covering architecture, setup steps, and security considerations for production deployment.
Files Added/Modified:
samples/agent/adk/mcp-app-sample/: New directory containing the Python agent server (agent.py) and instructions.
samples/client/lit/mcp-app-sample/: New directory containing the Lit-based client UI, custom component wrapper, and optimized Vite configuration.
Verification:
Verified that the client successfully renders the injected HTML content.
Verified that clicking the button inside the sandboxed iframe successfully triggers the expected JSON-RPC tool call to the agent.

Pre-launch Checklist

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

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 adds a standalone sample for integrating Model Context Protocol (MCP) Apps into the A2UI environment, featuring a FastAPI agent and a Lit-based client. The implementation uses a double-sandboxed iframe architecture for security. Feedback focuses on resolving local environment dependencies in the agent's HTML, fixing a memory leak from an unremoved global message listener, and removing redundant component registration. Additionally, improvements were suggested for server response error handling and aligning Python version requirements between the project configuration and documentation.

@dmandar dmandar requested review from sugoi-yuzuru and wrenj April 10, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant