@mastra/mcp 1.18.1-alpha.3 → 2.0.0-alpha.5

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.
Files changed (90) hide show
  1. package/dist/client/actions/resource.d.ts +9 -59
  2. package/dist/client/actions/resource.d.ts.map +1 -1
  3. package/dist/client/client.d.ts +80 -122
  4. package/dist/client/client.d.ts.map +1 -1
  5. package/dist/client/configuration.d.ts +30 -120
  6. package/dist/client/configuration.d.ts.map +1 -1
  7. package/dist/client/error-utils.d.ts +9 -0
  8. package/dist/client/error-utils.d.ts.map +1 -1
  9. package/dist/client/index.d.ts +2 -1
  10. package/dist/client/index.d.ts.map +1 -1
  11. package/dist/client/oauth-callback-server.d.ts +8 -4
  12. package/dist/client/oauth-callback-server.d.ts.map +1 -1
  13. package/dist/client/oauth-provider.d.ts +91 -45
  14. package/dist/client/oauth-provider.d.ts.map +1 -1
  15. package/dist/client/server-proxy.d.ts +26 -46
  16. package/dist/client/server-proxy.d.ts.map +1 -1
  17. package/dist/client/types.d.ts +106 -143
  18. package/dist/client/types.d.ts.map +1 -1
  19. package/dist/conformance/fixture.d.ts +3 -0
  20. package/dist/conformance/fixture.d.ts.map +1 -0
  21. package/dist/conformance/run.d.ts +2 -0
  22. package/dist/conformance/run.d.ts.map +1 -0
  23. package/dist/conformance/stdio-server.d.ts +2 -0
  24. package/dist/conformance/stdio-server.d.ts.map +1 -0
  25. package/dist/docs/SKILL.md +2 -1
  26. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  27. package/dist/docs/references/reference-migrations-mcp-v2.md +268 -0
  28. package/dist/docs/references/reference-tools-mcp-client.md +36 -14
  29. package/dist/docs/references/reference-tools-mcp-server.md +32 -83
  30. package/dist/index.cjs +1657 -3331
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.js +1662 -3337
  33. package/dist/index.js.map +1 -1
  34. package/dist/server/actions.d.ts +34 -0
  35. package/dist/server/actions.d.ts.map +1 -0
  36. package/dist/server/oauth-middleware.d.ts +1 -1
  37. package/dist/server/request.d.ts +54 -0
  38. package/dist/server/request.d.ts.map +1 -0
  39. package/dist/server/server.d.ts +121 -800
  40. package/dist/server/server.d.ts.map +1 -1
  41. package/dist/server/types.d.ts +82 -138
  42. package/dist/server/types.d.ts.map +1 -1
  43. package/dist/shared/index.d.ts +1 -0
  44. package/dist/shared/index.d.ts.map +1 -1
  45. package/dist/shared/oauth-types.d.ts +3 -3
  46. package/dist/shared/oauth-types.d.ts.map +1 -1
  47. package/dist/shared/trace-context.d.ts +20 -0
  48. package/dist/shared/trace-context.d.ts.map +1 -0
  49. package/package.json +10 -15
  50. package/dist/_types/hono/dist/types/client/client.d.ts +0 -4
  51. package/dist/_types/hono/dist/types/client/fetch-result-please.d.ts +0 -35
  52. package/dist/_types/hono/dist/types/client/index.d.ts +0 -7
  53. package/dist/_types/hono/dist/types/client/types.d.ts +0 -229
  54. package/dist/_types/hono/dist/types/client/utils.d.ts +0 -18
  55. package/dist/_types/hono/dist/types/context.d.ts +0 -459
  56. package/dist/_types/hono/dist/types/helper/streaming/index.d.ts +0 -8
  57. package/dist/_types/hono/dist/types/helper/streaming/sse.d.ts +0 -13
  58. package/dist/_types/hono/dist/types/helper/streaming/stream.d.ts +0 -3
  59. package/dist/_types/hono/dist/types/helper/streaming/text.d.ts +0 -3
  60. package/dist/_types/hono/dist/types/hono-base.d.ts +0 -221
  61. package/dist/_types/hono/dist/types/hono.d.ts +0 -19
  62. package/dist/_types/hono/dist/types/index.d.ts +0 -37
  63. package/dist/_types/hono/dist/types/request/constants.d.ts +0 -1
  64. package/dist/_types/hono/dist/types/request.d.ts +0 -324
  65. package/dist/_types/hono/dist/types/router.d.ts +0 -97
  66. package/dist/_types/hono/dist/types/types.d.ts +0 -573
  67. package/dist/_types/hono/dist/types/utils/body.d.ts +0 -79
  68. package/dist/_types/hono/dist/types/utils/headers.d.ts +0 -8
  69. package/dist/_types/hono/dist/types/utils/http-status.d.ts +0 -32
  70. package/dist/_types/hono/dist/types/utils/mime.d.ts +0 -70
  71. package/dist/_types/hono/dist/types/utils/stream.d.ts +0 -31
  72. package/dist/_types/hono/dist/types/utils/types.d.ts +0 -74
  73. package/dist/_types/hono/package.json +0 -1
  74. package/dist/_types/hono-mcp-server-sse-transport/build/index.d.ts +0 -1
  75. package/dist/_types/hono-mcp-server-sse-transport/build/sse.d.ts +0 -25
  76. package/dist/_types/hono-mcp-server-sse-transport/package.json +0 -1
  77. package/dist/client/actions/elicitation.d.ts +0 -63
  78. package/dist/client/actions/elicitation.d.ts.map +0 -1
  79. package/dist/server/__tests__/mock-extra.d.ts +0 -15
  80. package/dist/server/__tests__/mock-extra.d.ts.map +0 -1
  81. package/dist/server/mrtrElicitation.d.ts +0 -39
  82. package/dist/server/mrtrElicitation.d.ts.map +0 -1
  83. package/dist/server/notificationBroadcast.d.ts +0 -24
  84. package/dist/server/notificationBroadcast.d.ts.map +0 -1
  85. package/dist/server/promptActions.d.ts +0 -49
  86. package/dist/server/promptActions.d.ts.map +0 -1
  87. package/dist/server/resourceActions.d.ts +0 -72
  88. package/dist/server/resourceActions.d.ts.map +0 -1
  89. package/dist/server/toolActions.d.ts +0 -84
  90. package/dist/server/toolActions.d.ts.map +0 -1
@@ -102,75 +102,25 @@ export declare class ResourceClientActions {
102
102
  })[];
103
103
  }>;
104
104
  /**
105
- * Subscribes to updates for a specific resource.
105
+ * Subscribes to update notifications for a resource. The client carries every
106
+ * subscription on one `subscriptions/listen` stream and reopens it after reconnects.
106
107
  *
107
- * After subscribing, you'll receive notifications via the `onUpdated` handler
108
- * when the resource content changes.
109
- *
110
- * @param uri - URI of the resource to subscribe to
111
- * @returns Promise resolving when subscription is established
112
- * @throws {Error} If subscription fails
108
+ * @param uri - URI of the resource to watch
109
+ * @throws {Error} If the server declines the subscription
113
110
  *
114
111
  * @example
115
112
  * ```typescript
113
+ * await client.resources.onUpdated(({ uri }) => console.log(`updated ${uri}`));
116
114
  * await client.resources.subscribe('file://data/config.json');
117
115
  * ```
118
116
  */
119
- subscribe(uri: string): Promise<{
120
- _meta?: {
121
- [x: string]: unknown;
122
- "io.modelcontextprotocol/serverInfo"?: {
123
- version: string;
124
- websiteUrl?: string | undefined;
125
- description?: string | undefined;
126
- icons?: {
127
- src: string;
128
- mimeType?: string | undefined;
129
- sizes?: string[] | undefined;
130
- theme?: "dark" | "light" | undefined;
131
- }[] | undefined;
132
- name: string;
133
- title?: string | undefined;
134
- } | undefined;
135
- } | undefined;
136
- }>;
137
- /**
138
- * Unsubscribes from updates for a specific resource.
139
- *
140
- * Stops receiving notifications for this resource URI.
141
- *
142
- * @param uri - URI of the resource to unsubscribe from
143
- * @returns Promise resolving when unsubscription is complete
144
- * @throws {Error} If unsubscription fails
145
- *
146
- * @example
147
- * ```typescript
148
- * await client.resources.unsubscribe('file://data/config.json');
149
- * ```
150
- */
151
- unsubscribe(uri: string): Promise<{
152
- _meta?: {
153
- [x: string]: unknown;
154
- "io.modelcontextprotocol/serverInfo"?: {
155
- version: string;
156
- websiteUrl?: string | undefined;
157
- description?: string | undefined;
158
- icons?: {
159
- src: string;
160
- mimeType?: string | undefined;
161
- sizes?: string[] | undefined;
162
- theme?: "dark" | "light" | undefined;
163
- }[] | undefined;
164
- name: string;
165
- title?: string | undefined;
166
- } | undefined;
167
- } | undefined;
168
- }>;
117
+ subscribe(uri: string): Promise<void>;
118
+ /** Stops update notifications for a resource previously passed to {@link subscribe}. */
119
+ unsubscribe(uri: string): Promise<void>;
169
120
  /**
170
121
  * Sets a notification handler for when subscribed resources are updated.
171
122
  *
172
- * The handler is called whenever the server sends a resource update notification
173
- * for any resource you've subscribed to.
123
+ * Updates arrive for resources passed to {@link subscribe}.
174
124
  *
175
125
  * @param handler - Callback function receiving the updated resource URI
176
126
  *
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/client/actions/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBA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+1,12 @@
1
1
  import type { Stream } from 'node:stream';
2
2
  import { MastraBase } from '@mastra/core/base';
3
3
  import type { Tool } from '@mastra/core/tools';
4
- import type { EmptyResult, GetPromptResult, ListPromptsResult, ListResourcesResult, ListResourceTemplatesResult, ReadResourceResult } from '@modelcontextprotocol/client';
5
- import { ElicitationClientActions } from './actions/elicitation.js';
4
+ import type { GetPromptResult, ListPromptsResult, ListResourcesResult, ListResourceTemplatesResult, ReadResourceResult } from '@modelcontextprotocol/client';
6
5
  import { ProgressClientActions } from './actions/progress.js';
7
6
  import { PromptClientActions } from './actions/prompt.js';
8
7
  import { ResourceClientActions } from './actions/resource.js';
9
- import type { ElicitationHandler, ProgressHandler, InternalMastraMCPClientOptions, Root, SerializableMCPToolDefinition } from './types.js';
10
- export type { LoggingLevel, LogMessage, LogHandler, ElicitationHandler, ProgressHandler, MastraFetchLike, MastraMCPServerDefinition, InternalMastraMCPClientOptions, Root, RequireToolApproval, RequireToolApprovalFn, RequireToolApprovalContext, SerializableMCPToolDefinition, } from './types.js';
8
+ import type { ProgressHandler, InternalMastraMCPClientOptions, SerializableMCPToolDefinition } from './types.js';
9
+ export type { LoggingLevel, LogMessage, LogHandler, ProgressHandler, MastraFetchLike, MastraMCPServerDefinition, MCPClientCapabilities, MCPClientProtocolVersion, MCPInputRequest, MCPInputRequestHandler, InternalMastraMCPClientOptions, RequireToolApproval, RequireToolApprovalFn, RequireToolApprovalContext, SerializableMCPToolDefinition, } from './types.js';
11
10
  /**
12
11
  * OAuth authorization state of an MCP server connection.
13
12
  *
@@ -50,8 +49,12 @@ export declare function getMcpCallToolMeta(output: unknown): Record<string, unkn
50
49
  /**
51
50
  * Internal MCP client implementation for connecting to a single MCP server.
52
51
  *
53
- * This class handles the low-level connection, transport management, and protocol
54
- * communication with an MCP server. Most users should use MCPClient instead.
52
+ * Probes the server with `server/discover` unless `protocolVersion` pins a
53
+ * revision, then speaks whichever revision was negotiated. On 2026-07-28 there is
54
+ * no session, embedded input requests are answered through the configured
55
+ * `inputRequests` handler, and change notifications arrive on one managed
56
+ * `subscriptions/listen` stream (see {@link subscribeResource}). Those two
57
+ * facilities fail on a legacy negotiation; everything else works on either revision.
55
58
  *
56
59
  * @internal
57
60
  */
@@ -60,8 +63,8 @@ export declare class InternalMastraMCPClient extends MastraBase {
60
63
  private client;
61
64
  private readonly timeout;
62
65
  private logHandler?;
63
- private enableServerLogs?;
64
- private enableProgressTracking?;
66
+ private readonly serverLogLevel?;
67
+ private enableProgressTracking;
65
68
  private serverConfig;
66
69
  private transport?;
67
70
  private pendingAuthTransport?;
@@ -73,68 +76,32 @@ export declare class InternalMastraMCPClient extends MastraBase {
73
76
  private sigTermHandler?;
74
77
  private sigHupHandler?;
75
78
  private serverInstructions?;
76
- private _roots;
77
- private hasElicitationCapability;
79
+ /** The verdict of the last successful probe, reused so reconnects skip it. */
80
+ private priorDiscovery?;
78
81
  private readonly requireToolApproval;
79
82
  private readonly onToolError;
80
- /** Provides access to resource operations (list, read, subscribe, etc.) */
83
+ private jsonSchemaValidator?;
84
+ private jsonSchemaValidatorPromise?;
85
+ /** Provides access to resource operations (list, read, notifications) */
81
86
  readonly resources: ResourceClientActions;
82
87
  /** Provides access to prompt operations (list, get, notifications) */
83
88
  readonly prompts: PromptClientActions;
84
- /** Provides access to elicitation operations (request handling) */
85
- readonly elicitation: ElicitationClientActions;
86
89
  /** Provides access to progress operations (notifications) */
87
90
  readonly progress: ProgressClientActions;
88
91
  /**
89
92
  * @internal
90
93
  */
91
- constructor({ name, version, server, capabilities, timeout, }: InternalMastraMCPClientOptions);
94
+ constructor({ name, version, server, timeout }: InternalMastraMCPClientOptions);
92
95
  /**
93
96
  * Log a message at the specified level
94
- * @param level Log level
95
- * @param message Log message
96
- * @param details Optional additional details
97
97
  */
98
98
  private log;
99
- private setupLogging;
100
99
  /**
101
- * Set up handler for roots/list requests from the server.
102
- *
103
- * Per MCP spec (https://modelcontextprotocol.io/specification/2025-11-25/client/roots):
104
- * When a server sends a roots/list request, the client responds with the configured roots.
105
- */
106
- private setupRootsHandler;
107
- /**
108
- * Get the currently configured roots.
109
- *
110
- * @returns Array of configured filesystem roots
100
+ * Request metadata every outgoing request carries: the per-request log-level
101
+ * opt-in (when enabled) and the W3C trace fields resolved for this request,
102
+ * merged under caller-supplied keys.
111
103
  */
112
- get roots(): Root[];
113
- /**
114
- * Update the list of filesystem roots and notify the server.
115
- *
116
- * Per MCP spec, when roots change, the client sends a `notifications/roots/list_changed`
117
- * notification to inform the server that it should re-fetch the roots list.
118
- *
119
- * @param roots - New list of filesystem roots
120
- *
121
- * @example
122
- * ```typescript
123
- * await client.setRoots([
124
- * { uri: 'file:///home/user/projects', name: 'Projects' },
125
- * { uri: 'file:///tmp', name: 'Temp' }
126
- * ]);
127
- * ```
128
- */
129
- setRoots(roots: Root[]): Promise<void>;
130
- /**
131
- * Send a roots/list_changed notification to the server.
132
- *
133
- * Per MCP spec, clients that support `listChanged` MUST send this notification
134
- * when the list of roots changes. The server will then call roots/list to get
135
- * the updated list.
136
- */
137
- sendRootsListChanged(): Promise<void>;
104
+ private requestMeta;
138
105
  private buildStdioEnv;
139
106
  private connectStdio;
140
107
  private connectHttp;
@@ -142,27 +109,21 @@ export declare class InternalMastraMCPClient extends MastraBase {
142
109
  * Detaches whatever transport is still attached to the underlying SDK Client.
143
110
  *
144
111
  * The SDK assigns its internal `_transport` before `transport.start()` and never
145
- * clears it when `start()` throws, and its cleanup after a failed initialize is a
146
- * fire-and-forget `void this.close()`. Either way a stale transport can remain
147
- * attached, making every subsequent `client.connect()` throw "Already connected
148
- * to a transport" and permanently wedging this client (issue #19862). Mastra's
149
- * own `this.transport` is only assigned after a successful connect, so
150
- * disconnect/forceReconnect never see the stale one. Calling this before every
151
- * connect attempt restores the invariant that a connect starts from a detached
152
- * SDK client.
112
+ * clears it when `start()` throws, so a stale transport can remain attached and
113
+ * make every subsequent `client.connect()` throw "Already connected to a
114
+ * transport". Mastra's own `this.transport` is only assigned after a successful
115
+ * connect, so disconnect/forceReconnect never see the stale one.
153
116
  */
154
117
  private detachStaleClientTransport;
155
118
  /**
156
119
  * Severs the mutual references between the SDK client and a stale transport
157
- * without closing it. Clearing the transport's callbacks ensures a later
158
- * close() of the stale transport cannot reach into the SDK client and clear
159
- * the state of a newer live connection.
120
+ * without closing it, so a later close() of the stale transport cannot reach
121
+ * into the SDK client and clear the state of a newer live connection.
160
122
  */
161
123
  private severClientTransportLink;
162
124
  /**
163
125
  * Closes and clears any transport retained from an unfinished authorization
164
- * flow. Safe to call when nothing is pending. Centralizes the cleanup so
165
- * success, disconnect, and forceReconnect all release the same resource.
126
+ * flow. Safe to call when nothing is pending.
166
127
  */
167
128
  private closePendingAuthTransport;
168
129
  /**
@@ -181,68 +142,66 @@ export declare class InternalMastraMCPClient extends MastraBase {
181
142
  *
182
143
  * Exchanges the authorization code captured at the redirect URI on the same
183
144
  * transport that started the flow, then leaves the client ready to connect().
184
- *
185
- * @param authorizationCode - The authorization code captured at the redirect URI
186
- * @throws {Error} If no authorization flow is pending for this server
145
+ * The RFC 9207 `iss` captured at the redirect is validated against the
146
+ * discovered authorization server before the code is exchanged.
187
147
  *
188
148
  * @internal
189
149
  */
190
- finishAuth(authorizationCode: string): Promise<void>;
150
+ finishAuth(authorizationCode: string, issuer?: string): Promise<void>;
191
151
  private isConnected;
192
152
  private reconnectPromise;
153
+ /**
154
+ * Change notifications the caller has asked for. The client keeps exactly one
155
+ * `subscriptions/listen` stream open for this interest set, replaces it when the
156
+ * set changes and reopens it after a reconnect.
157
+ */
158
+ private subscriptionInterest;
159
+ private subscriptionStream?;
160
+ private subscriptionUpdate;
193
161
  private lifecycleGeneration;
194
162
  /**
195
163
  * Connects to the MCP server using the configured transport.
196
164
  *
197
- * Automatically detects transport type based on configuration (stdio vs HTTP).
198
165
  * Safe to call multiple times - returns existing connection if already connected.
199
166
  *
200
- * @returns Promise resolving to true when connected
201
- * @throws {MastraError} If connection fails
202
- *
203
167
  * @internal
204
168
  */
205
169
  connect(): Promise<boolean>;
206
170
  /**
207
- * Gets the current session ID if using Streamable HTTP transport.
208
- *
209
- * Returns undefined if not connected or not using Streamable HTTP transport.
210
- *
211
- * @returns Session ID string or undefined
212
- *
213
- * @internal
171
+ * Installs the process-exit and signal handlers that tear this client down when the
172
+ * host process goes away. Idempotent, so repeated connects add at most one of each.
173
+ */
174
+ private registerProcessHooks;
175
+ /**
176
+ * Removes whatever {@link registerProcessHooks} installed. Keyed on the handlers this
177
+ * client actually registered rather than on connection state, so a client that never
178
+ * reached a transport still releases its process listeners.
214
179
  */
215
- get sessionId(): string | undefined;
180
+ private unregisterProcessHooks;
216
181
  /**
217
182
  * Gets the stderr stream of the child process, if using stdio transport with `stderr: 'pipe'`.
218
183
  *
219
- * Returns null if not connected, not using stdio transport, or stderr is not piped.
220
- *
221
184
  * @internal
222
185
  */
223
186
  get stderr(): Stream | null;
224
187
  get instructions(): string | undefined;
188
+ /** The protocol revision negotiated with the server; `undefined` until connected. */
189
+ get negotiatedProtocolVersion(): string | undefined;
190
+ private rememberNegotiation;
191
+ /** Fails a call that only the 2026-07-28 revision supports when the server negotiated an older one. */
192
+ private assertCurrentRevision;
225
193
  get forwardInstructions(): boolean;
226
194
  get instructionsMaxLength(): number;
227
- private refreshServerInstructions;
228
195
  disconnect(): Promise<void>;
229
196
  /**
230
197
  * Forces a reconnection to the MCP server by disconnecting and reconnecting.
231
198
  *
232
- * This is useful when the session becomes invalid (e.g., after server restart)
233
- * and the client needs to establish a fresh connection.
234
- *
235
- * @returns Promise resolving when reconnection is complete
236
- * @throws {Error} If reconnection fails
237
- *
238
199
  * @internal
239
200
  */
240
201
  forceReconnect(): Promise<void>;
241
202
  private reconnectAfterTransportFailure;
242
203
  listResources(): Promise<ListResourcesResult>;
243
204
  readResource(uri: string): Promise<ReadResourceResult>;
244
- subscribeResource(uri: string): Promise<EmptyResult>;
245
- unsubscribeResource(uri: string): Promise<EmptyResult>;
246
205
  listResourceTemplates(): Promise<ListResourceTemplatesResult>;
247
206
  /**
248
207
  * Fetch the list of available prompts from the MCP server.
@@ -250,27 +209,40 @@ export declare class InternalMastraMCPClient extends MastraBase {
250
209
  listPrompts(): Promise<ListPromptsResult>;
251
210
  /**
252
211
  * Get a prompt and its dynamic messages from the server.
253
- * @param name The prompt name
254
- * @param args Arguments for the prompt
255
212
  */
256
213
  getPrompt({ name, args }: {
257
214
  name: string;
258
215
  args?: Record<string, any>;
259
216
  }): Promise<GetPromptResult>;
217
+ private hasSubscriptionInterest;
218
+ private subscriptionFilter;
219
+ /** Serializes stream replacements so concurrent mutations apply in order. */
220
+ private enqueueSubscriptionUpdate;
260
221
  /**
261
- * Register a handler to be called when the prompt list changes on the server.
262
- * Use this to refresh cached prompt lists in the client/UI if needed.
222
+ * Opens a `subscriptions/listen` stream for the current interest set, then closes the
223
+ * previous one so no notification is lost between filters. Resource subscriptions the
224
+ * server declines are an error; declined list-changed bits only mean the server has
225
+ * nothing to announce.
263
226
  */
264
- setPromptListChangedNotificationHandler(handler: () => void): void;
227
+ private replaceSubscriptionStream;
228
+ private closeSubscriptionStream;
229
+ /** Applies an interest change to the live stream when connected; otherwise connect() opens it. */
230
+ private applySubscriptionInterest;
265
231
  /**
266
- * Register a handler to be called when the tool list changes on the server.
267
- * Use this to re-fetch tools via `tools()` when notified.
232
+ * Subscribes to `notifications/resources/updated` for a resource. The subscription is
233
+ * carried on the client's single `subscriptions/listen` stream and survives reconnects.
268
234
  */
269
- setToolListChangedNotificationHandler(handler: () => void): void;
270
- setResourceUpdatedNotificationHandler(handler: (params: any) => void): void;
271
- setResourceListChangedNotificationHandler(handler: () => void): void;
272
- setElicitationRequestHandler(handler: ElicitationHandler): void;
235
+ subscribeResource(uri: string): Promise<void>;
236
+ unsubscribeResource(uri: string): Promise<void>;
237
+ private updateResourceSubscriptions;
238
+ setPromptListChangedNotificationHandler(handler: () => void): Promise<void>;
239
+ setToolListChangedNotificationHandler(handler: () => void): Promise<void>;
240
+ setResourceUpdatedNotificationHandler(handler: (params: {
241
+ uri: string;
242
+ }) => void): void;
243
+ setResourceListChangedNotificationHandler(handler: () => void): Promise<void>;
273
244
  setProgressNotificationHandler(handler: ProgressHandler): void;
245
+ private getJsonSchemaValidator;
274
246
  private convertInputSchema;
275
247
  /**
276
248
  * Wraps the output schema with a validator that always succeeds. The tool's execute wrapper
@@ -283,34 +255,20 @@ export declare class InternalMastraMCPClient extends MastraBase {
283
255
  private convertOutputSchema;
284
256
  /**
285
257
  * Returns the server's tool catalog as plain, serializable definitions.
286
- *
287
- * Unlike {@link tools}, this performs no schema conversion and creates no executable
288
- * wrappers, so the result can be cached and reused by other processes. Pass a definition
289
- * back to {@link toolFromDefinition} to rebuild the executable tool without rediscovery.
290
258
  */
291
259
  toolDefinitions(): Promise<Record<string, SerializableMCPToolDefinition>>;
292
- /**
293
- * Captures a `tools/list` entry plus the server metadata that is only reachable from a live
294
- * connection, so a hydrated tool is indistinguishable from a freshly discovered one.
295
- */
296
260
  private toSerializableDefinition;
297
261
  /**
298
262
  * Rebuilds an executable Mastra tool from a cached {@link SerializableMCPToolDefinition}.
299
- *
300
- * No connection is opened here. The client connects lazily, the first time the returned tool
301
- * is actually executed, which is what makes a cached catalog useful for cold starts.
263
+ * The client connects lazily on the first execution.
302
264
  */
303
265
  toolFromDefinition({ definition }: {
304
266
  definition: SerializableMCPToolDefinition;
305
267
  }): Tool<any, any, any, any>;
306
268
  tools(): Promise<Record<string, Tool<any, any, any, any>>>;
307
269
  /**
308
- * Single conversion path shared by live discovery and cached hydration.
309
- *
310
- * Keeping both callers on this one method is what guarantees the issue's requirement that
311
- * hydrated tools behave identically to discovered ones: strict-mode metadata, approval
312
- * policies, structured content, in-band tool errors, progress metadata, abort signals and
313
- * reconnect/retry all come from here rather than being reimplemented per call site.
270
+ * Single conversion path shared by live discovery and cached hydration, so hydrated
271
+ * tools behave identically to discovered ones.
314
272
  */
315
273
  private buildToolFromListEntry;
316
274
  private stampServerIdInMeta;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d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