@mastra/mcp 0.11.4 → 0.12.0-alpha.1

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,27 @@
1
1
  # @mastra/mcp
2
2
 
3
+ ## 0.12.0-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - dependencies updates: ([#7527](https://github.com/mastra-ai/mastra/pull/7527))
8
+ - Updated dependency [`@modelcontextprotocol/sdk@^1.17.5` ↗︎](https://www.npmjs.com/package/@modelcontextprotocol/sdk/v/1.17.5) (from `^1.17.3`, in `dependencies`)
9
+ - Updated dependencies [[`47b6dc9`](https://github.com/mastra-ai/mastra/commit/47b6dc94f4976d4f3d3882e8f19eb365bbc5976c), [`565d65f`](https://github.com/mastra-ai/mastra/commit/565d65fc16314a99f081975ec92f2636dff0c86d), [`4da3d68`](https://github.com/mastra-ai/mastra/commit/4da3d68a778e5c4d5a17351ef223289fe2f45a45), [`0b0bbb2`](https://github.com/mastra-ai/mastra/commit/0b0bbb24f4198ead69792e92b68a350f52b45cf3), [`d951f41`](https://github.com/mastra-ai/mastra/commit/d951f41771e4e5da8da4b9f870949f9509e38756), [`8049e2e`](https://github.com/mastra-ai/mastra/commit/8049e2e8cce80a00353c64894c62b695ac34e35e)]:
10
+ - @mastra/core@0.16.1-alpha.1
11
+
12
+ ## 0.12.0-alpha.0
13
+
14
+ ### Minor Changes
15
+
16
+ - Update core peerdeps ([#7535](https://github.com/mastra-ai/mastra/pull/7535))
17
+
18
+ ### Patch Changes
19
+
20
+ - Revert "feat(mcp): add createMCPTool helper for proper execute types" ([#7513](https://github.com/mastra-ai/mastra/pull/7513))
21
+
22
+ - Updated dependencies [[`0662d02`](https://github.com/mastra-ai/mastra/commit/0662d02ef16916e67531890639fcd72c69cfb6e2), [`6189844`](https://github.com/mastra-ai/mastra/commit/61898448e65bda02bb814fb15801a89dc6476938), [`d7a8f59`](https://github.com/mastra-ai/mastra/commit/d7a8f59154b0621aec4f41a6b2ea2b3882f03cb7), [`4dda259`](https://github.com/mastra-ai/mastra/commit/4dda2593b6343f9258671de5fb237aeba3ef6bb7), [`defed1c`](https://github.com/mastra-ai/mastra/commit/defed1ca8040cc8d42e645c5a50a1bc52a4918d7), [`6991ced`](https://github.com/mastra-ai/mastra/commit/6991cedcb5a44a49d9fe58ef67926e1f96ba55b1), [`9cb9c42`](https://github.com/mastra-ai/mastra/commit/9cb9c422854ee81074989dd2d8dccc0500ba8d3e), [`8334859`](https://github.com/mastra-ai/mastra/commit/83348594d4f37b311ba4a94d679c5f8721d796d4)]:
23
+ - @mastra/core@0.16.1-alpha.0
24
+
3
25
  ## 0.11.4
4
26
 
5
27
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1084,7 +1084,7 @@ var MCPConfiguration = class extends MCPClient {
1084
1084
  }
1085
1085
  };
1086
1086
 
1087
- // ../../node_modules/.pnpm/hono@4.8.12/node_modules/hono/dist/utils/stream.js
1087
+ // ../../node_modules/.pnpm/hono@4.9.6/node_modules/hono/dist/utils/stream.js
1088
1088
  var StreamingApi = class {
1089
1089
  writer;
1090
1090
  encoder;
@@ -1151,7 +1151,7 @@ var StreamingApi = class {
1151
1151
  }
1152
1152
  };
1153
1153
 
1154
- // ../../node_modules/.pnpm/hono@4.8.12/node_modules/hono/dist/helper/streaming/utils.js
1154
+ // ../../node_modules/.pnpm/hono@4.9.6/node_modules/hono/dist/helper/streaming/utils.js
1155
1155
  var isOldBunVersion = () => {
1156
1156
  const version = typeof Bun !== "undefined" ? Bun.version : void 0;
1157
1157
  if (version === void 0) {
@@ -1162,7 +1162,7 @@ var isOldBunVersion = () => {
1162
1162
  return result;
1163
1163
  };
1164
1164
 
1165
- // ../../node_modules/.pnpm/hono@4.8.12/node_modules/hono/dist/utils/html.js
1165
+ // ../../node_modules/.pnpm/hono@4.9.6/node_modules/hono/dist/utils/html.js
1166
1166
  var HtmlEscapedCallbackPhase = {
1167
1167
  Stringify: 1};
1168
1168
  var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
@@ -1193,7 +1193,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
1193
1193
  }
1194
1194
  };
1195
1195
 
1196
- // ../../node_modules/.pnpm/hono@4.8.12/node_modules/hono/dist/helper/streaming/sse.js
1196
+ // ../../node_modules/.pnpm/hono@4.9.6/node_modules/hono/dist/helper/streaming/sse.js
1197
1197
  var SSEStreamingApi = class extends StreamingApi {
1198
1198
  constructor(writable, readable) {
1199
1199
  super(writable, readable);
@@ -2024,7 +2024,7 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
2024
2024
  /**
2025
2025
  * Convert and validate all provided tools, logging registration status.
2026
2026
  * Also converts agents and workflows into tools.
2027
- * @param tools Tool definitions (supports ToolsInput, MCPToolsInput)
2027
+ * @param tools Tool definitions
2028
2028
  * @param agentsConfig Agent definitions to be converted to tools, expected from MCPServerConfig
2029
2029
  * @param workflowsConfig Workflow definitions to be converted to tools, expected from MCPServerConfig
2030
2030
  * @returns Converted tools registry
@@ -2057,7 +2057,7 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
2057
2057
  outputSchema: coreTool.outputSchema,
2058
2058
  execute: coreTool.execute
2059
2059
  };
2060
- this.logger.info(`Registered tool: '${toolName}'`);
2060
+ this.logger.info(`Registered explicit tool: '${toolName}'`);
2061
2061
  }
2062
2062
  this.logger.info(`Total defined tools registered: ${Object.keys(definedConvertedTools).length}`);
2063
2063
  let agentDerivedTools = {};
@@ -2650,61 +2650,10 @@ Provided arguments: ${JSON.stringify(args, null, 2)}`,
2650
2650
  }
2651
2651
  }
2652
2652
  };
2653
- function createMCPTool(opts) {
2654
- let parameters;
2655
- let outputSchema;
2656
- if (opts.inputSchema) {
2657
- parameters = {
2658
- jsonSchema: opts.inputSchema,
2659
- validate: (value) => {
2660
- try {
2661
- const result = opts.inputSchema.safeParse(value);
2662
- return result.success ? { success: true, value: result.data } : { success: false, error: result.error };
2663
- } catch (e) {
2664
- return { success: false, error: e };
2665
- }
2666
- }
2667
- };
2668
- } else {
2669
- parameters = void 0;
2670
- }
2671
- if (opts.outputSchema) {
2672
- outputSchema = {
2673
- jsonSchema: opts.outputSchema,
2674
- validate: (value) => {
2675
- try {
2676
- const result = opts.outputSchema.safeParse(value);
2677
- return result.success ? { success: true, value: result.data } : { success: false, error: result.error };
2678
- } catch (e) {
2679
- return { success: false, error: e };
2680
- }
2681
- }
2682
- };
2683
- }
2684
- return {
2685
- id: opts.id,
2686
- description: opts.description,
2687
- parameters,
2688
- outputSchema,
2689
- execute: async (params, options) => {
2690
- const mcpOptions = {
2691
- context: params,
2692
- elicitation: options.elicitation,
2693
- extra: options.extra
2694
- };
2695
- const { data, error } = tools.validateToolInput(opts.inputSchema, params, opts.id);
2696
- if (error) {
2697
- return error;
2698
- }
2699
- return opts.execute(data, mcpOptions);
2700
- }
2701
- };
2702
- }
2703
2653
 
2704
2654
  exports.MCPClient = MCPClient;
2705
2655
  exports.MCPConfiguration = MCPConfiguration;
2706
2656
  exports.MCPServer = MCPServer;
2707
2657
  exports.MastraMCPClient = MastraMCPClient;
2708
- exports.createMCPTool = createMCPTool;
2709
2658
  //# sourceMappingURL=index.cjs.map
2710
2659
  //# sourceMappingURL=index.cjs.map