@mastra/mcp 1.2.1-alpha.0 → 1.2.2-alpha.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/CHANGELOG.md +29 -0
- package/dist/client/actions/prompt.d.ts +2 -5
- package/dist/client/actions/prompt.d.ts.map +1 -1
- package/dist/client/actions/resource.d.ts +15 -5
- package/dist/client/actions/resource.d.ts.map +1 -1
- package/dist/client/client.d.ts +1 -3
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/configuration.d.ts +57 -29
- package/dist/client/configuration.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +36 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -58
- package/dist/index.js.map +1 -1
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/types.d.ts +21 -1
- package/dist/server/types.d.ts.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @mastra/mcp
|
|
2
2
|
|
|
3
|
+
## 1.2.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- **Improved** ([#14260](https://github.com/mastra-ai/mastra/pull/14260))
|
|
8
|
+
- Updated `@modelcontextprotocol/sdk` from `^1.17.5` to `^1.27.1`.
|
|
9
|
+
|
|
10
|
+
**Deprecated**
|
|
11
|
+
- Deprecated prompt `version` usage in `@mastra/mcp`.
|
|
12
|
+
- Prompt versions are not part of MCP protocol behavior and will be removed.
|
|
13
|
+
|
|
14
|
+
**Migration**
|
|
15
|
+
- Use unique prompt names instead of prompt versions.
|
|
16
|
+
- Before: `client.prompts.get({ name: 'explain-code', version: 'v1', args })`
|
|
17
|
+
- After: `client.prompts.get({ name: 'explain-code-v1', args })`
|
|
18
|
+
- `MastraPrompt` is available for migration and is also deprecated.
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`51970b3`](https://github.com/mastra-ai/mastra/commit/51970b3828494d59a8dd4df143b194d37d31e3f5), [`085e371`](https://github.com/mastra-ai/mastra/commit/085e3718a7d0fe9a210fe7dd1c867b9bdfe8d16b), [`ce26fe2`](https://github.com/mastra-ai/mastra/commit/ce26fe2166dd90254f8bee5776e55977143e97de), [`b26307f`](https://github.com/mastra-ai/mastra/commit/b26307f050df39629511b0e831b8fc26973ce8b1)]:
|
|
21
|
+
- @mastra/core@1.13.3-alpha.0
|
|
22
|
+
|
|
23
|
+
## 1.2.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Fixed TypeScript compilation errors when using MCP resource methods in projects with pnpm workspaces. ([#14229](https://github.com/mastra-ai/mastra/pull/14229))
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [[`ea86967`](https://github.com/mastra-ai/mastra/commit/ea86967449426e0a3673253bd1c2c052a99d970d), [`db21c21`](https://github.com/mastra-ai/mastra/commit/db21c21a6ae5f33539262cc535342fa8757eb359), [`11f5dbe`](https://github.com/mastra-ai/mastra/commit/11f5dbe9a1e7ad8ef3b1ea34fb4a9fa3631d1587), [`6751354`](https://github.com/mastra-ai/mastra/commit/67513544d1a64be891d9de7624d40aadc895d56e), [`c958cd3`](https://github.com/mastra-ai/mastra/commit/c958cd36627c1eea122ec241b2b15492977a263a), [`86f2426`](https://github.com/mastra-ai/mastra/commit/86f242631d252a172d2f9f9a2ea0feb8647a76b0), [`950eb07`](https://github.com/mastra-ai/mastra/commit/950eb07b7e7354629630e218d49550fdd299c452)]:
|
|
30
|
+
- @mastra/core@1.13.0
|
|
31
|
+
|
|
3
32
|
## 1.2.1-alpha.0
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -30,7 +30,7 @@ export declare class PromptClientActions {
|
|
|
30
30
|
* ```typescript
|
|
31
31
|
* const prompts = await client.prompts.list();
|
|
32
32
|
* prompts.forEach(prompt => {
|
|
33
|
-
* console.log(`${prompt.name}
|
|
33
|
+
* console.log(`${prompt.name}: ${prompt.description}`);
|
|
34
34
|
* });
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
@@ -44,7 +44,6 @@ export declare class PromptClientActions {
|
|
|
44
44
|
* @param params - Parameters for the prompt request
|
|
45
45
|
* @param params.name - Name of the prompt to retrieve
|
|
46
46
|
* @param params.args - Optional arguments to populate the prompt template
|
|
47
|
-
* @param params.version - Optional specific version of the prompt to retrieve
|
|
48
47
|
* @returns Promise resolving to the prompt result with messages
|
|
49
48
|
* @throws {Error} If fetching the prompt fails or prompt not found
|
|
50
49
|
*
|
|
@@ -56,17 +55,15 @@ export declare class PromptClientActions {
|
|
|
56
55
|
* language: 'typescript',
|
|
57
56
|
* code: 'const x = 1;'
|
|
58
57
|
* },
|
|
59
|
-
* version: '1.0'
|
|
60
58
|
* });
|
|
61
59
|
*
|
|
62
60
|
* // Use prompt messages in AI completion
|
|
63
61
|
* console.log(prompt.messages);
|
|
64
62
|
* ```
|
|
65
63
|
*/
|
|
66
|
-
get({ name, args
|
|
64
|
+
get({ name, args }: {
|
|
67
65
|
name: string;
|
|
68
66
|
args?: Record<string, any>;
|
|
69
|
-
version?: string;
|
|
70
67
|
}): Promise<GetPromptResult>;
|
|
71
68
|
/**
|
|
72
69
|
* Sets a notification handler for when the list of available prompts changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/client/actions/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEzD,UAAU,yBAAyB;
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/client/actions/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEzD,UAAU,yBAAyB;IACjC,MAAM,EAAE,uBAAuB,CAAC;IAChC,MAAM,EAAE,aAAa,CAAC;CACvB;AAED;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IAEvC;;OAEG;gBACS,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,yBAAyB;IAKzD;;;;;;;;;;;;;;;OAeG;IACU,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAyBtC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACU,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAIxG;;;;;;;;;;;;;;;OAeG;IACU,aAAa,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/D"}
|
|
@@ -70,24 +70,26 @@ export declare class ResourceClientActions {
|
|
|
70
70
|
read(uri: string): Promise<{
|
|
71
71
|
[x: string]: unknown;
|
|
72
72
|
contents: ({
|
|
73
|
-
[x: string]: unknown;
|
|
74
|
-
text: string;
|
|
75
73
|
uri: string;
|
|
74
|
+
text: string;
|
|
75
|
+
mimeType?: string | undefined;
|
|
76
76
|
_meta?: {
|
|
77
77
|
[x: string]: unknown;
|
|
78
78
|
} | undefined;
|
|
79
|
-
mimeType?: string | undefined;
|
|
80
79
|
} | {
|
|
81
|
-
[x: string]: unknown;
|
|
82
80
|
uri: string;
|
|
83
81
|
blob: string;
|
|
82
|
+
mimeType?: string | undefined;
|
|
84
83
|
_meta?: {
|
|
85
84
|
[x: string]: unknown;
|
|
86
85
|
} | undefined;
|
|
87
|
-
mimeType?: string | undefined;
|
|
88
86
|
})[];
|
|
89
87
|
_meta?: {
|
|
90
88
|
[x: string]: unknown;
|
|
89
|
+
progressToken?: string | number | undefined;
|
|
90
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
91
|
+
taskId: string;
|
|
92
|
+
} | undefined;
|
|
91
93
|
} | undefined;
|
|
92
94
|
}>;
|
|
93
95
|
/**
|
|
@@ -108,6 +110,10 @@ export declare class ResourceClientActions {
|
|
|
108
110
|
subscribe(uri: string): Promise<{
|
|
109
111
|
_meta?: {
|
|
110
112
|
[x: string]: unknown;
|
|
113
|
+
progressToken?: string | number | undefined;
|
|
114
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
115
|
+
taskId: string;
|
|
116
|
+
} | undefined;
|
|
111
117
|
} | undefined;
|
|
112
118
|
}>;
|
|
113
119
|
/**
|
|
@@ -127,6 +133,10 @@ export declare class ResourceClientActions {
|
|
|
127
133
|
unsubscribe(uri: string): Promise<{
|
|
128
134
|
_meta?: {
|
|
129
135
|
[x: string]: unknown;
|
|
136
|
+
progressToken?: string | number | undefined;
|
|
137
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
138
|
+
taskId: string;
|
|
139
|
+
} | undefined;
|
|
130
140
|
} | undefined;
|
|
131
141
|
}>;
|
|
132
142
|
/**
|
|
@@ -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,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MA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;IA0BrD;;;;;;;;;;;;OAYG;IACU,IAAI,CAAC,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;IAI7B;;;;;;;;;;;;;;OAcG;IACU,SAAS,CAAC,GAAG,EAAE,MAAM;;;;;;;;;IAIlC;;;;;;;;;;;;;OAaG;IACU,WAAW,CAAC,GAAG,EAAE,MAAM;;;;;;;;;IAIpC;;;;;;;;;;;;;;;;;OAiBG;IACU,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjF;;;;;;;;;;;;;;;OAeG;IACU,aAAa,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/D"}
|
package/dist/client/client.d.ts
CHANGED
|
@@ -152,12 +152,10 @@ export declare class InternalMastraMCPClient extends MastraBase {
|
|
|
152
152
|
* Get a prompt and its dynamic messages from the server.
|
|
153
153
|
* @param name The prompt name
|
|
154
154
|
* @param args Arguments for the prompt
|
|
155
|
-
* @param version (optional) The prompt version to retrieve
|
|
156
155
|
*/
|
|
157
|
-
getPrompt({ name, args
|
|
156
|
+
getPrompt({ name, args }: {
|
|
158
157
|
name: string;
|
|
159
158
|
args?: Record<string, any>;
|
|
160
|
-
version?: string;
|
|
161
159
|
}): Promise<GetPromptResult>;
|
|
162
160
|
/**
|
|
163
161
|
* Register a handler to be called when the prompt list changes on the server.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAS/C,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAE3B,kBAAk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AAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IASvG;;;OAGG;IACH,uCAAuC,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;IAOlE,qCAAqC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAO3E,yCAAyC,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;IAOpE,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAQ/D,8BAA8B,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;YAOhD,kBAAkB;YA+BlB,mBAAmB;IAiC3B,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;CA8HjE"}
|
|
@@ -217,24 +217,26 @@ export declare class MCPClient extends MastraBase {
|
|
|
217
217
|
read: (serverName: string, uri: string) => Promise<{
|
|
218
218
|
[x: string]: unknown;
|
|
219
219
|
contents: ({
|
|
220
|
-
[x: string]: unknown;
|
|
221
|
-
text: string;
|
|
222
220
|
uri: string;
|
|
221
|
+
text: string;
|
|
222
|
+
mimeType?: string | undefined;
|
|
223
223
|
_meta?: {
|
|
224
224
|
[x: string]: unknown;
|
|
225
225
|
} | undefined;
|
|
226
|
-
mimeType?: string | undefined;
|
|
227
226
|
} | {
|
|
228
|
-
[x: string]: unknown;
|
|
229
227
|
uri: string;
|
|
230
228
|
blob: string;
|
|
229
|
+
mimeType?: string | undefined;
|
|
231
230
|
_meta?: {
|
|
232
231
|
[x: string]: unknown;
|
|
233
232
|
} | undefined;
|
|
234
|
-
mimeType?: string | undefined;
|
|
235
233
|
})[];
|
|
236
234
|
_meta?: {
|
|
237
235
|
[x: string]: unknown;
|
|
236
|
+
progressToken?: string | number | undefined;
|
|
237
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
238
|
+
taskId: string;
|
|
239
|
+
} | undefined;
|
|
238
240
|
} | undefined;
|
|
239
241
|
}>;
|
|
240
242
|
/**
|
|
@@ -253,6 +255,10 @@ export declare class MCPClient extends MastraBase {
|
|
|
253
255
|
subscribe: (serverName: string, uri: string) => Promise<{
|
|
254
256
|
_meta?: {
|
|
255
257
|
[x: string]: unknown;
|
|
258
|
+
progressToken?: string | number | undefined;
|
|
259
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
260
|
+
taskId: string;
|
|
261
|
+
} | undefined;
|
|
256
262
|
} | undefined;
|
|
257
263
|
}>;
|
|
258
264
|
/**
|
|
@@ -271,6 +277,10 @@ export declare class MCPClient extends MastraBase {
|
|
|
271
277
|
unsubscribe: (serverName: string, uri: string) => Promise<{
|
|
272
278
|
_meta?: {
|
|
273
279
|
[x: string]: unknown;
|
|
280
|
+
progressToken?: string | number | undefined;
|
|
281
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
282
|
+
taskId: string;
|
|
283
|
+
} | undefined;
|
|
274
284
|
} | undefined;
|
|
275
285
|
}>;
|
|
276
286
|
/**
|
|
@@ -355,7 +365,6 @@ export declare class MCPClient extends MastraBase {
|
|
|
355
365
|
* @param params.serverName - Name of the server to retrieve from
|
|
356
366
|
* @param params.name - Name of the prompt to retrieve
|
|
357
367
|
* @param params.args - Optional arguments to populate the prompt template
|
|
358
|
-
* @param params.version - Optional specific version of the prompt
|
|
359
368
|
* @returns Promise resolving to the prompt result with messages
|
|
360
369
|
* @throws {MastraError} If fetching the prompt fails
|
|
361
370
|
*
|
|
@@ -365,88 +374,107 @@ export declare class MCPClient extends MastraBase {
|
|
|
365
374
|
* serverName: 'weatherServer',
|
|
366
375
|
* name: 'forecast',
|
|
367
376
|
* args: { city: 'London' },
|
|
368
|
-
* version: '1.0'
|
|
369
377
|
* });
|
|
370
378
|
* console.log(prompt.messages);
|
|
371
379
|
* ```
|
|
372
380
|
*/
|
|
373
|
-
get: ({ serverName, name, args
|
|
381
|
+
get: ({ serverName, name, args }: {
|
|
374
382
|
serverName: string;
|
|
375
383
|
name: string;
|
|
376
384
|
args?: Record<string, any>;
|
|
377
|
-
version?: string;
|
|
378
385
|
}) => Promise<{
|
|
379
386
|
[x: string]: unknown;
|
|
380
387
|
messages: {
|
|
381
|
-
|
|
388
|
+
role: "user" | "assistant";
|
|
382
389
|
content: {
|
|
383
|
-
[x: string]: unknown;
|
|
384
390
|
type: "text";
|
|
385
391
|
text: string;
|
|
392
|
+
annotations?: {
|
|
393
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
394
|
+
priority?: number | undefined;
|
|
395
|
+
lastModified?: string | undefined;
|
|
396
|
+
} | undefined;
|
|
386
397
|
_meta?: {
|
|
387
398
|
[x: string]: unknown;
|
|
388
399
|
} | undefined;
|
|
389
400
|
} | {
|
|
390
|
-
[x: string]: unknown;
|
|
391
401
|
type: "image";
|
|
392
|
-
mimeType: string;
|
|
393
402
|
data: string;
|
|
403
|
+
mimeType: string;
|
|
404
|
+
annotations?: {
|
|
405
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
406
|
+
priority?: number | undefined;
|
|
407
|
+
lastModified?: string | undefined;
|
|
408
|
+
} | undefined;
|
|
394
409
|
_meta?: {
|
|
395
410
|
[x: string]: unknown;
|
|
396
411
|
} | undefined;
|
|
397
412
|
} | {
|
|
398
|
-
[x: string]: unknown;
|
|
399
413
|
type: "audio";
|
|
400
|
-
mimeType: string;
|
|
401
414
|
data: string;
|
|
415
|
+
mimeType: string;
|
|
416
|
+
annotations?: {
|
|
417
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
418
|
+
priority?: number | undefined;
|
|
419
|
+
lastModified?: string | undefined;
|
|
420
|
+
} | undefined;
|
|
402
421
|
_meta?: {
|
|
403
422
|
[x: string]: unknown;
|
|
404
423
|
} | undefined;
|
|
405
424
|
} | {
|
|
406
|
-
[x: string]: unknown;
|
|
407
|
-
type: "resource_link";
|
|
408
|
-
name: string;
|
|
409
425
|
uri: string;
|
|
426
|
+
name: string;
|
|
427
|
+
type: "resource_link";
|
|
428
|
+
description?: string | undefined;
|
|
429
|
+
mimeType?: string | undefined;
|
|
430
|
+
annotations?: {
|
|
431
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
432
|
+
priority?: number | undefined;
|
|
433
|
+
lastModified?: string | undefined;
|
|
434
|
+
} | undefined;
|
|
410
435
|
_meta?: {
|
|
411
436
|
[x: string]: unknown;
|
|
412
437
|
} | undefined;
|
|
413
|
-
title?: string | undefined;
|
|
414
|
-
description?: string | undefined;
|
|
415
438
|
icons?: {
|
|
416
|
-
[x: string]: unknown;
|
|
417
439
|
src: string;
|
|
418
440
|
mimeType?: string | undefined;
|
|
419
441
|
sizes?: string[] | undefined;
|
|
442
|
+
theme?: "light" | "dark" | undefined;
|
|
420
443
|
}[] | undefined;
|
|
421
|
-
|
|
444
|
+
title?: string | undefined;
|
|
422
445
|
} | {
|
|
423
|
-
[x: string]: unknown;
|
|
424
446
|
type: "resource";
|
|
425
447
|
resource: {
|
|
426
|
-
[x: string]: unknown;
|
|
427
|
-
text: string;
|
|
428
448
|
uri: string;
|
|
449
|
+
text: string;
|
|
450
|
+
mimeType?: string | undefined;
|
|
429
451
|
_meta?: {
|
|
430
452
|
[x: string]: unknown;
|
|
431
453
|
} | undefined;
|
|
432
|
-
mimeType?: string | undefined;
|
|
433
454
|
} | {
|
|
434
|
-
[x: string]: unknown;
|
|
435
455
|
uri: string;
|
|
436
456
|
blob: string;
|
|
457
|
+
mimeType?: string | undefined;
|
|
437
458
|
_meta?: {
|
|
438
459
|
[x: string]: unknown;
|
|
439
460
|
} | undefined;
|
|
440
|
-
mimeType?: string | undefined;
|
|
441
461
|
};
|
|
462
|
+
annotations?: {
|
|
463
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
464
|
+
priority?: number | undefined;
|
|
465
|
+
lastModified?: string | undefined;
|
|
466
|
+
} | undefined;
|
|
442
467
|
_meta?: {
|
|
443
468
|
[x: string]: unknown;
|
|
444
469
|
} | undefined;
|
|
445
470
|
};
|
|
446
|
-
role: "user" | "assistant";
|
|
447
471
|
}[];
|
|
448
472
|
_meta?: {
|
|
449
473
|
[x: string]: unknown;
|
|
474
|
+
progressToken?: string | number | undefined;
|
|
475
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
476
|
+
taskId: string;
|
|
477
|
+
} | undefined;
|
|
450
478
|
} | undefined;
|
|
451
479
|
description?: string | undefined;
|
|
452
480
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/client/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,MAAM,EACN,QAAQ,EACR,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAI1D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wHAAwH;IACxH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;IACnD,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACvC,OAAO,CAAC,aAAa,CAAiD;IACtE,OAAO,CAAC,EAAE,CAAS;IACnB,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,iBAAiB,CAA8B;IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;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 var PromptClientActions = class {
|
|
|
124
124
|
* ```typescript
|
|
125
125
|
* const prompts = await client.prompts.list();
|
|
126
126
|
* prompts.forEach(prompt => {
|
|
127
|
-
* console.log(`${prompt.name}
|
|
127
|
+
* console.log(`${prompt.name}: ${prompt.description}`);
|
|
128
128
|
* });
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
@@ -132,7 +132,7 @@ var PromptClientActions = class {
|
|
|
132
132
|
try {
|
|
133
133
|
const response = await this.client.listPrompts();
|
|
134
134
|
if (response && response.prompts && Array.isArray(response.prompts)) {
|
|
135
|
-
return response.prompts.map((prompt) => ({ ...prompt
|
|
135
|
+
return response.prompts.map((prompt) => ({ ...prompt }));
|
|
136
136
|
} else {
|
|
137
137
|
this.logger.warn(`Prompts response from server ${this.client.name} did not have expected structure.`, {
|
|
138
138
|
response
|
|
@@ -160,7 +160,6 @@ var PromptClientActions = class {
|
|
|
160
160
|
* @param params - Parameters for the prompt request
|
|
161
161
|
* @param params.name - Name of the prompt to retrieve
|
|
162
162
|
* @param params.args - Optional arguments to populate the prompt template
|
|
163
|
-
* @param params.version - Optional specific version of the prompt to retrieve
|
|
164
163
|
* @returns Promise resolving to the prompt result with messages
|
|
165
164
|
* @throws {Error} If fetching the prompt fails or prompt not found
|
|
166
165
|
*
|
|
@@ -172,19 +171,14 @@ var PromptClientActions = class {
|
|
|
172
171
|
* language: 'typescript',
|
|
173
172
|
* code: 'const x = 1;'
|
|
174
173
|
* },
|
|
175
|
-
* version: '1.0'
|
|
176
174
|
* });
|
|
177
175
|
*
|
|
178
176
|
* // Use prompt messages in AI completion
|
|
179
177
|
* console.log(prompt.messages);
|
|
180
178
|
* ```
|
|
181
179
|
*/
|
|
182
|
-
async get({
|
|
183
|
-
name,
|
|
184
|
-
args,
|
|
185
|
-
version
|
|
186
|
-
}) {
|
|
187
|
-
return this.client.getPrompt({ name, args, version });
|
|
180
|
+
async get({ name, args }) {
|
|
181
|
+
return this.client.getPrompt({ name, args });
|
|
188
182
|
}
|
|
189
183
|
/**
|
|
190
184
|
* Sets a notification handler for when the list of available prompts changes.
|
|
@@ -816,16 +810,11 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
816
810
|
* Get a prompt and its dynamic messages from the server.
|
|
817
811
|
* @param name The prompt name
|
|
818
812
|
* @param args Arguments for the prompt
|
|
819
|
-
* @param version (optional) The prompt version to retrieve
|
|
820
813
|
*/
|
|
821
|
-
async getPrompt({
|
|
822
|
-
name,
|
|
823
|
-
args,
|
|
824
|
-
version
|
|
825
|
-
}) {
|
|
814
|
+
async getPrompt({ name, args }) {
|
|
826
815
|
this.log("debug", `Requesting prompt from MCP server: ${name}`);
|
|
827
816
|
return await this.client.request(
|
|
828
|
-
{ method: "prompts/get", params: { name, arguments: args
|
|
817
|
+
{ method: "prompts/get", params: { name, arguments: args } },
|
|
829
818
|
types_js.GetPromptResultSchema,
|
|
830
819
|
{ timeout: this.timeout }
|
|
831
820
|
);
|
|
@@ -1527,7 +1516,6 @@ To fix this you have three different options:
|
|
|
1527
1516
|
* @param params.serverName - Name of the server to retrieve from
|
|
1528
1517
|
* @param params.name - Name of the prompt to retrieve
|
|
1529
1518
|
* @param params.args - Optional arguments to populate the prompt template
|
|
1530
|
-
* @param params.version - Optional specific version of the prompt
|
|
1531
1519
|
* @returns Promise resolving to the prompt result with messages
|
|
1532
1520
|
* @throws {MastraError} If fetching the prompt fails
|
|
1533
1521
|
*
|
|
@@ -1537,20 +1525,14 @@ To fix this you have three different options:
|
|
|
1537
1525
|
* serverName: 'weatherServer',
|
|
1538
1526
|
* name: 'forecast',
|
|
1539
1527
|
* args: { city: 'London' },
|
|
1540
|
-
* version: '1.0'
|
|
1541
1528
|
* });
|
|
1542
1529
|
* console.log(prompt.messages);
|
|
1543
1530
|
* ```
|
|
1544
1531
|
*/
|
|
1545
|
-
get: async ({
|
|
1546
|
-
serverName,
|
|
1547
|
-
name,
|
|
1548
|
-
args,
|
|
1549
|
-
version
|
|
1550
|
-
}) => {
|
|
1532
|
+
get: async ({ serverName, name, args }) => {
|
|
1551
1533
|
try {
|
|
1552
1534
|
const internalClient = await this.getConnectedClientForServer(serverName);
|
|
1553
|
-
return internalClient.prompts.get({ name, args
|
|
1535
|
+
return internalClient.prompts.get({ name, args });
|
|
1554
1536
|
} catch (error$1) {
|
|
1555
1537
|
throw new error.MastraError(
|
|
1556
1538
|
{
|
|
@@ -2003,7 +1985,7 @@ function createSimpleTokenProvider(accessToken, options) {
|
|
|
2003
1985
|
});
|
|
2004
1986
|
}
|
|
2005
1987
|
|
|
2006
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
1988
|
+
// ../../node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/utils/stream.js
|
|
2007
1989
|
var StreamingApi = class {
|
|
2008
1990
|
writer;
|
|
2009
1991
|
encoder;
|
|
@@ -2080,7 +2062,7 @@ var StreamingApi = class {
|
|
|
2080
2062
|
}
|
|
2081
2063
|
};
|
|
2082
2064
|
|
|
2083
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2065
|
+
// ../../node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/helper/streaming/utils.js
|
|
2084
2066
|
var isOldBunVersion = () => {
|
|
2085
2067
|
const version = typeof Bun !== "undefined" ? Bun.version : void 0;
|
|
2086
2068
|
if (version === void 0) {
|
|
@@ -2091,7 +2073,7 @@ var isOldBunVersion = () => {
|
|
|
2091
2073
|
return result;
|
|
2092
2074
|
};
|
|
2093
2075
|
|
|
2094
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2076
|
+
// ../../node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/utils/html.js
|
|
2095
2077
|
var HtmlEscapedCallbackPhase = {
|
|
2096
2078
|
Stringify: 1};
|
|
2097
2079
|
var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
@@ -2122,7 +2104,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
2122
2104
|
}
|
|
2123
2105
|
};
|
|
2124
2106
|
|
|
2125
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
2107
|
+
// ../../node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/helper/streaming/sse.js
|
|
2126
2108
|
var SSEStreamingApi = class extends StreamingApi {
|
|
2127
2109
|
constructor(writable, readable) {
|
|
2128
2110
|
super(writable, readable);
|
|
@@ -2566,8 +2548,7 @@ var MCPServer = class extends mcp.MCPServerBase {
|
|
|
2566
2548
|
this.promptOptions = opts.prompts;
|
|
2567
2549
|
const capabilities = {
|
|
2568
2550
|
tools: {},
|
|
2569
|
-
logging: { enabled: true }
|
|
2570
|
-
elicitation: {}
|
|
2551
|
+
logging: { enabled: true }
|
|
2571
2552
|
};
|
|
2572
2553
|
if (opts.resources) {
|
|
2573
2554
|
capabilities.resources = { subscribe: true, listChanged: true };
|
|
@@ -2672,8 +2653,7 @@ var MCPServer = class extends mcp.MCPServerBase {
|
|
|
2672
2653
|
createServerInstance() {
|
|
2673
2654
|
const capabilities = {
|
|
2674
2655
|
tools: {},
|
|
2675
|
-
logging: { enabled: true }
|
|
2676
|
-
elicitation: {}
|
|
2656
|
+
logging: { enabled: true }
|
|
2677
2657
|
};
|
|
2678
2658
|
if (this.resourceOptions) {
|
|
2679
2659
|
capabilities.resources = { subscribe: true, listChanged: true };
|
|
@@ -2906,17 +2886,22 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
|
|
|
2906
2886
|
const resourcesOrResourceContent = await capturedResourceOptions.getResourceContent({ uri, extra });
|
|
2907
2887
|
const resourcesContent = Array.isArray(resourcesOrResourceContent) ? resourcesOrResourceContent : [resourcesOrResourceContent];
|
|
2908
2888
|
const contents = resourcesContent.map((resourceContent) => {
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2889
|
+
if ("text" in resourceContent && resourceContent.text !== void 0) {
|
|
2890
|
+
return {
|
|
2891
|
+
uri: resource.uri,
|
|
2892
|
+
mimeType: resource.mimeType,
|
|
2893
|
+
text: resourceContent.text
|
|
2894
|
+
};
|
|
2915
2895
|
}
|
|
2916
|
-
|
|
2917
|
-
|
|
2896
|
+
const blob = resourceContent.blob;
|
|
2897
|
+
if (blob === void 0) {
|
|
2898
|
+
throw new Error(`Resource '${uri}' returned content with neither text nor blob`);
|
|
2918
2899
|
}
|
|
2919
|
-
return
|
|
2900
|
+
return {
|
|
2901
|
+
uri: resource.uri,
|
|
2902
|
+
mimeType: resource.mimeType,
|
|
2903
|
+
blob
|
|
2904
|
+
};
|
|
2920
2905
|
});
|
|
2921
2906
|
const duration = Date.now() - startTime;
|
|
2922
2907
|
this.logger.info(`Resource '${uri}' read successfully in ${duration}ms.`);
|
|
@@ -2972,7 +2957,7 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
|
|
|
2972
2957
|
this.logger.debug("Handling ListPrompts request");
|
|
2973
2958
|
if (this.definedPrompts) {
|
|
2974
2959
|
return {
|
|
2975
|
-
prompts: this.definedPrompts
|
|
2960
|
+
prompts: this.definedPrompts
|
|
2976
2961
|
};
|
|
2977
2962
|
} else {
|
|
2978
2963
|
try {
|
|
@@ -2983,7 +2968,7 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
|
|
|
2983
2968
|
this.definedPrompts = prompts;
|
|
2984
2969
|
this.logger.debug(`Fetched and cached ${this.definedPrompts.length} prompts.`);
|
|
2985
2970
|
return {
|
|
2986
|
-
prompts: this.definedPrompts
|
|
2971
|
+
prompts: this.definedPrompts
|
|
2987
2972
|
};
|
|
2988
2973
|
} catch (error) {
|
|
2989
2974
|
this.logger.error("Error fetching prompts via listPrompts():", {
|
|
@@ -2999,19 +2984,14 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
|
|
|
2999
2984
|
types_js.GetPromptRequestSchema,
|
|
3000
2985
|
async (request, extra) => {
|
|
3001
2986
|
const startTime = Date.now();
|
|
3002
|
-
const { name,
|
|
2987
|
+
const { name, arguments: args } = request.params;
|
|
3003
2988
|
if (!this.definedPrompts) {
|
|
3004
2989
|
const prompts = await this.promptOptions?.listPrompts?.({ extra });
|
|
3005
2990
|
if (!prompts) throw new Error("Failed to load prompts");
|
|
3006
2991
|
this.definedPrompts = prompts;
|
|
3007
2992
|
}
|
|
3008
|
-
|
|
3009
|
-
if (
|
|
3010
|
-
prompt = this.definedPrompts?.find((p) => p.name === name && p.version === version);
|
|
3011
|
-
} else {
|
|
3012
|
-
prompt = this.definedPrompts?.find((p) => p.name === name);
|
|
3013
|
-
}
|
|
3014
|
-
if (!prompt) throw new Error(`Prompt "${name}"${version ? ` (version ${version})` : ""} not found`);
|
|
2993
|
+
const prompt = this.definedPrompts?.find((p) => p.name === name);
|
|
2994
|
+
if (!prompt) throw new Error(`Prompt "${name}" not found`);
|
|
3015
2995
|
if (prompt.arguments) {
|
|
3016
2996
|
for (const arg of prompt.arguments) {
|
|
3017
2997
|
if (arg.required && (args?.[arg.name] === void 0 || args?.[arg.name] === null)) {
|
|
@@ -3022,13 +3002,11 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
|
|
|
3022
3002
|
try {
|
|
3023
3003
|
let messages = [];
|
|
3024
3004
|
if (capturedPromptOptions.getPromptMessages) {
|
|
3025
|
-
messages = await capturedPromptOptions.getPromptMessages({ name, version, args, extra });
|
|
3005
|
+
messages = await capturedPromptOptions.getPromptMessages({ name, version: prompt.version, args, extra });
|
|
3026
3006
|
}
|
|
3027
3007
|
const duration = Date.now() - startTime;
|
|
3028
|
-
this.logger.info(
|
|
3029
|
-
|
|
3030
|
-
);
|
|
3031
|
-
return { prompt, messages };
|
|
3008
|
+
this.logger.info(`Prompt '${name}' retrieved successfully in ${duration}ms.`);
|
|
3009
|
+
return { description: prompt.description, messages };
|
|
3032
3010
|
} catch (error) {
|
|
3033
3011
|
const duration = Date.now() - startTime;
|
|
3034
3012
|
this.logger.error(`Failed to get content for prompt '${name}' in ${duration}ms`, { error });
|