WebMCP Chrome 150: Fix the navigator.modelContext Deprecation Chrome 150 deprecates navigator.modelContext in favor of document.modelContext for WebMCP tool registration, a one-line change that developers must adopt before the @mcp-b/webmcp-polyfill removes the Navigator alias in its next major release. The W3C Web ML Community Group moved the spec in May 2026 to scope tools to the page rather than the browser session, and Cloudflare's WebMCP developer preview now injects a bridge script that registers tools with document.modelContext automatically. Chrome 150 shipped this week, and if you are already using WebMCP, you have probably already seen this in your console: navigator.modelContext is deprecated. Use document.modelContext instead. The fix is one line. The reason it changed is worth understanding — and the polyfill clock is ticking. What Changed in Chrome 150 Chrome 150 deprecates navigator.modelContext and moves WebMCP’s primary API to document.modelContext . The old location stays as a backward-compatible alias for now, so nothing breaks immediately — but you get the console warning on every page load, and the @mcp-b/webmcp-polyfill https://www.npmjs.com/package/@mcp-b/webmcp-polyfill has announced it is removing the Navigator alias in its next major release. The migration itself is one line: // Before — works in Chrome 150 but logs a deprecation warning await navigator.modelContext.registerTool { ... } ; // After — canonical form in Chrome 150+ await document.modelContext.registerTool { ... } ; If you need to support both old and new while the ecosystem catches up, use the safe feature-detection pattern: js const modelContext = document.modelContext ?? navigator.modelContext; if modelContext { await modelContext.registerTool { ... } ; } Why Chrome Moved the API This was not an arbitrary rename. The W3C Web ML Community Group https://webmachinelearning.github.io/webmcp/ moved the spec in May 2026, and the rationale is sound: tools registered with WebMCP belong to a specific page, not the browser session. navigator is browser-global — navigator.language , navigator.userAgent , navigator.clipboard are all context-free. document is scoped to the current page, which is the correct container for tools that live and die with a given page load. It is the kind of spec decision that seems minor until you think about it, and then it is obviously correct. An agent tool that calls your checkout function should not be reachable from a different tab’s context. document enforces that boundary at the browser level. Two Ways to Register Tools Both Updated WebMCP supports two implementation paths. Both now use document.modelContext . Imperative API JavaScript Register tools programmatically with a name, description, JSON Schema for inputs, and an execute function: await document.modelContext.registerTool { name: 'search catalog', description: 'Search the product catalog by keyword', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term' } }, required: 'query' }, execute: async { query } = { const results = await fetchProducts query ; return results; } } ; For sensitive tools, add security hints: readOnlyHint: true for non-mutating operations, untrustedContentHint: true for tools that handle user-supplied data. Cross-origin iframes need the allow="tools" Permissions Policy header to access the parent page’s tools. Declarative API HTML If your agent interactions map to standard HTML forms, annotate them instead of writing registration code: