@mcp-b/react-webmcp 4.0.0-beta.20260702180822 → 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 +8 -5
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
| Feature | Benefit |
|
|
18
18
|
| ---------------------------- | ---------------------------------------------------------------------------- |
|
|
19
19
|
| **React-First Design** | Hooks follow React patterns with automatic cleanup and StrictMode support |
|
|
20
|
-
| **Type-Safe with Zod** | Full TypeScript support with
|
|
20
|
+
| **Type-Safe with Zod** | Full TypeScript support with input validation and output typing |
|
|
21
21
|
| **Two-Way Integration** | Both expose tools TO AI agents AND consume tools FROM MCP servers |
|
|
22
22
|
| **Execution State Tracking** | Built-in loading, success, and error states for UI feedback |
|
|
23
23
|
| **Works with Any AI** | Compatible with Claude, ChatGPT, Gemini, Cursor, Copilot, and any MCP client |
|
|
@@ -36,14 +36,17 @@ For client functionality, you'll also need:
|
|
|
36
36
|
pnpm add @mcp-b/transports @modelcontextprotocol/sdk
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
**Prerequisites:** Provider hooks require the `document.modelContext` API. Install `@mcp-b/global` or use a browser that implements the
|
|
39
|
+
**Prerequisites:** Provider hooks require the `document.modelContext` API. Install `@mcp-b/global` or use a browser that implements the WebMCP API.
|
|
40
40
|
|
|
41
41
|
Provider hooks register tools with `document.modelContext.registerTool(tool, {
|
|
42
42
|
signal })` and abort the controller on unmount. The hooks retain a
|
|
43
43
|
`navigator.modelContext` fallback for older preview runtimes, but
|
|
44
|
-
`document.modelContext` is the canonical
|
|
44
|
+
`document.modelContext` is the canonical surface. Install `@mcp-b/global`
|
|
45
45
|
when you need a portable runtime with spec-aligned cleanup behavior.
|
|
46
46
|
|
|
47
|
+
`outputSchema` is MCP-B helper metadata for output typing and structured MCP
|
|
48
|
+
responses. Native Chrome WebMCP does not currently define or enforce it.
|
|
49
|
+
|
|
47
50
|
## Quick Start - Provider (Registering Tools)
|
|
48
51
|
|
|
49
52
|
```tsx
|
|
@@ -134,7 +137,7 @@ function ToolConsumer() {
|
|
|
134
137
|
|
|
135
138
|
## Zod Version Compatibility
|
|
136
139
|
|
|
137
|
-
This package supports **Zod 3.25
|
|
140
|
+
This package supports **Zod `^3.25 || ^4.0`** as an optional peer dependency.
|
|
138
141
|
|
|
139
142
|
## Documentation
|
|
140
143
|
|
|
@@ -144,7 +147,7 @@ For full API reference, output schemas, memoization patterns, migration guide, b
|
|
|
144
147
|
|
|
145
148
|
- [`@mcp-b/global`](https://docs.mcp-b.ai/packages/global/reference) - Full MCP-B browser runtime (required for provider hooks)
|
|
146
149
|
- [`@mcp-b/transports`](https://docs.mcp-b.ai/packages/transports/reference) - Browser-specific MCP transports
|
|
147
|
-
- [
|
|
150
|
+
- [`chrome-devtools-mcp`](https://github.com/ChromeDevTools/chrome-devtools-mcp) - Upstream Chrome DevTools MCP server
|
|
148
151
|
- [`usewebmcp`](../usewebmcp) - React hooks for strict core WebMCP API only
|
|
149
152
|
|
|
150
153
|
## Resources
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/react-webmcp",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "React hooks for Model Context Protocol (MCP) - expose React components as AI tools for Claude, ChatGPT, Cursor, and Copilot with Zod validation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
62
|
-
"@mcp-b/
|
|
63
|
-
"@mcp-b/
|
|
64
|
-
"@mcp-b/webmcp-
|
|
65
|
-
"@mcp-b/
|
|
66
|
-
"@mcp-b/webmcp-
|
|
62
|
+
"@mcp-b/global": "4.0.0",
|
|
63
|
+
"@mcp-b/webmcp-polyfill": "4.0.0",
|
|
64
|
+
"@mcp-b/webmcp-types": "4.0.0",
|
|
65
|
+
"@mcp-b/transports": "4.0.0",
|
|
66
|
+
"@mcp-b/webmcp-ts-sdk": "4.0.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/node": "22.17.2",
|