@mcp-b/webmcp-ts-sdk 1.0.2-beta.1 → 1.0.2-beta.2
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 +45 -5
- package/package.json +23 -8
package/README.md
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
# @mcp-b/webmcp-ts-sdk
|
|
2
2
|
|
|
3
|
-
> Browser-adapted
|
|
3
|
+
> Browser-adapted MCP TypeScript SDK - Dynamic tool registration for AI agents like Claude, ChatGPT, and Gemini
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@mcp-b/webmcp-ts-sdk)
|
|
6
|
+
[](https://www.npmjs.com/package/@mcp-b/webmcp-ts-sdk)
|
|
6
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
[](https://www.typescriptlang.org/)
|
|
9
|
+
[](https://github.com/WebMCP-org/npm-packages)
|
|
10
|
+
|
|
11
|
+
📖 **[Full Documentation](https://docs.mcp-b.ai/packages/webmcp-ts-sdk)** | 🚀 **[Quick Start](https://docs.mcp-b.ai/quickstart)**
|
|
12
|
+
|
|
13
|
+
**@mcp-b/webmcp-ts-sdk** adapts the official MCP TypeScript SDK for browser environments, enabling dynamic tool registration required by the W3C Web Model Context API. This allows AI agents like Claude, ChatGPT, Gemini, Cursor, and Copilot to interact with browser-based applications.
|
|
14
|
+
|
|
15
|
+
## Why Use @mcp-b/webmcp-ts-sdk?
|
|
16
|
+
|
|
17
|
+
| Feature | Benefit |
|
|
18
|
+
|---------|---------|
|
|
19
|
+
| **Dynamic Tool Registration** | Register tools after transport connection - required for browser apps |
|
|
20
|
+
| **Minimal Overhead** | Only ~50 lines of custom code on top of official SDK |
|
|
21
|
+
| **Full SDK Compatibility** | Re-exports all types, classes, and utilities from official SDK |
|
|
22
|
+
| **Type-Safe** | No prototype hacks - clean TypeScript extension |
|
|
23
|
+
| **Auto-Updates** | Types and protocol follow official SDK automatically |
|
|
7
24
|
|
|
8
25
|
## Overview
|
|
9
26
|
|
|
10
|
-
This package adapts the official [@modelcontextprotocol/sdk](https://www.npmjs.com/package/@modelcontextprotocol/sdk) for browser environments with modifications to support dynamic tool registration required by the [W3C Web Model Context API](https://github.com/
|
|
27
|
+
This package adapts the official [@modelcontextprotocol/sdk](https://www.npmjs.com/package/@modelcontextprotocol/sdk) for browser environments with modifications to support dynamic tool registration required by the [W3C Web Model Context API](https://github.com/nicolo-ribaudo/model-context-protocol-api) (`window.navigator.modelContext`).
|
|
11
28
|
|
|
12
29
|
## Why This Package Exists
|
|
13
30
|
|
|
@@ -158,17 +175,39 @@ When the official SDK updates:
|
|
|
158
175
|
|
|
159
176
|
The modification is minimal and unlikely to conflict with upstream changes.
|
|
160
177
|
|
|
178
|
+
## Frequently Asked Questions
|
|
179
|
+
|
|
180
|
+
### Why can't I use the official SDK directly?
|
|
181
|
+
|
|
182
|
+
The official SDK throws an error if you try to register tools after connecting a transport. Browsers need dynamic registration because tools arrive asynchronously as the page loads.
|
|
183
|
+
|
|
184
|
+
### Is this a fork of the official SDK?
|
|
185
|
+
|
|
186
|
+
No - it's a thin adapter (~50 lines) that extends the official SDK. All types, protocol handling, and validation come from the upstream package.
|
|
187
|
+
|
|
188
|
+
### Will this break when the official SDK updates?
|
|
189
|
+
|
|
190
|
+
Unlikely. The modification is minimal and isolated. When upstream updates, just update your dependencies - the wrapper adapts automatically.
|
|
191
|
+
|
|
192
|
+
### When should I use this vs `@mcp-b/global`?
|
|
193
|
+
|
|
194
|
+
Use `@mcp-b/global` for the standard `navigator.modelContext` API. Use this package directly only if you need low-level control over the MCP server.
|
|
195
|
+
|
|
161
196
|
## Related Packages
|
|
162
197
|
|
|
163
|
-
- [`@mcp-b/global`](
|
|
164
|
-
- [`@mcp-b/transports`](
|
|
198
|
+
- [`@mcp-b/global`](https://docs.mcp-b.ai/packages/global) - W3C Web Model Context API polyfill (uses this package internally)
|
|
199
|
+
- [`@mcp-b/transports`](https://docs.mcp-b.ai/packages/transports) - Browser-specific MCP transports
|
|
200
|
+
- [`@mcp-b/react-webmcp`](https://docs.mcp-b.ai/packages/react-webmcp) - React hooks for MCP
|
|
201
|
+
- [`@mcp-b/chrome-devtools-mcp`](https://docs.mcp-b.ai/packages/chrome-devtools-mcp) - Connect desktop AI agents to browser tools
|
|
165
202
|
- [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk) - Official MCP SDK
|
|
166
203
|
|
|
167
204
|
## Resources
|
|
168
205
|
|
|
169
|
-
- [
|
|
206
|
+
- [WebMCP Documentation](https://docs.mcp-b.ai)
|
|
207
|
+
- [Web Model Context API Explainer](https://github.com/nicolo-ribaudo/model-context-protocol-api)
|
|
170
208
|
- [Model Context Protocol Spec](https://modelcontextprotocol.io/)
|
|
171
209
|
- [Official MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
210
|
+
- [MCP GitHub Repository](https://github.com/modelcontextprotocol)
|
|
172
211
|
|
|
173
212
|
## License
|
|
174
213
|
|
|
@@ -178,3 +217,4 @@ MIT - see [LICENSE](../../LICENSE) for details
|
|
|
178
217
|
|
|
179
218
|
- [GitHub Issues](https://github.com/WebMCP-org/npm-packages/issues)
|
|
180
219
|
- [Documentation](https://docs.mcp-b.ai)
|
|
220
|
+
- [Discord Community](https://discord.gg/a9fBR6Bw)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/webmcp-ts-sdk",
|
|
3
|
-
"version": "1.0.2-beta.
|
|
4
|
-
"description": "TypeScript SDK
|
|
3
|
+
"version": "1.0.2-beta.2",
|
|
4
|
+
"description": "Browser-adapted MCP TypeScript SDK - Dynamic tool registration for W3C Web Model Context API and AI agent integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
7
7
|
"model-context-protocol",
|
|
@@ -10,17 +10,32 @@
|
|
|
10
10
|
"sdk",
|
|
11
11
|
"adapter",
|
|
12
12
|
"web-model-context",
|
|
13
|
-
"navigator
|
|
14
|
-
"w3c"
|
|
13
|
+
"navigator-modelcontext",
|
|
14
|
+
"w3c",
|
|
15
|
+
"ai-agents",
|
|
16
|
+
"llm",
|
|
17
|
+
"claude",
|
|
18
|
+
"chatgpt",
|
|
19
|
+
"openai",
|
|
20
|
+
"anthropic",
|
|
21
|
+
"cursor",
|
|
22
|
+
"copilot",
|
|
23
|
+
"gemini",
|
|
24
|
+
"webmcp",
|
|
25
|
+
"dynamic-tools",
|
|
26
|
+
"mcp-server",
|
|
27
|
+
"mcp-client",
|
|
28
|
+
"tool-registration",
|
|
29
|
+
"ai-integration"
|
|
15
30
|
],
|
|
16
|
-
"homepage": "https://
|
|
31
|
+
"homepage": "https://docs.mcp-b.ai/packages/webmcp-ts-sdk",
|
|
17
32
|
"bugs": {
|
|
18
|
-
"url": "https://github.com/
|
|
33
|
+
"url": "https://github.com/WebMCP-org/npm-packages/issues"
|
|
19
34
|
},
|
|
20
35
|
"repository": {
|
|
21
36
|
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/
|
|
23
|
-
"directory": "
|
|
37
|
+
"url": "git+https://github.com/WebMCP-org/npm-packages.git",
|
|
38
|
+
"directory": "webmcp-ts-sdk"
|
|
24
39
|
},
|
|
25
40
|
"license": "MIT",
|
|
26
41
|
"author": "Alex Nahas",
|