@mastra/mcp 0.11.2 → 0.11.3-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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/client/client.d.ts.map +1 -1
- package/dist/index.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/client/client.ts +16 -3
- package/integration-tests/node_modules/.bin/mastra +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"exit-hook": "^4.0.0",
|
|
29
29
|
"fast-deep-equal": "^3.1.3",
|
|
30
30
|
"uuid": "^11.1.0",
|
|
31
|
-
"zod-from-json-schema": "^0.0
|
|
31
|
+
"zod-from-json-schema": "^0.5.0",
|
|
32
|
+
"zod-from-json-schema-v3": "npm:zod-from-json-schema@^0.0.5"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"@mastra/core": ">=0.15.2-0 <0.16.0-0",
|
|
@@ -52,8 +53,8 @@
|
|
|
52
53
|
"zod": "^3.25.67",
|
|
53
54
|
"zod-to-json-schema": "^3.24.5",
|
|
54
55
|
"@internal/lint": "0.0.34",
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
56
|
+
"@internal/types-builder": "0.0.9",
|
|
57
|
+
"@mastra/core": "0.15.3-alpha.0"
|
|
57
58
|
},
|
|
58
59
|
"scripts": {
|
|
59
60
|
"build": "tsup --silent --config tsup.config.ts",
|
package/src/client/client.ts
CHANGED
|
@@ -36,7 +36,8 @@ import {
|
|
|
36
36
|
import { asyncExitHook, gracefulExit } from 'exit-hook';
|
|
37
37
|
import { z } from 'zod';
|
|
38
38
|
import { convertJsonSchemaToZod } from 'zod-from-json-schema';
|
|
39
|
-
import
|
|
39
|
+
import { convertJsonSchemaToZod as convertJsonSchemaToZodV3 } from 'zod-from-json-schema-v3';
|
|
40
|
+
import type { JSONSchema } from 'zod-from-json-schema-v3';
|
|
40
41
|
import { ElicitationClientActions } from './elicitationActions';
|
|
41
42
|
import { PromptClientActions } from './promptActions';
|
|
42
43
|
import { ResourceClientActions } from './resourceActions';
|
|
@@ -479,7 +480,13 @@ export class InternalMastraMCPClient extends MastraBase {
|
|
|
479
480
|
|
|
480
481
|
try {
|
|
481
482
|
await $RefParser.dereference(inputSchema);
|
|
482
|
-
|
|
483
|
+
const jsonSchemaToConvert = ('jsonSchema' in inputSchema ? inputSchema.jsonSchema : inputSchema) as JSONSchema;
|
|
484
|
+
if ('toJSONSchema' in z) {
|
|
485
|
+
// @ts-expect-error - zod type issue
|
|
486
|
+
return convertJsonSchemaToZod(jsonSchemaToConvert);
|
|
487
|
+
} else {
|
|
488
|
+
return convertJsonSchemaToZodV3(jsonSchemaToConvert);
|
|
489
|
+
}
|
|
483
490
|
} catch (error: unknown) {
|
|
484
491
|
let errorDetails: string | undefined;
|
|
485
492
|
if (error instanceof Error) {
|
|
@@ -516,7 +523,13 @@ export class InternalMastraMCPClient extends MastraBase {
|
|
|
516
523
|
|
|
517
524
|
try {
|
|
518
525
|
await $RefParser.dereference(outputSchema);
|
|
519
|
-
|
|
526
|
+
const jsonSchemaToConvert = ('jsonSchema' in outputSchema ? outputSchema.jsonSchema : outputSchema) as JSONSchema;
|
|
527
|
+
if ('toJSONSchema' in z) {
|
|
528
|
+
// @ts-expect-error - zod type issue
|
|
529
|
+
return convertJsonSchemaToZod(jsonSchemaToConvert);
|
|
530
|
+
} else {
|
|
531
|
+
return convertJsonSchemaToZodV3(jsonSchemaToConvert);
|
|
532
|
+
}
|
|
520
533
|
} catch (error: unknown) {
|
|
521
534
|
let errorDetails: string | undefined;
|
|
522
535
|
if (error instanceof Error) {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/mastra/mastra/packages/cli/dist/node_modules:/home/runner/work/mastra/mastra/packages/cli/node_modules:/home/runner/work/mastra/mastra/packages/node_modules:/home/runner/work/mastra/mastra/node_modules:/home/runner/work/mastra/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/mastra/mastra/packages/cli/dist/node_modules:/home/runner/work/mastra/mastra/packages/cli/node_modules:/home/runner/work/mastra/mastra/packages/node_modules:/home/runner/work/mastra/mastra/node_modules:/home/runner/work/mastra/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../mastra/dist/index.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../mastra/dist/index.js" "$@"
|
|
21
|
-
fi
|