@ai-sdk/mcp 2.0.69 → 2.0.71
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/CHANGELOG.md +16 -0
- package/README.md +23 -0
- package/dist/index.d.ts +665 -348
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +368 -5
- package/dist/index.js.map +1 -1
- package/dist/mcp-stdio/index.js +1 -0
- package/dist/mcp-stdio/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +24 -0
- package/src/tool/mcp-client.ts +62 -4
- package/src/tool/mcp-event-signature.ts +79 -0
- package/src/tool/mcp-event-types.ts +151 -0
- package/src/tool/mcp-event-webhook.ts +238 -0
- package/src/tool/mcp-events-adapter.ts +82 -0
- package/src/tool/mcp-events.ts +219 -0
- package/src/tool/oauth.ts +14 -1
- package/src/tool/types.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/mcp
|
|
2
2
|
|
|
3
|
+
## 2.0.71
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [9184a35]
|
|
8
|
+
- @ai-sdk/provider@4.0.25
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.57
|
|
10
|
+
|
|
11
|
+
## 2.0.70
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 6315a3d: Add experimental managed MCP Events adapters for backend-owned subscription lifecycles without a local event store. Rename the unreleased client event configuration to `experimental_events` and infer distinct managed and direct event APIs from a single MCPClientConfig and exclusive MCPEventsConfig union.
|
|
16
|
+
- ac50548: feat(mcp): add compatibility for webhook based mcp events
|
|
17
|
+
- d8e4b51: fix(mcp): authorization server paths beginning with repeated slashes should not bypass authorization server validation
|
|
18
|
+
|
|
3
19
|
## 2.0.69
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -59,6 +59,23 @@ try {
|
|
|
59
59
|
The client converts MCP tool definitions into AI SDK tools, so model calls can
|
|
60
60
|
use them through the standard `tools` option.
|
|
61
61
|
|
|
62
|
+
## Experimental webhook events
|
|
63
|
+
|
|
64
|
+
Use `list`, `subscribe`, `refresh`, and `unsubscribe` through
|
|
65
|
+
`client.experimental_events` on the same `createMCPClient` instance. Configure
|
|
66
|
+
`experimental_events: { store }` with private durable storage shared with
|
|
67
|
+
`experimental_createMCPEventWebhook`, which you mount at your callback URL.
|
|
68
|
+
|
|
69
|
+
Subscription creation persists `delivery.url` and the generated signing secret
|
|
70
|
+
before contacting the server, enabling signed callback verification during the
|
|
71
|
+
subscribe request. The receiver verifies raw request bytes and checks event
|
|
72
|
+
envelopes before invoking your handler. Optional callbacks let your application
|
|
73
|
+
validate filters and event data. Agent execution and durable deduplication
|
|
74
|
+
remain application concerns; closing the client does not unsubscribe.
|
|
75
|
+
|
|
76
|
+
See the [MCP Events guide](https://ai-sdk.dev/docs/ai-sdk-core/mcp-events) and the
|
|
77
|
+
[local server/client example](../../examples/mcp/src/events/README.md).
|
|
78
|
+
|
|
62
79
|
## Protocol versions
|
|
63
80
|
|
|
64
81
|
The client supports legacy MCP protocol versions through the `initialize`
|
|
@@ -170,3 +187,9 @@ const mcpClient = await createMCPClient({
|
|
|
170
187
|
Please check out the
|
|
171
188
|
[AI SDK MCP documentation](https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools) for
|
|
172
189
|
more information.
|
|
190
|
+
|
|
191
|
+
Managed backends can implement `Experimental_MCPEventsAdapter` and configure
|
|
192
|
+
`experimental_events: { adapter }` instead of a store. Catalog discovery still
|
|
193
|
+
uses the authenticated MCP transport; subscribe/get/list/unsubscribe delegate
|
|
194
|
+
to the backend, which owns renewal and webhook delivery. Managed clients do not
|
|
195
|
+
expose `refresh()`. See the [managed subscription reference](https://ai-sdk.dev/docs/reference/ai-sdk-core/mcp-events#managed-subscriptions).
|