Extension + examples: migrate to document.modelContext, forward cancellation end to end - #55
Merged
kashishhora merged 9 commits intoSep 3, 2026
Conversation
kashishhora
force-pushed
the
feat/extension-modelcontext-and-cancellation
branch
from
September 3, 2026 19:06
f6b059c to
e527008
Compare
kashishhora
force-pushed
the
feat/extension-modelcontext-and-cancellation
branch
from
September 3, 2026 20:44
e527008 to
0af3f1a
Compare
…unregister semantics
…, verified Chrome build - tool-registry: the 30 s call timeout now sends CANCEL_TOOL before resolving, so the page stops executing and the background's pending entry is released instead of lingering until a late result arrives. - content-main: the 10 s discovery give-up falls through to the 1 s identity watch rather than stopping, so a provider that mounts late (code-split route, slow network) is still discovered. Exactly one watch is created on either branch. - content-main: document why the TypeError retry cannot double-execute a tool. - CHANGELOG / spec §4: cite the verified build for the native consumer API (150.0.7861.0+); spec §4 now describes the presence-poll + identity-watch loop the bridge actually runs, and §5 records native-Chrome verification as a merge requirement. - Regenerated the tracked webmcp-server bin.
kashishhora
force-pushed
the
feat/extension-modelcontext-and-cancellation
branch
from
September 3, 2026 20:45
0af3f1a to
03cbff4
Compare
naji247
approved these changes
Sep 3, 2026
2 tasks
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.
Summary
Stacked on #54. Moves the bridge extension and the examples off
navigator.modelContextTesting(removed in Chrome 152.0.7940.0) and forwards MCP client cancellation all the way to the tool handler. Base is the 1.1.0 branch; GitHub will retarget tomainonce that merges.extension/src/content-main.ts— a small adapter overdocument.modelContext.getTools()/executeTool()(native Chrome or the 1.1.0 polyfill), falling back tomodelContextTestingfor pages still on webmcp-react <=1.0.0. It re-detects the page object by identity: webmcp-react installs a freshmodelContextwhenever its provider remounts, so a held reference would go stale.inputSchemais normalized to a JSON string on the wire whether Chrome hands back a string (<=153) or an object (154+).notifications/cancelled→ SDKextra.signal→ WebSocketCANCEL_TOOL→ background → content scripts →executeTool(tool, args, { signal }). The 30s call timeout now sendsCANCEL_TOOLtoo. Late results for a cancelled call are dropped at both the background and the server.packages/webmcp-server/binregenerated so the published server carries the cancel path.examples/native-harness— the self-test drivesgetTools()/executeTool()and adds probes for string-vs-objectinputSchema, the execution signal, a mid-flight abort, and unregister-during-execution.examples/playground— DevPanel on the consumer API with a Cancel button, plus aslow_hinttool to try it on.Test plan
pnpm typecheck:extension/pnpm build:extension— the committed bin rebuilds byte-identicalslow_hintmid-flight against the polyfill — the result row shows the abort, other tools keep working