Skip to content

[MCP] feat(catalog-mcp): build tooling, configureMcpCatalog, the v1.0 entry point and the samples on it - #3186

Draft
josemontespg wants to merge 1 commit into
mainfrom
catalogs-mcp-config
Draft

josemontespg wants to merge 1 commit into
mainfrom
catalogs-mcp-config

Conversation

@josemontespg

@josemontespg josemontespg commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Prepares @a2ui/catalog-mcp for the v1 MCP catalog: the build and test tooling the package needs from here on, configureMcpCatalog, the single host entry point that replaces createMcpCatalogFunctions, and the two community MCP sample clients moved to it. The McpApp component and mcpCatalog follow in #2799; this PR carries the host-side half of the MCP Apps flow (onMcpAppResource, ui:// resource extraction) so that callMcpTool is complete when the component lands.

The entry point now targets A2UI v1.0. CallMcpToolImplementation ships pre-constructed and reads the host configuration when it runs, so there is no processor-before-catalog ordering; a host registers it under MCP_CATALOG_ID and calls configureMcpCatalog({getMcpClientForTool, processor, sandbox?}) once.

Changes

  • package.json, karma.conf.cjs, tsconfig.test.json, eslint.config.mjs, .gitignore, scripts/build-sandbox.mjs, scripts/build-test-fixtures.mjs: wireit build (copy of the v1 catalog.json and of typescript/catalogs/shared/, esbuild bundle of the sandbox proxy into dist/sandbox/), Karma browser tests next to the Node tests, publication metadata. scripts/copy-catalog.js is gone; the fixtures script is a no-op until [MCP] Add the McpApp universal component and mcpCatalog to @a2ui/catalog-mcp #2799 adds tests/fixtures/apps/.
  • src/mcp_catalog_config.ts: configureMcpCatalog (MCP client resolver, processor, defaultVersion, onMcpAppResource, sandbox location).
  • src/functions/callMcpTool.ts: bound to the host configuration; extracts ui:// MCP App resources (text/html;profile=mcp-app) into McpAppResourcePayload; arguments also accepts a function call that returns the arguments object.
  • src/catalog.ts, src/index.ts: MCP_CATALOG_ID for catalogs/mcp/v1/catalog.json; the entry point exports MCP_CATALOG_ID, CallMcpToolImplementation, configureMcpCatalog and their types.
  • README.md, CHANGELOG.md: setup, configureMcpCatalog, sandbox asset.
  • samples/community/mcp/a2ui-over-mcp-{filesystem,recipe}/client: register CallMcpToolImplementation (the filesystem sample next to its own data functions) and configure the host with configureMcpCatalog; resolve @a2ui/catalog-mcp, @a2ui/lit and @a2ui/web_core from the monorepo dist/ instead of compiling the catalog from source against the npm packages (TODO Clean up folder samples/community. #1698). .github/workflows/community_code.yml builds those packages at the repository root first.

Verification

  • yarn workspace @a2ui/catalog-mcp test: 82 Node tests, 141 Karma tests (shared sandbox).
  • yarn test in both sample clients against a fresh @a2ui/catalog-mcp build (64 and 11 tests).
  • ./scripts/fix_format.sh --check, python3 scripts/fix_licenses.py --check.

Related to #3157

@github-project-automation github-project-automation Bot moved this to Todo in A2UI Oct 13, 2026
@josemontespg
josemontespg added this pull request to stack #3188 October 13, 2026 22:06

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 updates the A2UI MCP catalog to target protocol v1.0, refactoring the serialization API by introducing Catalog.fromJson, Catalog.toJson, and Catalog.validationSchema to replace deprecated methods. It removes five data transformation functions to the filesystem sample, refactors callMcpTool to support MCP App resource extraction, and introduces a shared double-iframe sandbox proxy to isolate untrusted web content. The review feedback suggests normalizing MIME types in isMcpAppMimeType to handle spacing variations and replacing a deprecated Catalog.fromSchema call with Catalog.fromJson in the test suite.

Comment thread typescript/catalogs/mcp/src/functions/callMcpTool.ts
Comment thread typescript/catalogs/mcp/src/functions/callMcpTool.test.ts Outdated
@josemontespg
josemontespg removed this pull request from stack #3188 October 13, 2026 22:11
@josemontespg
josemontespg added this pull request to stack #3189 October 13, 2026 22:12
@josemontespg josemontespg changed the title [MCP] feat(catalog-mcp): build tooling, configureMcpCatalog and the v1.0 entry point [MCP] feat(catalog-mcp): build tooling, configureMcpCatalog, the v1.0 entry point and the samples on it Oct 13, 2026
Comment thread typescript/catalogs/mcp/CHANGELOG.md Outdated
@josemontespg
josemontespg removed this pull request from stack #3189 October 14, 2026 18:28
@josemontespg
josemontespg added this pull request to stack #3212 October 14, 2026 18:28
Base automatically changed from catalogs-shared-sandbox to main October 14, 2026 19:00
@josemontespg
josemontespg removed this pull request from stack #3212 October 14, 2026 19:02
@josemontespg
josemontespg added this pull request to stack #3215 October 14, 2026 19:02
Comment thread typescript/catalogs/mcp/src/functions/callMcpTool.test.ts Outdated
Comment thread typescript/catalogs/mcp/src/mcp_catalog_config.ts Outdated
Comment thread typescript/catalogs/mcp/src/functions/callMcpTool.ts Outdated
@josemontespg
josemontespg removed this pull request from stack #3215 October 15, 2026 00:09
@josemontespg
josemontespg added this pull request to stack #3227 October 15, 2026 00:10
…try point

Prepare @a2ui/catalog-mcp for the v1 MCP catalog: wireit build (copy of the
v1 catalog.json and of the shared sandbox sources, esbuild bundle of the
sandbox proxy), Karma browser tests next to the Node tests, and the package
metadata for publication.

The entry point targets A2UI v1.0. configureMcpCatalog replaces
createMcpCatalogFunctions as the single host entry point (MCP client resolver,
message processor, default message version, onMcpAppResource and sandbox
location); CallMcpToolImplementation ships pre-constructed and reads that
configuration when it runs. callMcpTool extracts ui:// MCP App resources into
McpAppResourcePayload and accepts a function call as its arguments.

The two community MCP sample clients follow: they register
CallMcpToolImplementation and configure the host with configureMcpCatalog, and
resolve @a2ui/catalog-mcp, @a2ui/lit and @a2ui/web_core from the monorepo
dist/ instead of compiling the catalog from source; the community CI workflow
builds those packages at the repository root first (TODO #1698).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant