usewebmcp 4.0.0-beta.20260702175639 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ export function CounterTool() {
|
|
|
101
101
|
## How `useWebMCP` Works
|
|
102
102
|
|
|
103
103
|
- Registers a tool on mount with `document.modelContext.registerTool(tool, { signal })` and aborts the controller on unmount.
|
|
104
|
-
-
|
|
104
|
+
- Older Chrome preview builds may not remove tools when the controller aborts. Install `@mcp-b/global` or `@mcp-b/webmcp-polyfill` when you need consistent cleanup across preview versions.
|
|
105
105
|
- Exposes local execution state:
|
|
106
106
|
- `state.isExecuting`
|
|
107
107
|
- `state.lastResult`
|
|
@@ -154,7 +154,7 @@ useWebMCP({
|
|
|
154
154
|
|
|
155
155
|
### Output inference
|
|
156
156
|
|
|
157
|
-
When `outputSchema` is provided as a literal JSON
|
|
157
|
+
When `outputSchema` is provided as a literal JSON Schema:
|
|
158
158
|
|
|
159
159
|
- implementation return type is inferred from `outputSchema`
|
|
160
160
|
- `state.lastResult` is inferred to the same type
|
|
@@ -212,9 +212,9 @@ function SearchToolPanel() {
|
|
|
212
212
|
|
|
213
213
|
## Output Schema Contract
|
|
214
214
|
|
|
215
|
-
If `outputSchema` is defined, your tool implementation must return a JSON-serializable
|
|
215
|
+
If `outputSchema` is defined, your tool implementation must return a JSON-serializable value that matches that schema for MCP-B helpers that consume it. Object, array, string, number, boolean, and null schemas are supported for type inference and hook result shaping.
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
Native Chrome WebMCP does not currently define or enforce `outputSchema`; the browser standard tool dictionary defines `inputSchema`.
|
|
218
218
|
|
|
219
219
|
## Re-Registration and Performance
|
|
220
220
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "usewebmcp",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Standalone React hooks for strict core WebMCP tool registration with document.modelContext",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"registry": "https://registry.npmjs.org/"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@mcp-b/webmcp-
|
|
45
|
-
"@mcp-b/webmcp-
|
|
44
|
+
"@mcp-b/webmcp-polyfill": "4.0.0",
|
|
45
|
+
"@mcp-b/webmcp-types": "4.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "22.17.2",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"vite-plus": "^0.1.22",
|
|
56
56
|
"vitest": "npm:@voidzero-dev/vite-plus-test@latest",
|
|
57
57
|
"vitest-browser-react": "^2.0.4",
|
|
58
|
-
"@mcp-b/global": "4.0.0
|
|
58
|
+
"@mcp-b/global": "4.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
|