Choose the right surface
WebMCP is not an MCP transport, MCP Apps extension, discovery server, or embedding mechanism. The hosted MCP server and MCP Apps can work without a WorldMonitor tab. WebMCP instead describes the live frontend and lets the browser agent use that frontend in place.
Availability
Production origin trial
WorldMonitor enrolls the top-level/, /dashboard, and /dashboard.html routes on these exact production origins:
https://www.worldmonitor.apphttps://tech.worldmonitor.apphttps://finance.worldmonitor.apphttps://commodity.worldmonitor.apphttps://happy.worldmonitor.apphttps://energy.worldmonitor.app
/?mode=agent is a separate machine-readable JSON surface and is not a WebMCP route. Preview deployments and documentation routes are not enrolled.
Origin-trial tokens are time-limited. Release checks must verify the deployed response header rather than assume that a token committed earlier is still accepted.
Local development
Use Chrome 149 or newer:- Open
chrome://flags/#enable-webmcp-testing. - Set WebMCP for testing to Enabled.
- Relaunch Chrome completely.
- Start WorldMonitor locally. Open
/dashboardfor the eight-tool dashboard, not/embed. To inspect the static two-tool homepage, first runnpm run build:pro, then open/pro/welcome.html. The local Vite route/loads the dashboard SPA; only production rewrites/to the welcome page. - Confirm feature detection in DevTools:
Browsers without the current API, including the Tauri desktop webview when it does not expose WebMCP, safely do nothing. WorldMonitor does not install a browser polyfill and does not fall back to an older draft API.
Tool inventory
Tools are page- and state-specific. The runtime source of truth isawait document.modelContext.getTools(), not a cached list from an earlier page.
Homepage tools
The statichttps://www.worldmonitor.app/ welcome page registers two imperative tools before the dashboard SPA loads:
Dashboard imperative tools
Every dashboard variant registers the same eight imperative tools. Registration is stable across sign-in and entitlement changes; each invocation rechecks the live state.search_dashboard returns concise descriptors rather than raw hidden dashboard state. Its opaque result keys are one-use, expire after two minutes, are bounded to the most recent 64 entries, and are invalidated when relevant runtime, authentication, entitlement, variant, or widget access changes. A stale or invalid key is denied instead of being treated as a URL or command.
Declarative procurement tool
The Global Procurement panel can expose one declarative WebMCP tool:
The form’s exact description is “Search official global procurement opportunities using visible filters.” It uses
toolautosubmit and the same controls a person sees. Invocation makes the form visibly active, applies the filters through the normal request path, and resolves with a bounded summary of matches, availability, coverage, applied filters, and source status—not tender descriptions or hidden submission data. Reset or cancellation aborts the request and restores the visible form state. See Global Procurement Intelligence for the data contract.
Human control and UI behavior
- Imperative tools register synchronously at startup, but wait for the necessary UI or map renderer before acting. Destroying the app aborts pending work and unregisters its tools; same-document reinitialization does not create duplicates.
- Actions go through the same UI, agent-bus, panel, and map paths used by human controls. They do not call a privileged backend shortcut.
- Authentication, subscription entitlement, dashboard variant, mounted-panel availability, layer policy, and renderer readiness are evaluated at invocation time. A tool discovered while signed in cannot retain access after sign-out or downgrade.
- Successful mutations remain visible: panels open, the search palette appears, map state changes, and the declarative procurement form shows active/pending state.
- Denied, invalid, skipped, unavailable, and expired operations return bounded outcomes or safe errors. They do not silently bypass a lock or invent a result.
- The person can continue using the page. Existing reset, close, navigation, and cancellation controls remain authoritative.
Security and privacy
WorldMonitor follows the browser’s origin-isolated, same-origin model:- Production dashboard responses use
Origin-Agent-Cluster: ?1and aPermissions-Policycontainingtools=(self). - WorldMonitor does not grant WebMCP access to another origin with
fromOrigins,exposedTo, or an iframeallow="tools"delegation. /embedand/embed.htmlexplicitly sendtools=(). An embedded WorldMonitor panel must expose no WebMCP tools, even when its parent page has WebMCP access.- WebMCP uses the person’s existing browser session. It does not accept a new API key through tool arguments or weaken panel and data entitlements.
- Dashboard search results are treated as untrusted content and are revalidated before selection.
- Dashboard operational telemetry is bounded:
webmcp-registeredrecordstoolCount,pageSurface, and the API bucket;webmcp-registration-failedrecords the tool and a stable reason;webmcp-tool-invokedrecords the tool, outcome, and terminal reason. Dashboard search may additionally record query length, result count, and allowlisted result-type buckets. These WebMCP-specific custom properties must not include arguments, search text, result keys, returned content, URLs, tender content, or user identity. The events still use WorldMonitor’s normal Umami page and session envelope, which includes page context and may be associated with the signed-in dashboard identity; the restricted path omits automatic content-attribution properties, not normal analytics session metadata.
Debug with the browser API
Use the current API ondocument. The older navigator.modelContext surface is deprecated in Chrome 150, and the removed provideContext draft API is not supported.
getTools() returns the tools authorized for the current page in alphabetical order. In current Chrome builds, a returned descriptor’s inputSchema is a JSON string:
chrome://flags/#enable-webmcp-testing and chrome://flags/#devtools-webmcp-support.
Release smoke checklist
Test the exact commit that will ship. Record its 40-character Git SHA and use that same checkout for the local proof:Local, same SHA
WM_WEBMCP_DEPLOYED_SHA makes the local evidence artifact record that SHA; the suite does not independently prove a deployment-to-SHA mapping. It launches Chrome with the WebMCP testing feature and exercises that clean checkout. In addition to the automated proof, use getTools() or the Inspector to verify each dashboard variant and the visible/hidden procurement states when the release changes those surfaces. If the release changes the homepage, run npm run build:pro before verifying /pro/welcome.html.
Production, same SHA
First verify in the deployment control plane that the target URL is serving the intended SHA. The runner recordsWM_WEBMCP_DEPLOYED_SHA in its evidence but cannot independently derive or prove the URL-to-SHA mapping.
Run the opt-in headed production suite without the local testing flag so it exercises the real origin trial:
Origin-Trial, Origin-Agent-Cluster, and Permissions-Policy headers; the inventory and schemas; a free context call; a denied unavailable-panel call; and cancellation, then writes JSON evidence artifacts. Preserve those artifacts with the release evidence. Its guard intentionally accepts only the canonical https://www.worldmonitor.app target. On other enrolled origins, verify headers and use getTools() or the Inspector to check inventory and behavior manually unless a separate smoke target has been reviewed and added.
Also verify /embed and /embed.html return tools=(), and that /?mode=agent, preview deployments, docs, and embed pages do not gain the top-level inventory. Treat the deployment control-plane SHA check, headers, inventory, UI behavior, and terminal outcomes as separate assertions; a successful deploy or registration log alone is not acceptance.
Compatibility and removal policy
WorldMonitor targets the currentdocument.modelContext.registerTool() API and feature-detects it. It does not ship navigator.modelContext, provideContext, or a draft compatibility shim.
If a future browser transition requires a temporary fallback, the change must:
- Name the exact browser/API gap and keep the current API as the preferred path.
- Preserve same-origin policy, visible UI behavior, auth/entitlement checks, bounded outputs, privacy rules, and cancellation.
- Have contract tests for both native and fallback paths plus an explicit removal owner and Chrome milestone or production verification condition.
- Be removed once the supported current API is verified in production; a fallback must never become an undocumented permanent API.
