feat(webmcp): register the WebMCP tool catalog on form load - #1985
Open
rismehta wants to merge 1 commit into
Open
feat(webmcp): register the WebMCP tool catalog on form load#1985rismehta wants to merge 1 commit into
rismehta wants to merge 1 commit into
Conversation
Expose each rendered form's WebMCP tool catalog to in-browser AI agents by calling registerFormWebMCP(model) from @aemforms/af-webmcp at the form-container bootstrap seam (Utils.setupFormContainer, after fields init). No-ops unless the form opted in via fd:webMcpEnabled and a browser modelContext is available, so default behaviour is unchanged. Adds @aemforms/af-webmcp as a dependency and to the jest ESM allowlist. Requires the @aemforms/af-core / @aemforms/af-webmcp release that ships the WebMCP catalog (buildFormTools + the form.webMcpEnabled getter); until it publishes, CI install of af-webmcp will fail. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Exposes each rendered form's WebMCP tool catalog to in-browser AI agents (Gemini-in-Chrome, ChatGPT Site tools, etc.) so they can drive the form through a declared tool catalog instead of scraping the DOM.
A single call at the form-container bootstrap seam (
Utils.setupFormContainer, right after fields are initialised) hands the af-core model to the adapter:Opt-in and safe by default
fd:webMcpEnabled(read by af-core'sform.webMcpEnabled). Absent → nothing registers.modelContextis available (SSR/unsupported browser).Changes
ui.frontend/src/utils.js— importregisterFormWebMCPand call it once per form load.ui.frontend/package.json— add@aemforms/af-webmcp.ui.frontend/jest.config.js— allow@aemforms/af-webmcpthrough the ESM transform.ui.frontend/__tests__/webmcp.test.js— asserts the catalog is registered once with the form model.Dependency / release note
Requires the
@aemforms/af-core+@aemforms/af-webmcprelease that ships the WebMCP catalog (buildFormTools+ theform.webMcpEnabledgetter). Until it publishes, CI install ofaf-webmcpwill fail — this is expected and clears with that release.Design doc
Adaptive Forms Runtime via WebMCP (wiki)
🤖 Generated with Claude Code