@mastra/mcp 0.5.1-alpha.0 → 0.10.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 +7 -7
- package/CHANGELOG.md +51 -0
- package/dist/index.cjs +1 -2
- package/dist/index.js +2 -3
- package/integration-tests/node_modules/.bin/mastra +21 -0
- package/integration-tests/package.json +5 -2
- package/package.json +6 -5
- package/src/client.ts +3 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/mcp@0.
|
|
2
|
+
> @mastra/mcp@0.10.0-alpha.1 build /home/runner/work/mastra/mastra/packages/mcp
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.4.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 16704ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/mcp/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/mcp/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 13376ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
20
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m36.96 KB[39m
|
|
21
|
+
[32mCJS[39m ⚡️ Build success in 1440ms
|
|
22
|
+
[32mESM[39m [1mdist/index.js [22m[32m36.64 KB[39m
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 1440ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @mastra/mcp
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 83da932: Move @mastra/core to peerdeps
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 0a3ae6d: Fixed a bug where tool input schema properties that were optional became required
|
|
12
|
+
- 23f258c: Add new list and get routes for mcp servers. Changed route make-up for more consistency with existing API routes. Lastly, added in a lot of extra detail that can be optionally passed to the mcp server per the mcp spec.
|
|
13
|
+
- 2672a05: Add MCP servers and tool call execution to playground
|
|
14
|
+
- Updated dependencies [b3a3d63]
|
|
15
|
+
- Updated dependencies [344f453]
|
|
16
|
+
- Updated dependencies [0a3ae6d]
|
|
17
|
+
- Updated dependencies [95911be]
|
|
18
|
+
- Updated dependencies [f53a6ac]
|
|
19
|
+
- Updated dependencies [5eb5a99]
|
|
20
|
+
- Updated dependencies [7e632c5]
|
|
21
|
+
- Updated dependencies [1e9fbfa]
|
|
22
|
+
- Updated dependencies [eabdcd9]
|
|
23
|
+
- Updated dependencies [90be034]
|
|
24
|
+
- Updated dependencies [99f050a]
|
|
25
|
+
- Updated dependencies [d0ee3c6]
|
|
26
|
+
- Updated dependencies [b2ae5aa]
|
|
27
|
+
- Updated dependencies [23f258c]
|
|
28
|
+
- Updated dependencies [a7292b0]
|
|
29
|
+
- Updated dependencies [0dcb9f0]
|
|
30
|
+
- Updated dependencies [2672a05]
|
|
31
|
+
- @mastra/core@0.10.0
|
|
32
|
+
|
|
33
|
+
## 0.6.0-alpha.1
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- 83da932: Move @mastra/core to peerdeps
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 0a3ae6d: Fixed a bug where tool input schema properties that were optional became required
|
|
42
|
+
- Updated dependencies [b3a3d63]
|
|
43
|
+
- Updated dependencies [344f453]
|
|
44
|
+
- Updated dependencies [0a3ae6d]
|
|
45
|
+
- Updated dependencies [95911be]
|
|
46
|
+
- Updated dependencies [5eb5a99]
|
|
47
|
+
- Updated dependencies [7e632c5]
|
|
48
|
+
- Updated dependencies [1e9fbfa]
|
|
49
|
+
- Updated dependencies [b2ae5aa]
|
|
50
|
+
- Updated dependencies [a7292b0]
|
|
51
|
+
- Updated dependencies [0dcb9f0]
|
|
52
|
+
- @mastra/core@0.10.0-alpha.1
|
|
53
|
+
|
|
3
54
|
## 0.5.1-alpha.0
|
|
4
55
|
|
|
5
56
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -244,8 +244,7 @@ var InternalMastraMCPClient = class extends base.MastraBase {
|
|
|
244
244
|
return inputSchema;
|
|
245
245
|
}
|
|
246
246
|
try {
|
|
247
|
-
|
|
248
|
-
return zod.z.object(rawShape);
|
|
247
|
+
return zodFromJsonSchema.convertJsonSchemaToZod(inputSchema);
|
|
249
248
|
} catch (error) {
|
|
250
249
|
let errorDetails;
|
|
251
250
|
if (error instanceof Error) {
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { DEFAULT_REQUEST_TIMEOUT_MSEC } from '@modelcontextprotocol/sdk/shared/p
|
|
|
9
9
|
import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesResultSchema, CallToolResultSchema, JSONRPCMessageSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
10
10
|
import { asyncExitHook, gracefulExit } from 'exit-hook';
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
-
import {
|
|
12
|
+
import { convertJsonSchemaToZod } from 'zod-from-json-schema';
|
|
13
13
|
import equal from 'fast-deep-equal';
|
|
14
14
|
import { v5 } from 'uuid';
|
|
15
15
|
import { randomUUID } from 'crypto';
|
|
@@ -238,8 +238,7 @@ var InternalMastraMCPClient = class extends MastraBase {
|
|
|
238
238
|
return inputSchema;
|
|
239
239
|
}
|
|
240
240
|
try {
|
|
241
|
-
|
|
242
|
-
return z.object(rawShape);
|
|
241
|
+
return convertJsonSchemaToZod(inputSchema);
|
|
243
242
|
} catch (error) {
|
|
244
243
|
let errorDetails;
|
|
245
244
|
if (error instanceof Error) {
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"@ai-sdk/openai": "^1.3.21",
|
|
11
11
|
"@ai-sdk/react": "^1.2.11",
|
|
12
12
|
"@mastra/client-js": "workspace:*",
|
|
13
|
-
"@mastra/core": "workspace:*",
|
|
14
13
|
"@mastra/mcp": "workspace:*",
|
|
15
14
|
"dotenv": "^16.5.0",
|
|
16
15
|
"zod": "^3.24.3"
|
|
@@ -20,6 +19,10 @@
|
|
|
20
19
|
"@types/node": "^20.17.27",
|
|
21
20
|
"mastra": "workspace:*",
|
|
22
21
|
"typescript": "^5.8.2",
|
|
23
|
-
"vitest": "^1.6.1"
|
|
22
|
+
"vitest": "^1.6.1",
|
|
23
|
+
"@mastra/core": "workspace:*"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@mastra/core": "^0.10.0"
|
|
24
27
|
}
|
|
25
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"fast-deep-equal": "^3.1.3",
|
|
29
29
|
"hono": "^4.7.4",
|
|
30
30
|
"uuid": "^11.1.0",
|
|
31
|
-
"zod-from-json-schema": "^0.0.5"
|
|
32
|
-
"@mastra/core": "^0.9.5-alpha.0"
|
|
31
|
+
"zod-from-json-schema": "^0.0.5"
|
|
33
32
|
},
|
|
34
33
|
"peerDependencies": {
|
|
35
|
-
"zod": "^3.0.0"
|
|
34
|
+
"zod": "^3.0.0",
|
|
35
|
+
"@mastra/core": "^0.10.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@ai-sdk/anthropic": "^1.1.15",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"vitest": "^3.1.2",
|
|
50
50
|
"zod": "^3.24.3",
|
|
51
51
|
"zod-to-json-schema": "^3.24.5",
|
|
52
|
-
"@internal/lint": "0.0.
|
|
52
|
+
"@internal/lint": "0.0.6",
|
|
53
|
+
"@mastra/core": "0.10.0"
|
|
53
54
|
},
|
|
54
55
|
"scripts": {
|
|
55
56
|
"build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
|
package/src/client.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MastraBase } from '@mastra/core/base';
|
|
2
|
+
|
|
2
3
|
import type { RuntimeContext } from '@mastra/core/di';
|
|
3
4
|
import { createTool } from '@mastra/core/tools';
|
|
4
5
|
import { isZodType } from '@mastra/core/utils';
|
|
@@ -13,10 +14,9 @@ import type { Protocol } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
|
13
14
|
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
14
15
|
import type { ClientCapabilities, LoggingLevel } from '@modelcontextprotocol/sdk/types.js';
|
|
15
16
|
import { CallToolResultSchema, ListResourcesResultSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
16
|
-
|
|
17
17
|
import { asyncExitHook, gracefulExit } from 'exit-hook';
|
|
18
18
|
import { z } from 'zod';
|
|
19
|
-
import {
|
|
19
|
+
import { convertJsonSchemaToZod } from 'zod-from-json-schema';
|
|
20
20
|
import type { JSONSchema } from 'zod-from-json-schema';
|
|
21
21
|
|
|
22
22
|
// Re-export MCP SDK LoggingLevel for convenience
|
|
@@ -334,9 +334,7 @@ export class InternalMastraMCPClient extends MastraBase {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
try {
|
|
337
|
-
|
|
338
|
-
const rawShape = jsonSchemaObjectToZodRawShape(inputSchema as JSONSchema);
|
|
339
|
-
return z.object(rawShape); // Wrap the raw shape to return a ZodType (object)
|
|
337
|
+
return convertJsonSchemaToZod(inputSchema as JSONSchema);
|
|
340
338
|
} catch (error: unknown) {
|
|
341
339
|
let errorDetails: string | undefined;
|
|
342
340
|
if (error instanceof Error) {
|