Repository navigation
feat(embed): add the @a2ui/embed/mcp/server entry point - #4298
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 @a2ui/embed/mcp/server module, which enables serving an A2UI application from a Model Context Protocol (MCP) server. Key additions include the createA2uiApp API for registering app resources, tools, actions, and follow-ups, alongside the A2uiValidator class for validating A2UI messages against specification and catalog schemas using Ajv. Comprehensive unit tests have been added for the validator, app creation, schema error formatting, and follow-up template interpolation. Since there are no review comments, I have no feedback to provide.
josemontespg
force-pushed
the
embed/2-server
branch
from
November 18, 2026 21:17
f92dabd to
72e9690
Compare
josemontespg
force-pushed
the
embed/2-server
branch
from
November 18, 2026 21:25
72e9690 to
5e3fa61
Compare
josemontespg
force-pushed
the
embed/2-server
branch
2 times, most recently
from
November 20, 2026 21:36
30617f1 to
53ebf67
Compare
josemontespg
force-pushed
the
embed/2-server
branch
3 times, most recently
from
November 26, 2026 01:03
8c7dfc1 to
bf4e6a7
Compare
josemontespg
force-pushed
the
embed/2-server
branch
2 times, most recently
from
December 2, 2026 20:07
5f0ebab to
0009304
Compare
josemontespg
force-pushed
the
embed/2-server
branch
2 times, most recently
from
December 2, 2026 21:28
26bc0b2 to
d435f75
Compare
josemontespg
force-pushed
the
embed/2-server
branch
from
December 3, 2026 18:34
d435f75 to
0d5c516
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: Serving A2UI v1.0 surfaces from an MCP Apps server requires wiring
ui://resources,_meta.uitool metadata, an app-only action dispatcher, templated follow-ups, action prompt contracts, and specification plus catalog validation by hand.This PR adds
@a2ui/embed/mcp/server.createA2uiAppregisters theui://app resource, links tools registered throughapp.toolto that resource, routes user interactions through the app-onlya2ui_actiontool (app.actionandapp.followUp), summarizes registered actions for model prompts withapp.describeActions(), and validates outgoing messages against A2UI v1.0 and the app's catalogs (app.validate).Changes
src/mcp/server/create_a2ui_app.ts:createA2uiApp,app.tool,app.action,app.followUp(including optionaldescription),app.describeActions(), andapp.validate.src/mcp/server/describe_actions.ts: deterministic Markdown action and follow-up contract formatting across Zod v3 and Zod v4 argument shapes.src/mcp/server/follow_up_template.ts: follow-up message interpolation with control-character stripping, truncation, and JSON quoting.src/mcp/server/a2ui_validator.ts,describe_schema_errors.ts, andload_catalog_schema_file.ts: Ajv validation (including cross-catalog@callfunction validation) and readable property-level errors.package.json,README.md, andCHANGELOG.md: export@a2ui/embed/mcp/serverand declare@modelcontextprotocol/sdkas a peer dependency.Verification
yarn --cwd embed test: 161 Node tests and type checks pass.yarn --cwd embed lint,yarn --cwd embed format:check, and./scripts/fix_licenses.py --checkpass.