@mastra/mcp 0.0.0-commonjs-20250227130920

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.
@@ -0,0 +1,23 @@
1
+
2
+ > @mastra/mcp@0.2.5-alpha.0 build C:\Users\Ward\projects\mastra\mastra\packages\mcp
3
+ > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.3.6
8
+ TSC Build start
9
+ TSC ⚡️ Build success in 2674ms
10
+ DTS Build start
11
+ CLI Target: es2022
12
+ Analysis will use the bundled TypeScript version 5.7.3
13
+ Writing package typings: C:\Users\Ward\projects\mastra\mastra\packages\mcp\dist\_tsup-dts-rollup.d.ts
14
+ Analysis will use the bundled TypeScript version 5.7.3
15
+ Writing package typings: C:\Users\Ward\projects\mastra\mastra\packages\mcp\dist\_tsup-dts-rollup.d.cts
16
+ DTS ⚡️ Build success in 3251ms
17
+ CLI Cleaning output folder
18
+ ESM Build start
19
+ CJS Build start
20
+ CJS dist\index.cjs 2.21 KB
21
+ CJS ⚡️ Build success in 202ms
22
+ ESM dist\index.js 2.19 KB
23
+ ESM ⚡️ Build success in 203ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,736 @@
1
+ # @mastra/mcp
2
+
3
+ ## 0.0.0-commonjs-20250227130920
4
+
5
+ ### Patch Changes
6
+
7
+ - 4a712fc: Add support for commonjs
8
+ - Updated dependencies [ed55f1d]
9
+ - Updated dependencies [06aa827]
10
+ - Updated dependencies [8d13b14]
11
+ - Updated dependencies [4a712fc]
12
+ - Updated dependencies [108793c]
13
+ - Updated dependencies [5f28f44]
14
+ - @mastra/core@0.0.0-commonjs-20250227130920
15
+
16
+ ## 0.2.5-alpha.0
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [06aa827]
21
+ - @mastra/core@0.4.3-alpha.0
22
+
23
+ ## 0.2.4
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [7fceae1]
28
+ - Updated dependencies [8d94c3e]
29
+ - Updated dependencies [99dcdb5]
30
+ - Updated dependencies [6cb63e0]
31
+ - Updated dependencies [f626fbb]
32
+ - Updated dependencies [e752340]
33
+ - Updated dependencies [eb91535]
34
+ - @mastra/core@0.4.2
35
+
36
+ ## 0.2.4-alpha.2
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [8d94c3e]
41
+ - Updated dependencies [99dcdb5]
42
+ - Updated dependencies [e752340]
43
+ - Updated dependencies [eb91535]
44
+ - @mastra/core@0.4.2-alpha.2
45
+
46
+ ## 0.2.4-alpha.1
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [6cb63e0]
51
+ - @mastra/core@0.4.2-alpha.1
52
+
53
+ ## 0.2.4-alpha.0
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [7fceae1]
58
+ - Updated dependencies [f626fbb]
59
+ - @mastra/core@0.4.2-alpha.0
60
+
61
+ ## 0.2.3
62
+
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [ce44b9b]
66
+ - Updated dependencies [967da43]
67
+ - Updated dependencies [b405f08]
68
+ - @mastra/core@0.4.1
69
+
70
+ ## 0.2.2
71
+
72
+ ### Patch Changes
73
+
74
+ - Updated dependencies [2fc618f]
75
+ - Updated dependencies [fe0fd01]
76
+ - @mastra/core@0.4.0
77
+
78
+ ## 0.2.2-alpha.1
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [fe0fd01]
83
+ - @mastra/core@0.4.0-alpha.1
84
+
85
+ ## 0.2.2-alpha.0
86
+
87
+ ### Patch Changes
88
+
89
+ - Updated dependencies [2fc618f]
90
+ - @mastra/core@0.4.0-alpha.0
91
+
92
+ ## 0.2.1
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies [f205ede]
97
+ - @mastra/core@0.3.0
98
+
99
+ ## 0.2.0
100
+
101
+ ### Minor Changes
102
+
103
+ - 5b7d6fa: Added support for SSE MCP servers in the Mastra MCP client
104
+
105
+ ## 0.2.0-alpha.0
106
+
107
+ ### Minor Changes
108
+
109
+ - 5b7d6fa: Added support for SSE MCP servers in the Mastra MCP client
110
+
111
+ ## 0.1.1
112
+
113
+ ### Patch Changes
114
+
115
+ - 91ef439: Add eslint and ran autofix
116
+ - Updated dependencies [d59f1a8]
117
+ - Updated dependencies [91ef439]
118
+ - Updated dependencies [4a25be4]
119
+ - Updated dependencies [bf2e88f]
120
+ - Updated dependencies [2f0d707]
121
+ - Updated dependencies [aac1667]
122
+ - @mastra/core@0.2.1
123
+
124
+ ## 0.1.1-alpha.0
125
+
126
+ ### Patch Changes
127
+
128
+ - 91ef439: Add eslint and ran autofix
129
+ - Updated dependencies [d59f1a8]
130
+ - Updated dependencies [91ef439]
131
+ - Updated dependencies [4a25be4]
132
+ - Updated dependencies [bf2e88f]
133
+ - Updated dependencies [2f0d707]
134
+ - Updated dependencies [aac1667]
135
+ - @mastra/core@0.2.1-alpha.0
136
+
137
+ ## 0.1.0
138
+
139
+ ### Minor Changes
140
+
141
+ - 5916f9d: Update deps from fixed to ^
142
+ - 8b416d9: Breaking changes
143
+
144
+ ### Patch Changes
145
+
146
+ - e18cb18: MCP client
147
+ - bdaf834: publish packages
148
+ - b97ca96: Tracing into default storage
149
+ - 8468b7f: @mastra/mcp tsup bundling
150
+ - 9c10484: update all packages
151
+ - 70dabd9: Fix broken publish
152
+ - 0d5a03d: Vector store modules
153
+ - 9625602: Use mastra core splitted bundles in other packages
154
+ - 4f1d1a1: Enforce types ann cleanup package.json
155
+ - Updated dependencies [f537e33]
156
+ - Updated dependencies [6f2c0f5]
157
+ - Updated dependencies [e4d4ede]
158
+ - Updated dependencies [0be7181]
159
+ - Updated dependencies [dd6d87f]
160
+ - Updated dependencies [9029796]
161
+ - Updated dependencies [6fa4bd2]
162
+ - Updated dependencies [f031a1f]
163
+ - Updated dependencies [8151f44]
164
+ - Updated dependencies [d7d465a]
165
+ - Updated dependencies [4d4f6b6]
166
+ - Updated dependencies [73d112c]
167
+ - Updated dependencies [592e3cf]
168
+ - Updated dependencies [9d1796d]
169
+ - Updated dependencies [e897f1c]
170
+ - Updated dependencies [4a54c82]
171
+ - Updated dependencies [3967e69]
172
+ - Updated dependencies [8ae2bbc]
173
+ - Updated dependencies [e9d1b47]
174
+ - Updated dependencies [016493a]
175
+ - Updated dependencies [bc40916]
176
+ - Updated dependencies [93a3719]
177
+ - Updated dependencies [7d83b92]
178
+ - Updated dependencies [9fb3039]
179
+ - Updated dependencies [d5e12de]
180
+ - Updated dependencies [e1dd94a]
181
+ - Updated dependencies [07c069d]
182
+ - Updated dependencies [5cdfb88]
183
+ - Updated dependencies [837a288]
184
+ - Updated dependencies [685108a]
185
+ - Updated dependencies [c8ff2f5]
186
+ - Updated dependencies [5fdc87c]
187
+ - Updated dependencies [ae7bf94]
188
+ - Updated dependencies [8e7814f]
189
+ - Updated dependencies [66a03ec]
190
+ - Updated dependencies [7d87a15]
191
+ - Updated dependencies [b97ca96]
192
+ - Updated dependencies [23dcb23]
193
+ - Updated dependencies [033eda6]
194
+ - Updated dependencies [8105fae]
195
+ - Updated dependencies [e097800]
196
+ - Updated dependencies [1944807]
197
+ - Updated dependencies [30322ce]
198
+ - Updated dependencies [1874f40]
199
+ - Updated dependencies [685108a]
200
+ - Updated dependencies [f7d1131]
201
+ - Updated dependencies [79acad0]
202
+ - Updated dependencies [7a19083]
203
+ - Updated dependencies [382f4dc]
204
+ - Updated dependencies [1ebd071]
205
+ - Updated dependencies [0b74006]
206
+ - Updated dependencies [2f17a5f]
207
+ - Updated dependencies [f368477]
208
+ - Updated dependencies [7892533]
209
+ - Updated dependencies [9c10484]
210
+ - Updated dependencies [b726bf5]
211
+ - Updated dependencies [70dabd9]
212
+ - Updated dependencies [21fe536]
213
+ - Updated dependencies [176bc42]
214
+ - Updated dependencies [401a4d9]
215
+ - Updated dependencies [2e099d2]
216
+ - Updated dependencies [0b826f6]
217
+ - Updated dependencies [d68b532]
218
+ - Updated dependencies [75bf3f0]
219
+ - Updated dependencies [e6d8055]
220
+ - Updated dependencies [e2e76de]
221
+ - Updated dependencies [ccbc581]
222
+ - Updated dependencies [5950de5]
223
+ - Updated dependencies [fe3dcb0]
224
+ - Updated dependencies [78eec7c]
225
+ - Updated dependencies [a8a459a]
226
+ - Updated dependencies [0be7181]
227
+ - Updated dependencies [7b87567]
228
+ - Updated dependencies [b524c22]
229
+ - Updated dependencies [d7d465a]
230
+ - Updated dependencies [df843d3]
231
+ - Updated dependencies [4534e77]
232
+ - Updated dependencies [d6d8159]
233
+ - Updated dependencies [0bd142c]
234
+ - Updated dependencies [9625602]
235
+ - Updated dependencies [72d1990]
236
+ - Updated dependencies [f6ba259]
237
+ - Updated dependencies [2712098]
238
+ - Updated dependencies [eedb829]
239
+ - Updated dependencies [5285356]
240
+ - Updated dependencies [74b3078]
241
+ - Updated dependencies [cb290ee]
242
+ - Updated dependencies [b4d7416]
243
+ - Updated dependencies [e608d8c]
244
+ - Updated dependencies [06b2c0a]
245
+ - Updated dependencies [002d6d8]
246
+ - Updated dependencies [e448a26]
247
+ - Updated dependencies [8b416d9]
248
+ - Updated dependencies [fd494a3]
249
+ - Updated dependencies [dc90663]
250
+ - Updated dependencies [c872875]
251
+ - Updated dependencies [3c4488b]
252
+ - Updated dependencies [a7b016d]
253
+ - Updated dependencies [fd75f3c]
254
+ - Updated dependencies [7f24c29]
255
+ - Updated dependencies [2017553]
256
+ - Updated dependencies [a10b7a3]
257
+ - Updated dependencies [cf6d825]
258
+ - Updated dependencies [963c15a]
259
+ - Updated dependencies [7365b6c]
260
+ - Updated dependencies [5ee67d3]
261
+ - Updated dependencies [d38f7a6]
262
+ - Updated dependencies [38b7f66]
263
+ - Updated dependencies [2fa7f53]
264
+ - Updated dependencies [1420ae2]
265
+ - Updated dependencies [f6da688]
266
+ - Updated dependencies [3700be1]
267
+ - Updated dependencies [9ade36e]
268
+ - Updated dependencies [10870bc]
269
+ - Updated dependencies [2b01511]
270
+ - Updated dependencies [a870123]
271
+ - Updated dependencies [ccf115c]
272
+ - Updated dependencies [04434b6]
273
+ - Updated dependencies [5811de6]
274
+ - Updated dependencies [9f3ab05]
275
+ - Updated dependencies [66a5392]
276
+ - Updated dependencies [4b1ce2c]
277
+ - Updated dependencies [14064f2]
278
+ - Updated dependencies [f5dfa20]
279
+ - Updated dependencies [327ece7]
280
+ - Updated dependencies [da2e8d3]
281
+ - Updated dependencies [95a4697]
282
+ - Updated dependencies [d5fccfb]
283
+ - Updated dependencies [3427b95]
284
+ - Updated dependencies [538a136]
285
+ - Updated dependencies [e66643a]
286
+ - Updated dependencies [b5393f1]
287
+ - Updated dependencies [d2cd535]
288
+ - Updated dependencies [c2dd6b5]
289
+ - Updated dependencies [67637ba]
290
+ - Updated dependencies [836f4e3]
291
+ - Updated dependencies [5ee2e78]
292
+ - Updated dependencies [cd02c56]
293
+ - Updated dependencies [01502b0]
294
+ - Updated dependencies [16e5b04]
295
+ - Updated dependencies [d9c8dd0]
296
+ - Updated dependencies [9fb59d6]
297
+ - Updated dependencies [a9345f9]
298
+ - Updated dependencies [99f1847]
299
+ - Updated dependencies [04f3171]
300
+ - Updated dependencies [8769a62]
301
+ - Updated dependencies [d5ec619]
302
+ - Updated dependencies [27275c9]
303
+ - Updated dependencies [ae7bf94]
304
+ - Updated dependencies [4f1d1a1]
305
+ - Updated dependencies [ee4de15]
306
+ - Updated dependencies [202d404]
307
+ - Updated dependencies [a221426]
308
+ - @mastra/core@0.2.0
309
+
310
+ ## 0.1.0-alpha.52
311
+
312
+ ### Patch Changes
313
+
314
+ - Updated dependencies [016493a]
315
+ - Updated dependencies [382f4dc]
316
+ - Updated dependencies [176bc42]
317
+ - Updated dependencies [d68b532]
318
+ - Updated dependencies [fe3dcb0]
319
+ - Updated dependencies [e448a26]
320
+ - Updated dependencies [fd75f3c]
321
+ - Updated dependencies [ccf115c]
322
+ - Updated dependencies [a221426]
323
+ - @mastra/core@0.2.0-alpha.110
324
+
325
+ ## 0.1.0-alpha.51
326
+
327
+ ### Patch Changes
328
+
329
+ - Updated dependencies [d5fccfb]
330
+ - @mastra/core@0.2.0-alpha.109
331
+
332
+ ## 0.1.0-alpha.50
333
+
334
+ ### Patch Changes
335
+
336
+ - Updated dependencies [5ee67d3]
337
+ - Updated dependencies [95a4697]
338
+ - @mastra/core@0.2.0-alpha.108
339
+
340
+ ## 0.1.0-alpha.49
341
+
342
+ ### Patch Changes
343
+
344
+ - Updated dependencies [66a5392]
345
+ - @mastra/core@0.2.0-alpha.107
346
+
347
+ ## 0.1.0-alpha.48
348
+
349
+ ### Patch Changes
350
+
351
+ - Updated dependencies [6f2c0f5]
352
+ - Updated dependencies [a8a459a]
353
+ - @mastra/core@0.2.0-alpha.106
354
+
355
+ ## 0.1.0-alpha.47
356
+
357
+ ### Patch Changes
358
+
359
+ - Updated dependencies [1420ae2]
360
+ - Updated dependencies [99f1847]
361
+ - @mastra/core@0.2.0-alpha.105
362
+
363
+ ## 0.1.0-alpha.46
364
+
365
+ ### Patch Changes
366
+
367
+ - b97ca96: Tracing into default storage
368
+ - Updated dependencies [5fdc87c]
369
+ - Updated dependencies [b97ca96]
370
+ - Updated dependencies [72d1990]
371
+ - Updated dependencies [cf6d825]
372
+ - Updated dependencies [10870bc]
373
+ - @mastra/core@0.2.0-alpha.104
374
+
375
+ ## 0.1.0-alpha.45
376
+
377
+ ### Patch Changes
378
+
379
+ - Updated dependencies [4534e77]
380
+ - @mastra/core@0.2.0-alpha.103
381
+
382
+ ## 0.1.0-alpha.44
383
+
384
+ ### Patch Changes
385
+
386
+ - Updated dependencies [a9345f9]
387
+ - @mastra/core@0.2.0-alpha.102
388
+
389
+ ## 0.1.0-alpha.43
390
+
391
+ ### Patch Changes
392
+
393
+ - 4f1d1a1: Enforce types ann cleanup package.json
394
+ - Updated dependencies [66a03ec]
395
+ - Updated dependencies [4f1d1a1]
396
+ - @mastra/core@0.2.0-alpha.101
397
+
398
+ ## 0.1.0-alpha.42
399
+
400
+ ### Patch Changes
401
+
402
+ - Updated dependencies [9d1796d]
403
+ - @mastra/core@0.2.0-alpha.100
404
+
405
+ ## 0.1.0-alpha.41
406
+
407
+ ### Patch Changes
408
+
409
+ - Updated dependencies [7d83b92]
410
+ - @mastra/core@0.2.0-alpha.99
411
+
412
+ ## 0.1.0-alpha.40
413
+
414
+ ### Patch Changes
415
+
416
+ - 70dabd9: Fix broken publish
417
+ - Updated dependencies [70dabd9]
418
+ - Updated dependencies [202d404]
419
+ - @mastra/core@0.2.0-alpha.98
420
+
421
+ ## 0.1.0-alpha.39
422
+
423
+ ### Patch Changes
424
+
425
+ - Updated dependencies [07c069d]
426
+ - Updated dependencies [7892533]
427
+ - Updated dependencies [e6d8055]
428
+ - Updated dependencies [5950de5]
429
+ - Updated dependencies [df843d3]
430
+ - Updated dependencies [a870123]
431
+ - @mastra/core@0.2.0-alpha.97
432
+
433
+ ## 0.1.0-alpha.38
434
+
435
+ ### Patch Changes
436
+
437
+ - Updated dependencies [74b3078]
438
+ - @mastra/core@0.2.0-alpha.96
439
+
440
+ ## 0.1.0-alpha.37
441
+
442
+ ### Patch Changes
443
+
444
+ - Updated dependencies [9fb59d6]
445
+ - @mastra/core@0.2.0-alpha.95
446
+
447
+ ## 0.1.0-alpha.36
448
+
449
+ ### Minor Changes
450
+
451
+ - 8b416d9: Breaking changes
452
+
453
+ ### Patch Changes
454
+
455
+ - 9c10484: update all packages
456
+ - Updated dependencies [9c10484]
457
+ - Updated dependencies [8b416d9]
458
+ - @mastra/core@0.2.0-alpha.94
459
+
460
+ ## 0.1.0-alpha.35
461
+
462
+ ### Patch Changes
463
+
464
+ - Updated dependencies [5285356]
465
+ - @mastra/core@0.2.0-alpha.93
466
+
467
+ ## 0.1.0-alpha.34
468
+
469
+ ### Patch Changes
470
+
471
+ - Updated dependencies [4d4f6b6]
472
+ - @mastra/core@0.2.0-alpha.92
473
+
474
+ ## 0.1.0-alpha.33
475
+
476
+ ### Patch Changes
477
+
478
+ - Updated dependencies [d7d465a]
479
+ - Updated dependencies [d7d465a]
480
+ - Updated dependencies [2017553]
481
+ - Updated dependencies [a10b7a3]
482
+ - Updated dependencies [16e5b04]
483
+ - @mastra/core@0.2.0-alpha.91
484
+
485
+ ## 0.1.0-alpha.32
486
+
487
+ ### Patch Changes
488
+
489
+ - Updated dependencies [8151f44]
490
+ - Updated dependencies [e897f1c]
491
+ - Updated dependencies [3700be1]
492
+ - @mastra/core@0.2.0-alpha.90
493
+
494
+ ## 0.1.0-alpha.31
495
+
496
+ ### Patch Changes
497
+
498
+ - Updated dependencies [27275c9]
499
+ - @mastra/core@0.2.0-alpha.89
500
+
501
+ ## 0.1.0-alpha.30
502
+
503
+ ### Patch Changes
504
+
505
+ - Updated dependencies [ccbc581]
506
+ - @mastra/core@0.2.0-alpha.88
507
+
508
+ ## 0.1.0-alpha.29
509
+
510
+ ### Patch Changes
511
+
512
+ - Updated dependencies [7365b6c]
513
+ - @mastra/core@0.2.0-alpha.87
514
+
515
+ ## 0.1.0-alpha.28
516
+
517
+ ### Minor Changes
518
+
519
+ - 5916f9d: Update deps from fixed to ^
520
+
521
+ ### Patch Changes
522
+
523
+ - Updated dependencies [6fa4bd2]
524
+ - Updated dependencies [e2e76de]
525
+ - Updated dependencies [7f24c29]
526
+ - Updated dependencies [67637ba]
527
+ - Updated dependencies [04f3171]
528
+ - @mastra/core@0.2.0-alpha.86
529
+
530
+ ## 0.0.1-alpha.27
531
+
532
+ ### Patch Changes
533
+
534
+ - Updated dependencies [e9d1b47]
535
+ - @mastra/core@0.2.0-alpha.85
536
+
537
+ ## 0.0.1-alpha.26
538
+
539
+ ### Patch Changes
540
+
541
+ - Updated dependencies [2f17a5f]
542
+ - Updated dependencies [cb290ee]
543
+ - Updated dependencies [b4d7416]
544
+ - Updated dependencies [38b7f66]
545
+ - @mastra/core@0.2.0-alpha.84
546
+
547
+ ## 0.0.1-alpha.25
548
+
549
+ ### Patch Changes
550
+
551
+ - 9625602: Use mastra core splitted bundles in other packages
552
+ - Updated dependencies [30322ce]
553
+ - Updated dependencies [78eec7c]
554
+ - Updated dependencies [9625602]
555
+ - Updated dependencies [8769a62]
556
+ - @mastra/core@0.2.0-alpha.83
557
+
558
+ ## 0.0.1-alpha.24
559
+
560
+ ### Patch Changes
561
+
562
+ - Updated dependencies [73d112c]
563
+ - @mastra/core@0.1.27-alpha.82
564
+
565
+ ## 0.0.1-alpha.23
566
+
567
+ ### Patch Changes
568
+
569
+ - Updated dependencies [9fb3039]
570
+ - @mastra/core@0.1.27-alpha.81
571
+
572
+ ## 0.0.1-alpha.22
573
+
574
+ ### Patch Changes
575
+
576
+ - Updated dependencies [327ece7]
577
+ - @mastra/core@0.1.27-alpha.80
578
+
579
+ ## 0.0.1-alpha.21
580
+
581
+ ### Patch Changes
582
+
583
+ - Updated dependencies [21fe536]
584
+ - @mastra/core@0.1.27-alpha.79
585
+
586
+ ## 0.0.1-alpha.20
587
+
588
+ ### Patch Changes
589
+
590
+ - Updated dependencies [685108a]
591
+ - Updated dependencies [685108a]
592
+ - @mastra/core@0.1.27-alpha.78
593
+
594
+ ## 0.0.1-alpha.19
595
+
596
+ ### Patch Changes
597
+
598
+ - 8468b7f: @mastra/mcp tsup bundling
599
+ - Updated dependencies [8105fae]
600
+ - @mastra/core@0.1.27-alpha.77
601
+
602
+ ## 0.0.1-alpha.18
603
+
604
+ ### Patch Changes
605
+
606
+ - Updated dependencies [ae7bf94]
607
+ - Updated dependencies [ae7bf94]
608
+ - @mastra/core@0.1.27-alpha.76
609
+
610
+ ## 0.0.1-alpha.17
611
+
612
+ ### Patch Changes
613
+
614
+ - Updated dependencies [23dcb23]
615
+ - @mastra/core@0.1.27-alpha.75
616
+
617
+ ## 0.0.1-alpha.16
618
+
619
+ ### Patch Changes
620
+
621
+ - Updated dependencies [7b87567]
622
+ - @mastra/core@0.1.27-alpha.74
623
+
624
+ ## 0.0.1-alpha.15
625
+
626
+ ### Patch Changes
627
+
628
+ - Updated dependencies [3427b95]
629
+ - @mastra/core@0.1.27-alpha.73
630
+
631
+ ## 0.0.1-alpha.14
632
+
633
+ ### Patch Changes
634
+
635
+ - Updated dependencies [e4d4ede]
636
+ - Updated dependencies [06b2c0a]
637
+ - @mastra/core@0.1.27-alpha.72
638
+
639
+ ## 0.0.1-alpha.13
640
+
641
+ ### Patch Changes
642
+
643
+ - Updated dependencies [d9c8dd0]
644
+ - @mastra/core@0.1.27-alpha.71
645
+
646
+ ## 0.0.1-alpha.12
647
+
648
+ ### Patch Changes
649
+
650
+ - bdaf834: publish packages
651
+
652
+ ## 0.0.1-alpha.11
653
+
654
+ ### Patch Changes
655
+
656
+ - Updated dependencies [dd6d87f]
657
+ - Updated dependencies [04434b6]
658
+ - @mastra/core@0.1.27-alpha.70
659
+
660
+ ## 0.0.1-alpha.10
661
+
662
+ ### Patch Changes
663
+
664
+ - 0d5a03d: Vector store modules
665
+
666
+ ## 0.0.1-alpha.9
667
+
668
+ ### Patch Changes
669
+
670
+ - Updated dependencies [1944807]
671
+ - Updated dependencies [9ade36e]
672
+ - @mastra/core@0.1.27-alpha.69
673
+
674
+ ## 0.0.1-alpha.8
675
+
676
+ ### Patch Changes
677
+
678
+ - Updated dependencies [0be7181]
679
+ - Updated dependencies [0be7181]
680
+ - @mastra/core@0.1.27-alpha.68
681
+
682
+ ## 0.0.1-alpha.7
683
+
684
+ ### Patch Changes
685
+
686
+ - Updated dependencies [c8ff2f5]
687
+ - @mastra/core@0.1.27-alpha.67
688
+
689
+ ## 0.0.1-alpha.6
690
+
691
+ ### Patch Changes
692
+
693
+ - Updated dependencies [14064f2]
694
+ - @mastra/core@0.1.27-alpha.66
695
+
696
+ ## 0.0.1-alpha.5
697
+
698
+ ### Patch Changes
699
+
700
+ - Updated dependencies [e66643a]
701
+ - @mastra/core@0.1.27-alpha.65
702
+
703
+ ## 0.0.1-alpha.4
704
+
705
+ ### Patch Changes
706
+
707
+ - Updated dependencies [f368477]
708
+ - Updated dependencies [d5ec619]
709
+ - @mastra/core@0.1.27-alpha.64
710
+
711
+ ## 0.0.1-alpha.3
712
+
713
+ ### Patch Changes
714
+
715
+ - Updated dependencies [e097800]
716
+ - @mastra/core@0.1.27-alpha.63
717
+
718
+ ## 0.0.1-alpha.2
719
+
720
+ ### Patch Changes
721
+
722
+ - Updated dependencies [93a3719]
723
+ - @mastra/core@0.1.27-alpha.62
724
+
725
+ ## 0.0.1-alpha.1
726
+
727
+ ### Patch Changes
728
+
729
+ - Updated dependencies [dc90663]
730
+ - @mastra/core@0.1.27-alpha.61
731
+
732
+ ## 0.0.1-alpha.0
733
+
734
+ ### Patch Changes
735
+
736
+ - e18cb18: MCP client
package/LICENSE ADDED
@@ -0,0 +1,44 @@
1
+ Elastic License 2.0 (ELv2)
2
+
3
+ **Acceptance**
4
+ By using the software, you agree to all of the terms and conditions below.
5
+
6
+ **Copyright License**
7
+ The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
8
+
9
+ **Limitations**
10
+ You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
11
+
12
+ You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
13
+
14
+ You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
15
+
16
+ **Patents**
17
+ The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
18
+
19
+ **Notices**
20
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
21
+
22
+ If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
23
+
24
+ **No Other Rights**
25
+ These terms do not imply any licenses other than those expressly granted in these terms.
26
+
27
+ **Termination**
28
+ If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
29
+
30
+ **No Liability**
31
+ As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
32
+
33
+ **Definitions**
34
+ The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
35
+
36
+ _you_ refers to the individual or entity agreeing to these terms.
37
+
38
+ _your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
39
+
40
+ _your licenses_ are all the licenses granted to you for the software under these terms.
41
+
42
+ _use_ means anything you do with the software requiring one of your licenses.
43
+
44
+ _trademark_ means trademarks, service marks, and similar rights.
package/README.md ADDED
@@ -0,0 +1,135 @@
1
+ # @mastra/mcp
2
+
3
+ Model Context Protocol (MCP) client implementation for Mastra, providing seamless integration with MCP-compatible AI models and tools.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/mcp
9
+ ```
10
+
11
+ ## Overview
12
+
13
+ The `@mastra/mcp` package provides a client implementation for the Model Context Protocol (MCP), enabling Mastra to communicate with MCP-compatible AI models and tools. It wraps the official `@modelcontextprotocol/sdk` and provides Mastra-specific functionality.
14
+
15
+ ## Usage
16
+
17
+ ```typescript
18
+ import { MastraMCPClient } from '@mastra/mcp';
19
+
20
+ // Create a client with stdio server
21
+ const stdioClient = new MastraMCPClient({
22
+ name: 'my-stdio-client',
23
+ version: '1.0.0', // optional
24
+ server: {
25
+ command: 'your-mcp-server-command',
26
+ args: ['--your', 'args'],
27
+ },
28
+ capabilities: {}, // optional ClientCapabilities
29
+ });
30
+
31
+ // Or create a client with SSE server
32
+ const sseClient = new MastraMCPClient({
33
+ name: 'my-sse-client',
34
+ version: '1.0.0',
35
+ server: {
36
+ url: new URL('https://your-mcp-server.com/sse'),
37
+ requestInit: {
38
+ headers: { Authorization: 'Bearer your-token' },
39
+ },
40
+ },
41
+ });
42
+
43
+ // Connect to the MCP server
44
+ await client.connect();
45
+
46
+ // List available resources
47
+ const resources = await client.resources();
48
+
49
+ // Get available tools
50
+ const tools = await client.tools();
51
+
52
+ // Disconnect when done
53
+ await client.disconnect();
54
+ ```
55
+
56
+ ## Configuration
57
+
58
+ ### Required Parameters
59
+
60
+ - `name`: Name of the MCP client instance
61
+ - `server`: Either a StdioServerParameters or SSEClientParameters object:
62
+
63
+ #### StdioServerParameters
64
+
65
+ - `command`: Command to start the MCP server
66
+ - `args`: Array of command arguments
67
+
68
+ #### SSEClientParameters
69
+
70
+ - `url`: URL instance pointing to the SSE server
71
+ - `requestInit`: Optional fetch request configuration
72
+ - `eventSourceInit`: Optional EventSource configuration
73
+
74
+ ### Optional Parameters
75
+
76
+ - `version`: Client version (default: '1.0.0')
77
+ - `capabilities`: ClientCapabilities object for specifying supported features
78
+
79
+ ## Features
80
+
81
+ - Standard MCP client implementation
82
+ - Automatic tool conversion to Mastra format
83
+ - Resource discovery and management
84
+ - Multiple transport layers:
85
+ - Stdio-based for local servers
86
+ - SSE-based for remote servers
87
+ - Automatic error handling and logging
88
+ - Tool execution with context
89
+
90
+ ## Methods
91
+
92
+ ### `connect()`
93
+
94
+ Establishes connection with the MCP server.
95
+
96
+ ### `disconnect()`
97
+
98
+ Closes the connection with the MCP server.
99
+
100
+ ### `resources()`
101
+
102
+ Lists available resources from the MCP server.
103
+
104
+ ### `tools()`
105
+
106
+ Retrieves and converts MCP tools to Mastra-compatible format.
107
+
108
+ ## Tool Conversion
109
+
110
+ The package automatically converts MCP tools to Mastra's format:
111
+
112
+ ```typescript
113
+ const tools = await client.tools();
114
+ // Returns: { [toolName: string]: MastraTool }
115
+
116
+ // Each tool includes:
117
+ // - Converted JSON schema
118
+ // - Mastra-compatible execution wrapper
119
+ // - Error handling
120
+ // - Automatic context passing
121
+ ```
122
+
123
+ ## Error Handling
124
+
125
+ The client includes comprehensive error handling:
126
+
127
+ - Connection errors
128
+ - Tool execution errors
129
+ - Resource listing errors
130
+ - Schema conversion errors
131
+
132
+ ## Related Links
133
+
134
+ - [Model Context Protocol Specification](https://github.com/modelcontextprotocol/spec)
135
+ - [@modelcontextprotocol/sdk Documentation](https://github.com/modelcontextprotocol/sdk)
@@ -0,0 +1,28 @@
1
+ import type { ClientCapabilities } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { Protocol } from '@modelcontextprotocol/sdk/shared/protocol.js';
3
+ import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
4
+ import type { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
5
+
6
+ declare class MastraMCPClient {
7
+ name: string;
8
+ private transport;
9
+ private client;
10
+ constructor({ name, version, server, capabilities, }: {
11
+ name: string;
12
+ server: StdioServerParameters | SSEClientParameters;
13
+ capabilities?: ClientCapabilities;
14
+ version?: string;
15
+ });
16
+ connect(): Promise<void>;
17
+ disconnect(): Promise<void>;
18
+ resources(): Promise<ReturnType<Protocol<any, any, any>['request']>>;
19
+ tools(): Promise<Record<string, any>>;
20
+ }
21
+ export { MastraMCPClient }
22
+ export { MastraMCPClient as MastraMCPClient_alias_1 }
23
+
24
+ declare type SSEClientParameters = {
25
+ url: URL;
26
+ } & ConstructorParameters<typeof SSEClientTransport>[1];
27
+
28
+ export { }
@@ -0,0 +1,28 @@
1
+ import type { ClientCapabilities } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { Protocol } from '@modelcontextprotocol/sdk/shared/protocol.js';
3
+ import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
4
+ import type { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
5
+
6
+ declare class MastraMCPClient {
7
+ name: string;
8
+ private transport;
9
+ private client;
10
+ constructor({ name, version, server, capabilities, }: {
11
+ name: string;
12
+ server: StdioServerParameters | SSEClientParameters;
13
+ capabilities?: ClientCapabilities;
14
+ version?: string;
15
+ });
16
+ connect(): Promise<void>;
17
+ disconnect(): Promise<void>;
18
+ resources(): Promise<ReturnType<Protocol<any, any, any>['request']>>;
19
+ tools(): Promise<Record<string, any>>;
20
+ }
21
+ export { MastraMCPClient }
22
+ export { MastraMCPClient as MastraMCPClient_alias_1 }
23
+
24
+ declare type SSEClientParameters = {
25
+ url: URL;
26
+ } & ConstructorParameters<typeof SSEClientTransport>[1];
27
+
28
+ export { }
package/dist/index.cjs ADDED
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ var tools = require('@mastra/core/tools');
4
+ var utils = require('@mastra/core/utils');
5
+ var index_js = require('@modelcontextprotocol/sdk/client/index.js');
6
+ var sse_js = require('@modelcontextprotocol/sdk/client/sse.js');
7
+ var stdio_js = require('@modelcontextprotocol/sdk/client/stdio.js');
8
+ var types_js = require('@modelcontextprotocol/sdk/types.js');
9
+
10
+ // src/client.ts
11
+ var MastraMCPClient = class {
12
+ name;
13
+ transport;
14
+ client;
15
+ constructor({
16
+ name,
17
+ version = "1.0.0",
18
+ server,
19
+ capabilities = {}
20
+ }) {
21
+ this.name = name;
22
+ if (`url` in server) {
23
+ this.transport = new sse_js.SSEClientTransport(server.url, {
24
+ requestInit: server.requestInit,
25
+ eventSourceInit: server.eventSourceInit
26
+ });
27
+ } else {
28
+ this.transport = new stdio_js.StdioClientTransport(server);
29
+ }
30
+ this.client = new index_js.Client(
31
+ {
32
+ name,
33
+ version
34
+ },
35
+ {
36
+ capabilities
37
+ }
38
+ );
39
+ }
40
+ async connect() {
41
+ return await this.client.connect(this.transport);
42
+ }
43
+ async disconnect() {
44
+ return await this.client.close();
45
+ }
46
+ // TODO: do the type magic to return the right method type. Right now we get infinitely deep infered type errors from Zod without using "any"
47
+ async resources() {
48
+ return await this.client.request({ method: "resources/list" }, types_js.ListResourcesResultSchema);
49
+ }
50
+ async tools() {
51
+ const { tools: tools$1 } = await this.client.listTools();
52
+ const toolsRes = {};
53
+ tools$1.forEach((tool) => {
54
+ const s = utils.jsonSchemaToModel(tool.inputSchema);
55
+ const mastraTool = tools.createTool({
56
+ id: `${this.name}_${tool.name}`,
57
+ description: tool.description,
58
+ inputSchema: s,
59
+ execute: async ({ context }) => {
60
+ try {
61
+ const res = await this.client.callTool({
62
+ name: tool.name,
63
+ arguments: context
64
+ });
65
+ return res;
66
+ } catch (e) {
67
+ console.log("Error calling tool", tool.name);
68
+ console.error(e);
69
+ throw e;
70
+ }
71
+ }
72
+ });
73
+ if (tool.name) {
74
+ toolsRes[tool.name] = mastraTool;
75
+ }
76
+ });
77
+ return toolsRes;
78
+ }
79
+ };
80
+
81
+ exports.MastraMCPClient = MastraMCPClient;
@@ -0,0 +1 @@
1
+ export { MastraMCPClient_alias_1 as MastraMCPClient } from './_tsup-dts-rollup.cjs';
@@ -0,0 +1 @@
1
+ export { MastraMCPClient_alias_1 as MastraMCPClient } from './_tsup-dts-rollup.js';
package/dist/index.js ADDED
@@ -0,0 +1,79 @@
1
+ import { createTool } from '@mastra/core/tools';
2
+ import { jsonSchemaToModel } from '@mastra/core/utils';
3
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
4
+ import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
5
+ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
6
+ import { ListResourcesResultSchema } from '@modelcontextprotocol/sdk/types.js';
7
+
8
+ // src/client.ts
9
+ var MastraMCPClient = class {
10
+ name;
11
+ transport;
12
+ client;
13
+ constructor({
14
+ name,
15
+ version = "1.0.0",
16
+ server,
17
+ capabilities = {}
18
+ }) {
19
+ this.name = name;
20
+ if (`url` in server) {
21
+ this.transport = new SSEClientTransport(server.url, {
22
+ requestInit: server.requestInit,
23
+ eventSourceInit: server.eventSourceInit
24
+ });
25
+ } else {
26
+ this.transport = new StdioClientTransport(server);
27
+ }
28
+ this.client = new Client(
29
+ {
30
+ name,
31
+ version
32
+ },
33
+ {
34
+ capabilities
35
+ }
36
+ );
37
+ }
38
+ async connect() {
39
+ return await this.client.connect(this.transport);
40
+ }
41
+ async disconnect() {
42
+ return await this.client.close();
43
+ }
44
+ // TODO: do the type magic to return the right method type. Right now we get infinitely deep infered type errors from Zod without using "any"
45
+ async resources() {
46
+ return await this.client.request({ method: "resources/list" }, ListResourcesResultSchema);
47
+ }
48
+ async tools() {
49
+ const { tools } = await this.client.listTools();
50
+ const toolsRes = {};
51
+ tools.forEach((tool) => {
52
+ const s = jsonSchemaToModel(tool.inputSchema);
53
+ const mastraTool = createTool({
54
+ id: `${this.name}_${tool.name}`,
55
+ description: tool.description,
56
+ inputSchema: s,
57
+ execute: async ({ context }) => {
58
+ try {
59
+ const res = await this.client.callTool({
60
+ name: tool.name,
61
+ arguments: context
62
+ });
63
+ return res;
64
+ } catch (e) {
65
+ console.log("Error calling tool", tool.name);
66
+ console.error(e);
67
+ throw e;
68
+ }
69
+ }
70
+ });
71
+ if (tool.name) {
72
+ toolsRes[tool.name] = mastraTool;
73
+ }
74
+ });
75
+ return toolsRes;
76
+ }
77
+ };
78
+
79
+ export { MastraMCPClient };
@@ -0,0 +1,6 @@
1
+ import { createConfig } from '@internal/lint/eslint';
2
+
3
+ const config = await createConfig();
4
+
5
+ /** @type {import("eslint").Linter.Config[]} */
6
+ export default [...config];
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@mastra/mcp",
3
+ "version": "0.0.0-commonjs-20250227130920",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.cts",
16
+ "default": "./dist/index.cjs"
17
+ }
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
21
+ "keywords": [],
22
+ "author": "",
23
+ "license": "ISC",
24
+ "dependencies": {
25
+ "@modelcontextprotocol/sdk": "^1.1.1",
26
+ "date-fns": "^4.1.0",
27
+ "zod": "^3.24.1",
28
+ "@mastra/core": "^0.0.0-commonjs-20250227130920"
29
+ },
30
+ "devDependencies": {
31
+ "@ai-sdk/anthropic": "^1.1.6",
32
+ "@microsoft/api-extractor": "^7.49.2",
33
+ "@types/node": "^22.13.1",
34
+ "tsup": "^8.0.1",
35
+ "typescript": "^5.7.3",
36
+ "vitest": "^3.0.4",
37
+ "eslint": "^9.20.1",
38
+ "@internal/lint": "0.0.0"
39
+ },
40
+ "scripts": {
41
+ "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake",
42
+ "build:watch": "pnpm build --watch",
43
+ "test": "vitest run",
44
+ "lint": "eslint ."
45
+ }
46
+ }
@@ -0,0 +1,51 @@
1
+ import { anthropic } from '@ai-sdk/anthropic';
2
+ import { Agent } from '@mastra/core/agent';
3
+ import { describe, it, expect, beforeAll, afterAll } from 'vitest';
4
+
5
+ import { MastraMCPClient } from './client.js';
6
+
7
+ const everArtClient = new MastraMCPClient({
8
+ name: 'everart',
9
+ server: {
10
+ command: '/usr/local/bin/docker',
11
+ args: ['run', '-i', '--rm', '--network=host', '-e', 'EVERART_API_KEY', 'mcp/everart'],
12
+ env: {
13
+ EVERART_API_KEY: process.env.EVERART_API_KEY!,
14
+ },
15
+ },
16
+ });
17
+
18
+ const agent = new Agent({
19
+ name: 'everart',
20
+ instructions: 'You are my artist. Include the url in your response.',
21
+ model: anthropic('claude-3-5-sonnet-20241022'),
22
+ });
23
+
24
+ describe.skip('MastraMCPClient', () => {
25
+ beforeAll(async () => {
26
+ await everArtClient.connect();
27
+ });
28
+
29
+ afterAll(async () => {
30
+ await everArtClient.disconnect();
31
+ });
32
+
33
+ it('Converting tools into Mastra', async () => {
34
+ const list = await everArtClient.resources();
35
+
36
+ expect(list.resources.length).toBeGreaterThan(0);
37
+
38
+ // The MCP server tools are now available to your Mastra Agents
39
+ const tools = await everArtClient.tools();
40
+
41
+ const response = await agent.generate('Can you make me a picture of a dog?', {
42
+ toolsets: {
43
+ everart: tools,
44
+ },
45
+ });
46
+
47
+ console.log(response.text);
48
+
49
+ expect(Object.keys(tools).length).toBeGreaterThan(0);
50
+ }, 50000);
51
+ });
package/src/client.ts ADDED
@@ -0,0 +1,99 @@
1
+ import { createTool } from '@mastra/core/tools';
2
+ import { jsonSchemaToModel } from '@mastra/core/utils';
3
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
4
+ import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
5
+ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
6
+ import type { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
7
+ import type { Protocol } from '@modelcontextprotocol/sdk/shared/protocol.js';
8
+ import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
9
+ import type { ClientCapabilities } from '@modelcontextprotocol/sdk/types.js';
10
+ import { ListResourcesResultSchema } from '@modelcontextprotocol/sdk/types.js';
11
+
12
+ type SSEClientParameters = {
13
+ url: URL;
14
+ } & ConstructorParameters<typeof SSEClientTransport>[1];
15
+
16
+ export class MastraMCPClient {
17
+ name: string;
18
+ private transport: Transport;
19
+ private client: Client;
20
+ constructor({
21
+ name,
22
+ version = '1.0.0',
23
+ server,
24
+ capabilities = {},
25
+ }: {
26
+ name: string;
27
+ server: StdioServerParameters | SSEClientParameters;
28
+ capabilities?: ClientCapabilities;
29
+ version?: string;
30
+ }) {
31
+ this.name = name;
32
+
33
+ if (`url` in server) {
34
+ this.transport = new SSEClientTransport(server.url, {
35
+ requestInit: server.requestInit,
36
+ eventSourceInit: server.eventSourceInit,
37
+ });
38
+ } else {
39
+ this.transport = new StdioClientTransport(server);
40
+ }
41
+
42
+ this.client = new Client(
43
+ {
44
+ name,
45
+ version,
46
+ },
47
+ {
48
+ capabilities,
49
+ },
50
+ );
51
+ }
52
+
53
+ async connect() {
54
+ return await this.client.connect(this.transport);
55
+ }
56
+
57
+ async disconnect() {
58
+ return await this.client.close();
59
+ }
60
+
61
+ // TODO: do the type magic to return the right method type. Right now we get infinitely deep infered type errors from Zod without using "any"
62
+
63
+ async resources(): Promise<ReturnType<Protocol<any, any, any>['request']>> {
64
+ return await this.client.request({ method: 'resources/list' }, ListResourcesResultSchema);
65
+ }
66
+
67
+ async tools() {
68
+ const { tools } = await this.client.listTools();
69
+ const toolsRes: Record<string, any> = {};
70
+ tools.forEach(tool => {
71
+ const s = jsonSchemaToModel(tool.inputSchema);
72
+ const mastraTool = createTool({
73
+ id: `${this.name}_${tool.name}`,
74
+ description: tool.description,
75
+ inputSchema: s,
76
+ execute: async ({ context }) => {
77
+ try {
78
+ const res = await this.client.callTool({
79
+ name: tool.name,
80
+ arguments: context,
81
+ });
82
+
83
+ return res;
84
+ } catch (e) {
85
+ console.log('Error calling tool', tool.name);
86
+ console.error(e);
87
+ throw e;
88
+ }
89
+ },
90
+ });
91
+
92
+ if (tool.name) {
93
+ toolsRes[tool.name] = mastraTool;
94
+ }
95
+ });
96
+
97
+ return toolsRes;
98
+ }
99
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './client';
package/tsconfig.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "../../tsconfig.node.json",
3
+ "include": ["src/**/*"],
4
+ "exclude": ["node_modules", "**/*.test.ts"]
5
+ }
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ include: ['src/**/*.test.ts'],
7
+ },
8
+ });