@mastra/mcp 0.11.4 → 0.12.0-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 +13 -0
- package/dist/index.cjs +6 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -58
- package/dist/index.js.map +1 -1
- package/dist/server/server.d.ts +5 -5
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/types.d.ts +1 -62
- package/dist/server/types.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @mastra/mcp
|
|
2
2
|
|
|
3
|
+
## 0.12.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Update core peerdeps ([#7535](https://github.com/mastra-ai/mastra/pull/7535))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Revert "feat(mcp): add createMCPTool helper for proper execute types" ([#7513](https://github.com/mastra-ai/mastra/pull/7513))
|
|
12
|
+
|
|
13
|
+
- 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)]:
|
|
14
|
+
- @mastra/core@0.16.1-alpha.0
|
|
15
|
+
|
|
3
16
|
## 0.11.4
|
|
4
17
|
|
|
5
18
|
### 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|