Repository navigation
feat(embed): add the @a2ui/embed/mcp iframe runtime - #4299
Draft
josemontespg wants to merge 1 commit into
Draft
josemontespg wants to merge 1 commit into
josemontespg wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the MCP App runtime (@a2ui/embed/mcp) and the startEmbedApp function, enabling A2UI rendering inside an MCP Apps host iframe with support for host themes, model context synchronization, and action queue management. The feedback highlights three key issues: a race condition in TaskQueue.run that could bypass the concurrency limit, a dependency mismatch where zod/v4/core is imported but Zod v3 is declared in package.json, and a promise chaining issue in ready initialization that fails to catch errors thrown during host context application.
josemontespg
force-pushed
the
embed/3-view
branch
from
November 18, 2026 21:17
1d74c72 to
c7eb7f5
Compare
josemontespg
force-pushed
the
embed/3-view
branch
from
November 18, 2026 21:25
c7eb7f5 to
ae1f51f
Compare
josemontespg
force-pushed
the
embed/3-view
branch
from
November 18, 2026 22:12
ae1f51f to
25e87ae
Compare
Draft
josemontespg
force-pushed
the
embed/3-view
branch
from
November 20, 2026 21:12
25e87ae to
414160b
Compare
josemontespg
force-pushed
the
embed/3-view
branch
3 times, most recently
from
November 21, 2026 00:25
84be05d to
f701e4d
Compare
josemontespg
force-pushed
the
embed/3-view
branch
3 times, most recently
from
November 23, 2026 22:09
0de864d to
ec3de12
Compare
josemontespg
force-pushed
the
embed/3-view
branch
2 times, most recently
from
November 26, 2026 01:24
c775807 to
a7c511f
Compare
josemontespg
force-pushed
the
embed/3-view
branch
from
December 2, 2026 20:07
a7c511f to
6559b81
Compare
josemontespg
force-pushed
the
embed/3-view
branch
from
December 2, 2026 21:07
6559b81 to
42f1e55
Compare
josemontespg
force-pushed
the
embed/3-view
branch
from
December 2, 2026 21:28
42f1e55 to
3a60b00
Compare
josemontespg
force-pushed
the
embed/3-view
branch
from
December 3, 2026 18:34
3a60b00 to
e45a731
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem: Rendering A2UI v1.0 payloads inside a sandboxed MCP Apps host iframe requires atomic batch validation, ordered
a2ui_actionrouting, debouncedui/update-model-contextsynchronization, host theme and size adaptation (including top-layer modals), and zero CSP violations underdefault-src 'none'.This PR adds
startEmbedAppin@a2ui/embed/mcp. It connects to the host with@modelcontextprotocol/ext-apps, renders validated batches with@a2ui/lit, routes actions and follow-ups, sharessendDataModelchanges withinmaxBytes, keeps open modals visible inside resized frames, and runs Zod in jitless mode.Changes
src/mcp/start_embed_app.ts,surface_session.ts,embed_view.ts, andaction_queue.ts: host connection, atomic batch rendering, and ordered action dispatch.src/mcp/model_context.ts: debounced and byte-cappedui/update-model-contextupdates forsendDataModelsurfaces.src/mcp/dialog_height.ts,theme.ts, andzod_jitless.ts: modal height tracking (measuring.a2ui-modal-contentinside top-layer<dialog open>), host theme mapping, and CSP-safe Zod setup.tests/,README.md, andCHANGELOG.md:AppBridgetest host, fixture app, and Karma tests under the default MCP Apps CSP.Verification
WIREIT_CACHE=none yarn workspace @a2ui/embed test: 158 Node tests and 29 Karma tests pass with zero CSP violations.yarn workspace @a2ui/embed lint,yarn workspace @a2ui/embed format:check, and./scripts/fix_licenses.py --checkpass.