Skip to content

feat: WebMCP document.modelContext migration and annotation type improvements - #78

Merged
anteprimorac merged 3 commits into
masterfrom
feature/webmcp
May 28, 2026
Merged

feat: WebMCP document.modelContext migration and annotation type improvements#78
anteprimorac merged 3 commits into
masterfrom
feature/webmcp

Conversation

@JosipVojkovicAgilo

@JosipVojkovicAgilo JosipVojkovicAgilo commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Migrate WebMCP to use document.modelContext as the primary context source
with navigator.modelContext as a fallback, following the Chrome 150 deprecation.
Also improves type safety around tool annotations.

  • Add untrustedContentHint support to WebMCP tool annotations
  • Use document.modelContext with navigator fallback for Chrome 150+ compatibility
  • Extract WebMCPToolAnnotations type to avoid annotation shape drift

@medusajs

medusajs Bot commented Apr 24, 2026

Copy link
Copy Markdown
Name Backend Status Storefront Status Preview Link Last Updated
agilo-dtc-starter ✅ Ready - Admin / - Thu, 28 May 2026 10:11:33 GMT

Copilot AI 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.

Pull request overview

Adds support for the untrustedContentHint WebMCP tool annotation across the storefront’s WebMCP tooling, allowing tools to declare that their outputs may include untrusted content.

Changes:

  • Extend WebMCPTool (and tool registration typing) to include annotations.untrustedContentHint.
  • Set untrustedContentHint: true on several existing tools (cart manage, product search, checkout/navigation, promotions).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
storefront/src/lib/webmcp/types.ts Extends the core WebMCPTool annotations type with untrustedContentHint.
storefront/src/lib/webmcp/tools/promotion.ts Marks promotion apply/remove tools with untrustedContentHint: true.
storefront/src/lib/webmcp/tools/products-search.ts Marks product search tool with untrustedContentHint: true.
storefront/src/lib/webmcp/tools/checkout.ts Marks navigation-to-product and checkout-prepare tools with untrustedContentHint: true.
storefront/src/lib/webmcp/tools/cart.ts Adds annotations to cart management tool including untrustedContentHint: true.
storefront/src/lib/webmcp/register-tools.ts Updates registration typings to accept untrustedContentHint in annotations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread storefront/src/lib/webmcp/register-tools.ts Outdated
@JosipVojkovicAgilo JosipVojkovicAgilo changed the title feat: add untrustedContentHint support to WebMCP tool annotations feat: WebMCP document.modelContext migration and annotation type improvements May 28, 2026
@anteprimorac
anteprimorac merged commit 3d700d5 into master May 28, 2026
3 checks passed
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.

3 participants