@mastra/mcp 1.3.1-alpha.1 → 1.3.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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # @mastra/mcp
2
2
 
3
+ ## 1.3.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed MCP server returning confusing output schema errors when tool input fails Zod validation but passes JSON Schema validation. The server now correctly returns `isError: true` with the validation error message. ([#14853](https://github.com/mastra-ai/mastra/pull/14853))
8
+
9
+ - Updated dependencies [[`fbf22a7`](https://github.com/mastra-ai/mastra/commit/fbf22a7ad86bcb50dcf30459f0d075e51ddeb468), [`04160ee`](https://github.com/mastra-ai/mastra/commit/04160eedf3130003cf842ad08428c8ff69af4cc1), [`2c27503`](https://github.com/mastra-ai/mastra/commit/2c275032510d131d2cde47f99953abf0fe02c081), [`424a1df`](https://github.com/mastra-ai/mastra/commit/424a1df7bee59abb5c83717a54807fdd674a6224), [`12c88a6`](https://github.com/mastra-ai/mastra/commit/12c88a6e32bf982c2fe0c6af62e65a3414519a75), [`43595bf`](https://github.com/mastra-ai/mastra/commit/43595bf7b8df1a6edce7a23b445b5124d2a0b473), [`78670e9`](https://github.com/mastra-ai/mastra/commit/78670e97e76d7422cf7025faf371b2aeafed860d), [`d400e7c`](https://github.com/mastra-ai/mastra/commit/d400e7c8b8d7afa6ba2c71769eace4048e3cef8e), [`f58d1a7`](https://github.com/mastra-ai/mastra/commit/f58d1a7a457588a996c3ecb53201a68f3d28c432), [`a49a929`](https://github.com/mastra-ai/mastra/commit/a49a92904968b4fc67e01effee8c7c8d0464ba85)]:
10
+ - @mastra/core@1.18.0-alpha.4
11
+
12
+ ## 1.3.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Fixed MCP tool results to preserve the standard CallToolResult envelope shape. Previously, content was extracted from the envelope which broke consumers expecting the standard MCP result format. Output schema validation is now handled internally by the MCP SDK's AJV validator instead of Zod, preventing unrecognized keys from being stripped. ([#14519](https://github.com/mastra-ai/mastra/pull/14519))
17
+
18
+ - Fix MCP tool results returning empty `{}` when tool has no outputSchema ([#14372](https://github.com/mastra-ai/mastra/pull/14372))
19
+
20
+ - Fixed child processes started by the MCP client staying alive after the terminal session closes. ([#13977](https://github.com/mastra-ai/mastra/pull/13977))
21
+
22
+ - Fixed regular tools executed via MCPServer now receive `requestContext` populated from `mcp.extra`, matching the behavior of agent and workflow tools. All tool types now consistently propagate authentication and request context. ([#14349](https://github.com/mastra-ai/mastra/pull/14349))
23
+
24
+ - Updated dependencies [[`cb611a1`](https://github.com/mastra-ai/mastra/commit/cb611a1e89a4f4cf74c97b57e0c27bb56f2eceb5), [`da93115`](https://github.com/mastra-ai/mastra/commit/da931155c1a9bc63d455d3d86b4ec984db5991fe), [`62d1d3c`](https://github.com/mastra-ai/mastra/commit/62d1d3cc08fe8182e7080237fd975de862ec8c91), [`9e1a3ed`](https://github.com/mastra-ai/mastra/commit/9e1a3ed07cfafb5e8e19a796ce0bee817002d7c0), [`8681ecb`](https://github.com/mastra-ai/mastra/commit/8681ecb86184d5907267000e4576cc442a9a83fc), [`28d0249`](https://github.com/mastra-ai/mastra/commit/28d0249295782277040ad1e0d243e695b7ab1ce4), [`681ee1c`](https://github.com/mastra-ai/mastra/commit/681ee1c811359efd1b8bebc4bce35b9bb7b14bec), [`bb0f09d`](https://github.com/mastra-ai/mastra/commit/bb0f09dbac58401b36069f483acf5673202db5b5), [`a579f7a`](https://github.com/mastra-ai/mastra/commit/a579f7a31e582674862b5679bc79af7ccf7429b8), [`5f7e9d0`](https://github.com/mastra-ai/mastra/commit/5f7e9d0db664020e1f3d97d7d18c6b0b9d4843d0), [`d7f14c3`](https://github.com/mastra-ai/mastra/commit/d7f14c3285cd253ecdd5f58139b7b6cbdf3678b5), [`0efe12a`](https://github.com/mastra-ai/mastra/commit/0efe12a5f008a939a1aac71699486ba40138054e)]:
25
+ - @mastra/core@1.15.0
26
+
3
27
  ## 1.3.1-alpha.1
4
28
 
5
29
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-mcp
3
3
  description: Documentation for @mastra/mcp. Use when working with @mastra/mcp APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/mcp"
6
- version: "1.3.1-alpha.1"
6
+ version: "1.3.2-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.1-alpha.1",
2
+ "version": "1.3.2-alpha.0",
3
3
  "package": "@mastra/mcp",
4
4
  "exports": {
5
5
  "UnauthorizedError": {
@@ -901,7 +901,7 @@ const mcpClient = new MCPClient({
901
901
  const agent = new Agent({
902
902
  name: 'My Agent',
903
903
  instructions: 'You are a helpful assistant.',
904
- model: openai('gpt-4o'),
904
+ model: openai('gpt-5.4'),
905
905
  tools: await mcpClient.listTools(),
906
906
  })
907
907
 
package/dist/index.cjs CHANGED
@@ -2819,8 +2819,17 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
2819
2819
  }
2820
2820
  };
2821
2821
  const result = await tool.execute(validation?.value ?? request.params.arguments ?? {}, mcpOptions);
2822
- this.logger.debug(`CallTool: Tool '${request.params.name}' executed successfully with result:`, result);
2823
2822
  const duration = Date.now() - startTime;
2823
+ if (tools.isValidationError(result)) {
2824
+ this.logger.warn(`CallTool: Tool '${request.params.name}' returned a validation error in ${duration}ms.`, {
2825
+ error: result.message
2826
+ });
2827
+ return {
2828
+ content: [{ type: "text", text: result.message }],
2829
+ isError: true
2830
+ };
2831
+ }
2832
+ this.logger.debug(`CallTool: Tool '${request.params.name}' executed successfully with result:`, result);
2824
2833
  this.logger.info(`Tool '${request.params.name}' executed successfully in ${duration}ms.`);
2825
2834
  const response = { isError: false, content: [] };
2826
2835
  if (tool.outputSchema) {