@mastra/mcp 0.10.1 → 0.10.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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/mcp@0.10.1-alpha.0 build /home/runner/work/mastra/mastra/packages/mcp
2
+ > @mastra/mcp@0.10.2-alpha.0 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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 19924ms
9
+ TSC ⚡️ Build success in 17973ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/packages/mcp/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/packages/mcp/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 19192ms
16
+ DTS ⚡️ Build success in 19496ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 58.17 KB
21
- ESM ⚡️ Build success in 1820ms
22
- CJS dist/index.cjs 58.38 KB
23
- CJS ⚡️ Build success in 1820ms
20
+ CJS dist/index.cjs 58.50 KB
21
+ CJS ⚡️ Build success in 1508ms
22
+ ESM dist/index.js 58.29 KB
23
+ ESM ⚡️ Build success in 1514ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @mastra/mcp
2
2
 
3
+ ## 0.10.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 592a2db: Added different icons for agents and workflows in mcp tools list
8
+ - Updated dependencies [592a2db]
9
+ - Updated dependencies [e5dc18d]
10
+ - @mastra/core@0.10.2-alpha.0
11
+
3
12
  ## 0.10.1
4
13
 
5
14
  ### Patch Changes
@@ -9,6 +9,7 @@ import { MCPServerBase } from '@mastra/core/mcp';
9
9
  import type { MCPServerConfig } from '@mastra/core/mcp';
10
10
  import type { MCPServerHonoSSEOptions } from '@mastra/core/mcp';
11
11
  import type { MCPServerSSEOptions } from '@mastra/core/mcp';
12
+ import type { MCPToolType } from '@mastra/core/mcp';
12
13
  import { objectInputType } from 'zod';
13
14
  import { objectOutputType } from 'zod';
14
15
  import { objectUtil } from 'zod';
@@ -486,6 +487,7 @@ declare class MCPServer extends MCPServerBase {
486
487
  name: string;
487
488
  description?: string;
488
489
  inputSchema: any;
490
+ toolType?: MCPToolType;
489
491
  }>;
490
492
  };
491
493
  /**
@@ -497,6 +499,7 @@ declare class MCPServer extends MCPServerBase {
497
499
  name: string;
498
500
  description?: string;
499
501
  inputSchema: any;
502
+ toolType?: MCPToolType;
500
503
  } | undefined;
501
504
  /**
502
505
  * Executes a specific tool provided by this MCP server.
@@ -9,6 +9,7 @@ import { MCPServerBase } from '@mastra/core/mcp';
9
9
  import type { MCPServerConfig } from '@mastra/core/mcp';
10
10
  import type { MCPServerHonoSSEOptions } from '@mastra/core/mcp';
11
11
  import type { MCPServerSSEOptions } from '@mastra/core/mcp';
12
+ import type { MCPToolType } from '@mastra/core/mcp';
12
13
  import { objectInputType } from 'zod';
13
14
  import { objectOutputType } from 'zod';
14
15
  import { objectUtil } from 'zod';
@@ -486,6 +487,7 @@ declare class MCPServer extends MCPServerBase {
486
487
  name: string;
487
488
  description?: string;
488
489
  inputSchema: any;
490
+ toolType?: MCPToolType;
489
491
  }>;
490
492
  };
491
493
  /**
@@ -497,6 +499,7 @@ declare class MCPServer extends MCPServerBase {
497
499
  name: string;
498
500
  description?: string;
499
501
  inputSchema: any;
502
+ toolType?: MCPToolType;
500
503
  } | undefined;
501
504
  /**
502
505
  * Executes a specific tool provided by this MCP server.
package/dist/index.cjs CHANGED
@@ -955,7 +955,8 @@ var MCPServer = class extends mcp.MCPServerBase {
955
955
  name: agentToolName,
956
956
  description: coreTool.description,
957
957
  parameters: coreTool.parameters,
958
- execute: coreTool.execute
958
+ execute: coreTool.execute,
959
+ toolType: "agent"
959
960
  };
960
961
  this.logger.info(`Registered agent '${agent$1.name}' (key: '${agentKey}') as tool: '${agentToolName}'`);
961
962
  }
@@ -1021,7 +1022,8 @@ var MCPServer = class extends mcp.MCPServerBase {
1021
1022
  name: workflowToolName,
1022
1023
  description: coreTool.description,
1023
1024
  parameters: coreTool.parameters,
1024
- execute: coreTool.execute
1025
+ execute: coreTool.execute,
1026
+ toolType: "workflow"
1025
1027
  };
1026
1028
  this.logger.info(`Registered workflow '${workflow.id}' (key: '${workflowKey}') as tool: '${workflowToolName}'`);
1027
1029
  }
@@ -1560,7 +1562,8 @@ var MCPServer = class extends mcp.MCPServerBase {
1560
1562
  id: toolId,
1561
1563
  name: tool.name,
1562
1564
  description: tool.description,
1563
- inputSchema: tool.parameters?.jsonSchema || tool.parameters
1565
+ inputSchema: tool.parameters?.jsonSchema || tool.parameters,
1566
+ toolType: tool.toolType
1564
1567
  }))
1565
1568
  };
1566
1569
  }
@@ -1579,7 +1582,8 @@ var MCPServer = class extends mcp.MCPServerBase {
1579
1582
  return {
1580
1583
  name: tool.name,
1581
1584
  description: tool.description,
1582
- inputSchema: tool.parameters?.jsonSchema || tool.parameters
1585
+ inputSchema: tool.parameters?.jsonSchema || tool.parameters,
1586
+ toolType: tool.toolType
1583
1587
  };
1584
1588
  }
1585
1589
  /**
package/dist/index.js CHANGED
@@ -949,7 +949,8 @@ var MCPServer = class extends MCPServerBase {
949
949
  name: agentToolName,
950
950
  description: coreTool.description,
951
951
  parameters: coreTool.parameters,
952
- execute: coreTool.execute
952
+ execute: coreTool.execute,
953
+ toolType: "agent"
953
954
  };
954
955
  this.logger.info(`Registered agent '${agent.name}' (key: '${agentKey}') as tool: '${agentToolName}'`);
955
956
  }
@@ -1015,7 +1016,8 @@ var MCPServer = class extends MCPServerBase {
1015
1016
  name: workflowToolName,
1016
1017
  description: coreTool.description,
1017
1018
  parameters: coreTool.parameters,
1018
- execute: coreTool.execute
1019
+ execute: coreTool.execute,
1020
+ toolType: "workflow"
1019
1021
  };
1020
1022
  this.logger.info(`Registered workflow '${workflow.id}' (key: '${workflowKey}') as tool: '${workflowToolName}'`);
1021
1023
  }
@@ -1554,7 +1556,8 @@ var MCPServer = class extends MCPServerBase {
1554
1556
  id: toolId,
1555
1557
  name: tool.name,
1556
1558
  description: tool.description,
1557
- inputSchema: tool.parameters?.jsonSchema || tool.parameters
1559
+ inputSchema: tool.parameters?.jsonSchema || tool.parameters,
1560
+ toolType: tool.toolType
1558
1561
  }))
1559
1562
  };
1560
1563
  }
@@ -1573,7 +1576,8 @@ var MCPServer = class extends MCPServerBase {
1573
1576
  return {
1574
1577
  name: tool.name,
1575
1578
  description: tool.description,
1576
- inputSchema: tool.parameters?.jsonSchema || tool.parameters
1579
+ inputSchema: tool.parameters?.jsonSchema || tool.parameters,
1580
+ toolType: tool.toolType
1577
1581
  };
1578
1582
  }
1579
1583
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp",
3
- "version": "0.10.1",
3
+ "version": "0.10.2-alpha.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -51,7 +51,7 @@
51
51
  "zod": "^3.24.3",
52
52
  "zod-to-json-schema": "^3.24.5",
53
53
  "@internal/lint": "0.0.7",
54
- "@mastra/core": "0.10.1"
54
+ "@mastra/core": "0.10.2-alpha.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -1077,7 +1077,7 @@ describe('MCPServer - Workflow to Tool Conversion', () => {
1077
1077
  const inputData = { data: 'Hello Workflow' };
1078
1078
  if (workflowTool && workflowTool.execute) {
1079
1079
  const result = await workflowTool.execute(inputData, { toolCallId: 'mcp-wf-call-123', messages: [] });
1080
- expect(result).toEqual({
1080
+ expect(result).toMatchObject({
1081
1081
  status: 'success',
1082
1082
  steps: {
1083
1083
  input: { data: 'Hello Workflow' },
@@ -12,6 +12,7 @@ import type {
12
12
  ConvertedTool,
13
13
  MCPServerHonoSSEOptions,
14
14
  MCPServerSSEOptions,
15
+ MCPToolType,
15
16
  } from '@mastra/core/mcp';
16
17
  import { RuntimeContext } from '@mastra/core/runtime-context';
17
18
  import type { Workflow } from '@mastra/core/workflows';
@@ -217,6 +218,7 @@ export class MCPServer extends MCPServerBase {
217
218
  description: coreTool.description,
218
219
  parameters: coreTool.parameters,
219
220
  execute: coreTool.execute!,
221
+ toolType: 'agent',
220
222
  };
221
223
  this.logger.info(`Registered agent '${agent.name}' (key: '${agentKey}') as tool: '${agentToolName}'`);
222
224
  }
@@ -295,6 +297,7 @@ export class MCPServer extends MCPServerBase {
295
297
  description: coreTool.description,
296
298
  parameters: coreTool.parameters,
297
299
  execute: coreTool.execute!,
300
+ toolType: 'workflow',
298
301
  };
299
302
  this.logger.info(`Registered workflow '${workflow.id}' (key: '${workflowKey}') as tool: '${workflowToolName}'`);
300
303
  }
@@ -903,7 +906,9 @@ export class MCPServer extends MCPServerBase {
903
906
  * This leverages the same tool information used by the internal ListTools MCP request.
904
907
  * @returns An object containing an array of tool information.
905
908
  */
906
- public getToolListInfo(): { tools: Array<{ name: string; description?: string; inputSchema: any }> } {
909
+ public getToolListInfo(): {
910
+ tools: Array<{ name: string; description?: string; inputSchema: any; toolType?: MCPToolType }>;
911
+ } {
907
912
  this.logger.debug(`Getting tool list information for MCPServer '${this.name}'`);
908
913
  return {
909
914
  tools: Object.entries(this.convertedTools).map(([toolId, tool]) => ({
@@ -911,6 +916,7 @@ export class MCPServer extends MCPServerBase {
911
916
  name: tool.name,
912
917
  description: tool.description,
913
918
  inputSchema: tool.parameters?.jsonSchema || tool.parameters,
919
+ toolType: tool.toolType,
914
920
  })),
915
921
  };
916
922
  }
@@ -920,7 +926,9 @@ export class MCPServer extends MCPServerBase {
920
926
  * @param toolId The ID/name of the tool to retrieve.
921
927
  * @returns Tool information (name, description, inputSchema) or undefined if not found.
922
928
  */
923
- public getToolInfo(toolId: string): { name: string; description?: string; inputSchema: any } | undefined {
929
+ public getToolInfo(
930
+ toolId: string,
931
+ ): { name: string; description?: string; inputSchema: any; toolType?: MCPToolType } | undefined {
924
932
  const tool = this.convertedTools[toolId];
925
933
  if (!tool) {
926
934
  this.logger.debug(`Tool '${toolId}' not found on MCPServer '${this.name}'`);
@@ -931,6 +939,7 @@ export class MCPServer extends MCPServerBase {
931
939
  name: tool.name,
932
940
  description: tool.description,
933
941
  inputSchema: tool.parameters?.jsonSchema || tool.parameters,
942
+ toolType: tool.toolType,
934
943
  };
935
944
  }
936
945
 
@@ -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