Repository navigation
feat(embed): add @a2ui/embed/mcp/express for host-authored Express - #4504
Draft
josemontespg wants to merge 1 commit into
Draft
josemontespg wants to merge 1 commit into
josemontespg wants to merge 1 commit into
Conversation
josemontespg
force-pushed
the
embed/6-express
branch
from
December 1, 2026 23:39
17c8081 to
9519372
Compare
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the @a2ui/embed/mcp/express module, enabling MCP servers to allow host models to author A2UI Express directly. It adds tools for retrieving the Express guide (get_a2ui_guide) and compiling/rendering the Express DSL (render_a2ui). The review feedback identifies a high-severity issue in register_express_tools.ts where the surfaceId passed to resolveDataRef can be incorrect if it is overridden inside the Express DSL but omitted in the tool arguments. To resolve this, it is recommended to compile the Express DSL first to extract the actual resolved surfaceId before invoking resolveDataRef.
15 tasks
josemontespg
force-pushed
the
embed/6-express
branch
from
December 2, 2026 20:07
9519372 to
510ceb5
Compare
josemontespg
force-pushed
the
embed/6-express
branch
2 times, most recently
from
December 2, 2026 21:28
31672d5 to
d2464a4
Compare
josemontespg
force-pushed
the
embed/6-express
branch
from
December 3, 2026 00:51
d2464a4 to
c8c4b91
Compare
6 of 8 tasks
josemontespg
force-pushed
the
embed/6-express
branch
from
December 3, 2026 18:34
c8c4b91 to
a9c074f
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
Adds an optional
@a2ui/embed/mcp/expressentry point so an MCP server can let the host model author A2UI Express directly without running a server-side LLM.registerExpressTools(app, options)registers two tools on top ofcreateA2uiApp: a plain-text guide tool (get_a2ui_guide) that documents the app's catalogs, examples, and registered actions, and an MCP App render tool (render_a2ui) that compiles Express into validated v1.0 A2UI messages insidestructuredContent.a2ui. It supports standalone rendering kits viaallowSubmit: true, backend-connected servers via authoritativeresolveDataRefmerging (witheditableKeysand component guards), and pre-validation post-processing viatransformMessages(such as server-side image hydration under strict CSP).Changes
typescript/embed/src/mcp/express/register_express_tools.ts: ImplementregisterExpressToolswith optionalallowSubmit,resolveDataRef,transformMessages,examples, and custom tool naming/summary hooks.typescript/embed/src/mcp/express/compile_express.ts: Compile Express to v1.0 messages, strip accidental code fences or<a2ui>wrappers, enablesendDataModelby default, and merge authoritativedataRefslices while respectingeditableKeys.typescript/embed/src/mcp/express/load_catalogs.ts: Load@a2ui/agentcatalogs froma2ui-app.catalog.json, normalizing flattened@-prefixed protocol mixins back toallOf$refs soInMemoryCatalogProviderloadsbasicCatalog+ custom catalogs losslessly.typescript/embed/src/mcp/server/{app_internals.ts,create_a2ui_app.ts}: AssociateMcpServerand loadedCatalogSchemaFilewith anA2uiAppinstance via a package-internalWeakMap.typescript/embed/src/mcp/express/register_express_tools.test.ts: Add unit tests covering multi-catalog Express compilation,allowSubmit,dataRefauthoritative override +editableKeys+ component guards, error diagnostics,transformMessages+ post-transform validation, and catalog subsetting.typescript/embed/{package.json,CHANGELOG.md}&yarn.lock: Export./mcp/express, add@a2ui/agentas an optional peer dependency, and record the unreleased changelog entry.Verification
yarn --cwd embed build,yarn --cwd embed test(Node, Karma, and Playwright E2E),yarn --cwd embed test:types,yarn --cwd embed lint, andyarn --cwd embed format:checkall pass locally.