@mastra/mcp 0.10.8 → 0.10.9

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.
Files changed (47) hide show
  1. package/.turbo/turbo-build.log +2 -21
  2. package/CHANGELOG.md +25 -0
  3. package/dist/__fixtures__/fire-crawl-complex-schema.d.ts +5 -0
  4. package/dist/__fixtures__/fire-crawl-complex-schema.d.ts.map +1 -0
  5. package/dist/__fixtures__/server-weather.d.ts +2 -0
  6. package/dist/__fixtures__/server-weather.d.ts.map +1 -0
  7. package/dist/__fixtures__/stock-price.d.ts +26 -0
  8. package/dist/__fixtures__/stock-price.d.ts.map +1 -0
  9. package/dist/__fixtures__/tools.d.ts +15 -0
  10. package/dist/__fixtures__/tools.d.ts.map +1 -0
  11. package/dist/__fixtures__/weather.d.ts +4 -0
  12. package/dist/__fixtures__/weather.d.ts.map +1 -0
  13. package/dist/client/client.d.ts +225 -0
  14. package/dist/client/client.d.ts.map +1 -0
  15. package/dist/client/configuration.d.ts +190 -0
  16. package/dist/client/configuration.d.ts.map +1 -0
  17. package/dist/client/elicitationActions.d.ts +19 -0
  18. package/dist/client/elicitationActions.d.ts.map +1 -0
  19. package/dist/client/index.d.ts +4 -0
  20. package/dist/client/index.d.ts.map +1 -0
  21. package/dist/client/promptActions.d.ts +39 -0
  22. package/dist/client/promptActions.d.ts.map +1 -0
  23. package/dist/client/resourceActions.d.ts +92 -0
  24. package/dist/client/resourceActions.d.ts.map +1 -0
  25. package/dist/index.cjs +2 -0
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.d.ts +3 -21
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +2 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/server/index.d.ts +3 -0
  32. package/dist/server/index.d.ts.map +1 -0
  33. package/dist/server/promptActions.d.ts +20 -0
  34. package/dist/server/promptActions.d.ts.map +1 -0
  35. package/dist/server/resourceActions.d.ts +31 -0
  36. package/dist/server/resourceActions.d.ts.map +1 -0
  37. package/dist/server/server.d.ts +196 -0
  38. package/dist/server/server.d.ts.map +1 -0
  39. package/dist/server/types.d.ts +41 -0
  40. package/dist/server/types.d.ts.map +1 -0
  41. package/package.json +5 -5
  42. package/tsconfig.build.json +9 -0
  43. package/tsconfig.json +1 -1
  44. package/tsup.config.ts +22 -0
  45. package/dist/_tsup-dts-rollup.d.cts +0 -987
  46. package/dist/_tsup-dts-rollup.d.ts +0 -987
  47. package/dist/index.d.cts +0 -21
@@ -0,0 +1,196 @@
1
+ import type * as http from 'node:http';
2
+ import type { ToolsInput, Agent } from '@mastra/core/agent';
3
+ import { MCPServerBase } from '@mastra/core/mcp';
4
+ import type { MCPServerConfig, ServerInfo, ServerDetailInfo, ConvertedTool, MCPServerHonoSSEOptions, MCPServerSSEOptions, MCPToolType } from '@mastra/core/mcp';
5
+ import type { Workflow } from '@mastra/core/workflows';
6
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
7
+ import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
8
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
9
+ import type { StreamableHTTPServerTransportOptions } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
10
+ import type { SSEStreamingApi } from 'hono/streaming';
11
+ import { SSETransport } from 'hono-mcp-server-sse-transport';
12
+ import { ServerPromptActions } from './promptActions';
13
+ import { ServerResourceActions } from './resourceActions';
14
+ import type { MCPServerPrompts, MCPServerResources, ElicitationActions } from './types';
15
+ export declare class MCPServer extends MCPServerBase {
16
+ private server;
17
+ private stdioTransport?;
18
+ private sseTransport?;
19
+ private sseHonoTransports;
20
+ private streamableHTTPTransports;
21
+ private httpServerInstances;
22
+ private definedResources?;
23
+ private definedResourceTemplates?;
24
+ private resourceOptions?;
25
+ private definedPrompts?;
26
+ private promptOptions?;
27
+ private subscriptions;
28
+ readonly resources: ServerResourceActions;
29
+ readonly prompts: ServerPromptActions;
30
+ readonly elicitation: ElicitationActions;
31
+ /**
32
+ * Get the current stdio transport.
33
+ */
34
+ getStdioTransport(): StdioServerTransport | undefined;
35
+ /**
36
+ * Get the current SSE transport.
37
+ */
38
+ getSseTransport(): SSEServerTransport | undefined;
39
+ /**
40
+ * Get the current SSE Hono transport.
41
+ */
42
+ getSseHonoTransport(sessionId: string): SSETransport | undefined;
43
+ /**
44
+ * Get the current server instance.
45
+ */
46
+ getServer(): Server;
47
+ /**
48
+ * Construct a new MCPServer instance.
49
+ * @param opts - Configuration options for the server, including registry metadata.
50
+ */
51
+ constructor(opts: MCPServerConfig & {
52
+ resources?: MCPServerResources;
53
+ prompts?: MCPServerPrompts;
54
+ });
55
+ /**
56
+ * Handle an elicitation request by sending it to the connected client.
57
+ * This method sends an elicitation/create request to the client and waits for the response.
58
+ *
59
+ * @param request - The elicitation request containing message and schema
60
+ * @param serverInstance - Optional server instance to use; defaults to main server for backward compatibility
61
+ * @returns Promise that resolves to the client's response
62
+ */
63
+ private handleElicitationRequest;
64
+ /**
65
+ * Creates a new Server instance configured with all handlers for HTTP sessions.
66
+ * Each HTTP client connection gets its own Server instance to avoid routing conflicts.
67
+ */
68
+ private createServerInstance;
69
+ /**
70
+ * Registers all MCP handlers on a given server instance.
71
+ * This allows us to create multiple server instances with identical functionality.
72
+ */
73
+ private registerHandlersOnServer;
74
+ /**
75
+ * Registers resource-related handlers on a server instance.
76
+ */
77
+ private registerResourceHandlersOnServer;
78
+ /**
79
+ * Registers prompt-related handlers on a server instance.
80
+ */
81
+ private registerPromptHandlersOnServer;
82
+ private convertAgentsToTools;
83
+ private convertWorkflowsToTools;
84
+ /**
85
+ * Convert and validate all provided tools, logging registration status.
86
+ * Also converts agents and workflows into tools.
87
+ * @param tools Tool definitions
88
+ * @param agentsConfig Agent definitions to be converted to tools, expected from MCPServerConfig
89
+ * @param workflowsConfig Workflow definitions to be converted to tools, expected from MCPServerConfig
90
+ * @returns Converted tools registry
91
+ */
92
+ convertTools(tools: ToolsInput, agentsConfig?: Record<string, Agent>, workflowsConfig?: Record<string, Workflow>): Record<string, ConvertedTool>;
93
+ /**
94
+ * Start the MCP server using stdio transport (for Windsurf integration).
95
+ */
96
+ startStdio(): Promise<void>;
97
+ /**
98
+ * Handles MCP-over-SSE protocol for user-provided HTTP servers.
99
+ * Call this from your HTTP server for both the SSE and message endpoints.
100
+ *
101
+ * @param url Parsed URL of the incoming request
102
+ * @param ssePath Path for establishing the SSE connection (e.g. '/sse')
103
+ * @param messagePath Path for POSTing client messages (e.g. '/message')
104
+ * @param req Incoming HTTP request
105
+ * @param res HTTP response (must support .write/.end)
106
+ */
107
+ startSSE({ url, ssePath, messagePath, req, res }: MCPServerSSEOptions): Promise<void>;
108
+ /**
109
+ * Handles MCP-over-SSE protocol for user-provided HTTP servers.
110
+ * Call this from your HTTP server for both the SSE and message endpoints.
111
+ *
112
+ * @param url Parsed URL of the incoming request
113
+ * @param ssePath Path for establishing the SSE connection (e.g. '/sse')
114
+ * @param messagePath Path for POSTing client messages (e.g. '/message')
115
+ * @param context Incoming Hono context
116
+ */
117
+ startHonoSSE({ url, ssePath, messagePath, context }: MCPServerHonoSSEOptions): Promise<Response>;
118
+ /**
119
+ * Handles MCP-over-StreamableHTTP protocol for user-provided HTTP servers.
120
+ * Call this from your HTTP server for the streamable HTTP endpoint.
121
+ *
122
+ * @param url Parsed URL of the incoming request
123
+ * @param httpPath Path for establishing the streamable HTTP connection (e.g. '/mcp')
124
+ * @param req Incoming HTTP request
125
+ * @param res HTTP response (must support .write/.end)
126
+ * @param options Optional options to pass to the transport (e.g. sessionIdGenerator)
127
+ */
128
+ startHTTP({ url, httpPath, req, res, options, }: {
129
+ url: URL;
130
+ httpPath: string;
131
+ req: http.IncomingMessage;
132
+ res: http.ServerResponse<http.IncomingMessage>;
133
+ options?: StreamableHTTPServerTransportOptions;
134
+ }): Promise<void>;
135
+ connectSSE({ messagePath, res, }: {
136
+ messagePath: string;
137
+ res: http.ServerResponse<http.IncomingMessage>;
138
+ }): Promise<void>;
139
+ connectHonoSSE({ messagePath, stream }: {
140
+ messagePath: string;
141
+ stream: SSEStreamingApi;
142
+ }): Promise<void>;
143
+ /**
144
+ * Close the MCP server and all its connections
145
+ */
146
+ close(): Promise<void>;
147
+ /**
148
+ * Gets the basic information about the server, conforming to the Server schema.
149
+ * @returns ServerInfo object.
150
+ */
151
+ getServerInfo(): ServerInfo;
152
+ /**
153
+ * Gets detailed information about the server, conforming to the ServerDetail schema.
154
+ * @returns ServerDetailInfo object.
155
+ */
156
+ getServerDetail(): ServerDetailInfo;
157
+ /**
158
+ * Gets a list of tools provided by this MCP server, including their schemas.
159
+ * This leverages the same tool information used by the internal ListTools MCP request.
160
+ * @returns An object containing an array of tool information.
161
+ */
162
+ getToolListInfo(): {
163
+ tools: Array<{
164
+ name: string;
165
+ description?: string;
166
+ inputSchema: any;
167
+ outputSchema?: any;
168
+ toolType?: MCPToolType;
169
+ }>;
170
+ };
171
+ /**
172
+ * Gets information for a specific tool provided by this MCP server.
173
+ * @param toolId The ID/name of the tool to retrieve.
174
+ * @returns Tool information (name, description, inputSchema) or undefined if not found.
175
+ */
176
+ getToolInfo(toolId: string): {
177
+ name: string;
178
+ description?: string;
179
+ inputSchema: any;
180
+ outputSchema?: any;
181
+ toolType?: MCPToolType;
182
+ } | undefined;
183
+ /**
184
+ * Executes a specific tool provided by this MCP server.
185
+ * @param toolId The ID/name of the tool to execute.
186
+ * @param args The arguments to pass to the tool's execute function.
187
+ * @param executionContext Optional context for the tool execution.
188
+ * @returns A promise that resolves to the result of the tool execution.
189
+ * @throws Error if the tool is not found, validation fails, or execution fails.
190
+ */
191
+ executeTool(toolId: string, args: any, executionContext?: {
192
+ messages?: any[];
193
+ toolCallId?: string;
194
+ }): Promise<any>;
195
+ }
196
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,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YAAY,CAAC,EAAE,GAAG,CAAC;QAAC,QAAQ,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,SAAS;IAgBnH;;;;;;;OAOG;IACU,WAAW,CACtB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,GAAG,EACT,gBAAgB,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3D,OAAO,CAAC,GAAG,CAAC;CA4EhB"}
@@ -0,0 +1,41 @@
1
+ import type { InternalCoreTool } from '@mastra/core';
2
+ import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
3
+ import type { ElicitRequest, ElicitResult, Prompt, PromptMessage, Resource, ResourceTemplate } from '@modelcontextprotocol/sdk/types.js';
4
+ export type MCPServerResourceContentCallback = ({ uri, }: {
5
+ uri: string;
6
+ }) => Promise<MCPServerResourceContent | MCPServerResourceContent[]>;
7
+ export type MCPServerResourceContent = {
8
+ text?: string;
9
+ } | {
10
+ blob?: string;
11
+ };
12
+ export type MCPServerResources = {
13
+ listResources: () => Promise<Resource[]>;
14
+ getResourceContent: MCPServerResourceContentCallback;
15
+ resourceTemplates?: () => Promise<ResourceTemplate[]>;
16
+ };
17
+ export type MCPServerPromptMessagesCallback = ({ name, version, args, }: {
18
+ name: string;
19
+ version?: string;
20
+ args?: any;
21
+ }) => Promise<PromptMessage[]>;
22
+ export type MCPServerPrompts = {
23
+ listPrompts: () => Promise<Prompt[]>;
24
+ getPromptMessages?: MCPServerPromptMessagesCallback;
25
+ };
26
+ export type ElicitationActions = {
27
+ sendRequest: (request: ElicitRequest['params']) => Promise<ElicitResult>;
28
+ };
29
+ export type MCPRequestHandlerExtra = RequestHandlerExtra<any, any>;
30
+ export type MCPTool = {
31
+ id?: InternalCoreTool['id'];
32
+ description?: InternalCoreTool['description'];
33
+ parameters: InternalCoreTool['parameters'];
34
+ outputSchema?: InternalCoreTool['outputSchema'];
35
+ execute: (params: any, options: Parameters<NonNullable<InternalCoreTool['execute']>>[1] & {
36
+ elicitation: ElicitationActions;
37
+ extra: MCPRequestHandlerExtra;
38
+ }) => Promise<any>;
39
+ };
40
+ export type { Resource, ResourceTemplate };
41
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,MAAM,EACN,aAAa,EACb,QAAQ,EACR,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,MAAM,gCAAgC,GAAG,CAAC,EAC9C,GAAG,GACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;CACb,KAAK,OAAO,CAAC,wBAAwB,GAAG,wBAAwB,EAAE,CAAC,CAAC;AACrE,MAAM,MAAM,wBAAwB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzC,kBAAkB,EAAE,gCAAgC,CAAC;IACrD,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,EAC7C,IAAI,EACJ,OAAO,EACP,IAAI,GACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,KAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;AAE/B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,+BAA+B,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1E,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAEnE,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC9C,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAChD,OAAO,EAAE,CACP,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACjE,WAAW,EAAE,kBAAkB,CAAC;QAChC,KAAK,EAAE,sBAAsB,CAAC;KAC/B,KACE,OAAO,CAAC,GAAG,CAAC,CAAC;CACnB,CAAC;AAEF,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp",
3
- "version": "0.10.8",
3
+ "version": "0.10.9",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "author": "",
23
23
  "license": "Apache-2.0",
24
24
  "dependencies": {
25
- "@apidevtools/json-schema-ref-parser": "^14.1.0",
25
+ "@apidevtools/json-schema-ref-parser": "^14.1.1",
26
26
  "@modelcontextprotocol/sdk": "^1.13.0",
27
27
  "date-fns": "^4.1.0",
28
28
  "exit-hook": "^4.0.0",
@@ -51,11 +51,11 @@
51
51
  "vitest": "^3.2.4",
52
52
  "zod": "^3.25.67",
53
53
  "zod-to-json-schema": "^3.24.5",
54
- "@internal/lint": "0.0.24",
55
- "@mastra/core": "0.12.0"
54
+ "@internal/lint": "0.0.25",
55
+ "@mastra/core": "0.12.1"
56
56
  },
57
57
  "scripts": {
58
- "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
58
+ "build": "tsup --silent --config tsup.config.ts",
59
59
  "build:watch": "pnpm build --watch",
60
60
  "test:integration": "cd integration-tests && pnpm test:mcp",
61
61
  "test": "pnpm test:integration && vitest run",
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": ["./tsconfig.json", "../../tsconfig.build.json"],
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/**/*"],
8
+ "exclude": ["node_modules", "**/*.test.ts", "src/**/*.mock.ts"]
9
+ }
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "extends": "../../tsconfig.node.json",
3
- "include": ["src/**/*"],
3
+ "include": ["src/**/*", "tsup.config.ts"],
4
4
  "exclude": ["node_modules", "**/*.test.ts"]
5
5
  }
package/tsup.config.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { spawn } from 'child_process';
2
+ import { promisify } from 'util';
3
+ import { defineConfig } from 'tsup';
4
+
5
+ const exec = promisify(spawn);
6
+
7
+ export default defineConfig({
8
+ entry: ['src/index.ts'],
9
+ format: ['esm', 'cjs'],
10
+ clean: true,
11
+ dts: false,
12
+ splitting: true,
13
+ treeshake: {
14
+ preset: 'smallest',
15
+ },
16
+ sourcemap: true,
17
+ onSuccess: async () => {
18
+ await exec('pnpm', ['tsc', '-p', 'tsconfig.build.json'], {
19
+ stdio: 'inherit',
20
+ });
21
+ },
22
+ });