Tracks Chrome 152–154 WebMCP changes: execution AbortSignals, the
document.modelContext consumer API, and the removal of
navigator.modelContextTesting from native Chrome.
Added
- Handlers receive an execution
AbortSignal. Handlers are now called as
handler(args, { signal }); on Chrome 153.0.8007.0+ the signal aborts when the agent or
user cancels the call — pass it tofetch()and other cancellable work. On Chrome ≤152
(and for bareexecute(args)calls) the library substitutes a never-aborting signal, so
the second argument is always safe to use. The hook'sexecute(input?, { signal }?)
accepts a caller signal too. Existing one-argument handlers keep working unchanged. - Polyfill consumer API.
document.modelContext.getTools()and
executeTool(tool, inputArguments, { signal }?), matching native Chrome:
RegisteredTool.inputSchemais a deep-copied object (Chrome 154.0.8014.0+ shape),
inputArgumentsmay be a JSON string or an object, execution failures reject with
UnknownError, aborts reject with the signal's reason, and unregistering a tool no
longer cancels in-flight executions (Chrome 153.0.8008.0+ behavior). The polyfill
additionally validates input againstinputSchema(OperationError) — native Chrome
does not validate yet. - New exported types:
ToolExecuteCallbackOptions,ExecuteToolOptions,
RegisteredTool,ModelContextGetToolOptions.
Changed
- Abort is cancellation, not error. When an execution's signal aborts and the handler
rejects, the hook clearsisExecutingbut leavesstate.erroruntouched and does not
fireonError. - The testing shim's abort rejections now use the signal's abort reason and its tool
failures reject withUnknownError(Chrome 152+ parity); itsOperationErrorinput
errors andNotFoundErrorare unchanged.
Deprecated
navigator.modelContextTesting. Native Chrome removed it in 152.0.7940.0. The
polyfill's shim now delegates to the same engine asdocument.modelContext.executeTool()
and warns once in dev. It will be removed in webmcp-react 2.0.0.
Extension
- The bridge extension now discovers and executes tools via
document.modelContext.getTools()/executeTool()(native Chrome 150.0.7861.0+ and the
webmcp-react 1.1.0 polyfill), falling back to the deprecated
navigator.modelContextTestingfor pages on webmcp-react ≤1.0.0. Native Chrome removed
modelContextTestingin 152.0.7940.0, which had left the extension unable to see tools
on native Chrome. - MCP client cancellations (
notifications/cancelled) are forwarded end-to-end: MCP SDK →
WebSocketCANCEL_TOOL→ background → content scripts →executeTool'sAbortSignal,
aborting the tool handler's execution signal. - Ships as
webmcp-server0.2.0 (the bin is regenerated) and bridge extension 0.2.0.