@mastra/server 0.0.0-mcp-schema-serializer-20250430202337 → 0.0.0-mcp-server-deploy-20250507160341

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.
@@ -2,13 +2,14 @@ import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
3
  import type { BaseLogMessage } from '@mastra/core/logger';
4
4
  import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core/storage';
5
+ import { EvalRow } from '@mastra/core';
6
6
  import { GenerateObjectResult } from 'ai';
7
7
  import { GenerateTextResult } from 'ai';
8
- import type { Mastra } from '@mastra/core/mastra';
8
+ import type { Mastra } from '@mastra/core';
9
+ import type { Mastra as Mastra_2 } from '@mastra/core/mastra';
9
10
  import type { MastraMemory } from '@mastra/core/memory';
10
11
  import { Message } from 'ai';
11
- import { MessageType } from '@mastra/core/memory';
12
+ import { MessageType } from '@mastra/core';
12
13
  import { NewStep } from '@mastra/core/workflows/vNext';
13
14
  import type { NewWorkflow } from '@mastra/core/workflows/vNext';
14
15
  import type { QueryResult } from '@mastra/core/vector';
@@ -16,16 +17,16 @@ import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
16
17
  import type { RuntimeContext } from '@mastra/core/runtime-context';
17
18
  import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
18
19
  import { SerializedStepFlowEntry } from '@mastra/core/workflows/vNext';
19
- import { Step } from '@mastra/core/workflows';
20
- import { StepExecutionContext } from '@mastra/core/workflows';
21
- import { StepGraph } from '@mastra/core/workflows';
22
- import { StorageThreadType } from '@mastra/core/memory';
20
+ import { Step } from '@mastra/core';
21
+ import { StepExecutionContext } from '@mastra/core';
22
+ import { StepGraph } from '@mastra/core';
23
+ import { StorageThreadType } from '@mastra/core';
23
24
  import type { ToolAction } from '@mastra/core/tools';
24
25
  import type { VercelTool } from '@mastra/core/tools';
25
26
  import type { Workflow } from '@mastra/core/workflows';
26
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
27
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
27
28
  import { WorkflowResult } from '@mastra/core/workflows/vNext';
28
- import { WorkflowRunResult } from '@mastra/core/workflows';
29
+ import { WorkflowRunResult } from '@mastra/core';
29
30
  import type { WorkflowRuns } from '@mastra/core/storage';
30
31
  import { ZodType } from 'zod';
31
32
  import { ZodTypeDef } from 'zod';
@@ -49,7 +50,7 @@ export declare interface ApiError extends Error {
49
50
  declare type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
50
51
 
51
52
  export declare interface Context {
52
- mastra: Mastra;
53
+ mastra: Mastra_2;
53
54
  }
54
55
 
55
56
  export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
@@ -183,6 +184,85 @@ export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>
183
184
  transports: string[];
184
185
  }>;
185
186
 
187
+ /**
188
+ * Handler for GET /api/mcp/servers/:serverId
189
+ * Returns details about a specific MCP server
190
+ */
191
+ declare const getMcpServerHandler: ({ mastra, serverId }: {
192
+ mastra: Mastra;
193
+ serverId: string;
194
+ }) => Promise<{
195
+ id: string;
196
+ name: string;
197
+ version: string;
198
+ tools: {
199
+ name: string;
200
+ description: any;
201
+ parameters: any;
202
+ }[];
203
+ }>;
204
+ export { getMcpServerHandler }
205
+ export { getMcpServerHandler as getMcpServerHandler_alias_2 }
206
+
207
+ /**
208
+ * Handler for GET /api/mcp/servers/:serverId
209
+ * Returns details about a specific MCP server
210
+ */
211
+ export declare const getMcpServerHandler_alias_1: ({ mastra, serverId }: {
212
+ mastra: Mastra;
213
+ serverId: string;
214
+ }) => Promise<{
215
+ error: string;
216
+ status: number;
217
+ id?: undefined;
218
+ name?: undefined;
219
+ version?: undefined;
220
+ tools?: undefined;
221
+ } | {
222
+ id: string;
223
+ name: string;
224
+ version: string;
225
+ tools: {
226
+ name: string;
227
+ description: string | undefined;
228
+ inputSchema: string | undefined;
229
+ }[];
230
+ error?: undefined;
231
+ status?: undefined;
232
+ }>;
233
+
234
+ /**
235
+ * Handler for GET /api/mcp/servers
236
+ * Lists all MCP servers registered on the Mastra instance
237
+ */
238
+ declare const getMcpServersHandler: ({ mastra }: {
239
+ mastra: Mastra;
240
+ }) => Promise<{
241
+ servers: {
242
+ id: string;
243
+ name: string;
244
+ version: string;
245
+ tools: number;
246
+ }[];
247
+ }>;
248
+ export { getMcpServersHandler }
249
+ export { getMcpServersHandler as getMcpServersHandler_alias_2 }
250
+
251
+ /**
252
+ * Handler for GET /api/mcp/servers
253
+ * Lists all MCP servers registered on the Mastra instance
254
+ */
255
+ export declare const getMcpServersHandler_alias_1: ({ mastra }: {
256
+ mastra: Mastra;
257
+ }) => Promise<{
258
+ servers: {
259
+ id: string;
260
+ name: string;
261
+ version: string;
262
+ tools: number;
263
+ }[];
264
+ }>;
265
+
186
266
  export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
187
267
  result: boolean;
188
268
  }>;
@@ -249,7 +329,13 @@ export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNex
249
329
 
250
330
  export declare function getVNextWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRun']>>;
251
331
 
252
- export declare function getVNextWorkflowRunsHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<WorkflowRuns>;
332
+ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: VNextWorkflowContext & {
333
+ fromDate?: Date;
334
+ toDate?: Date;
335
+ limit?: number;
336
+ offset?: number;
337
+ resourceId?: string;
338
+ }): Promise<WorkflowRuns>;
253
339
 
254
340
  export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
255
341
 
@@ -265,7 +351,13 @@ export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowC
265
351
 
266
352
  export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
267
353
 
268
- export declare function getWorkflowRunsHandler({ mastra, workflowId }: WorkflowContext): Promise<WorkflowRuns>;
354
+ export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
355
+ fromDate?: Date;
356
+ toDate?: Date;
357
+ limit?: number;
358
+ offset?: number;
359
+ resourceId?: string;
360
+ }): Promise<WorkflowRuns>;
269
361
 
270
362
  export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
271
363
 
@@ -343,7 +435,7 @@ export declare namespace logs {
343
435
  }
344
436
 
345
437
  declare type LogsContext = {
346
- mastra: Mastra;
438
+ mastra: Mastra_2;
347
439
  transportId?: string;
348
440
  runId?: string;
349
441
  };
@@ -513,6 +605,8 @@ declare interface TelemetryContext extends Context {
513
605
  page?: number;
514
606
  perPage?: number;
515
607
  attribute?: string | string[];
608
+ fromDate?: Date;
609
+ toDate?: Date;
516
610
  };
517
611
  }
518
612
 
@@ -2,13 +2,14 @@ import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
3
  import type { BaseLogMessage } from '@mastra/core/logger';
4
4
  import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core/storage';
5
+ import { EvalRow } from '@mastra/core';
6
6
  import { GenerateObjectResult } from 'ai';
7
7
  import { GenerateTextResult } from 'ai';
8
- import type { Mastra } from '@mastra/core/mastra';
8
+ import type { Mastra } from '@mastra/core';
9
+ import type { Mastra as Mastra_2 } from '@mastra/core/mastra';
9
10
  import type { MastraMemory } from '@mastra/core/memory';
10
11
  import { Message } from 'ai';
11
- import { MessageType } from '@mastra/core/memory';
12
+ import { MessageType } from '@mastra/core';
12
13
  import { NewStep } from '@mastra/core/workflows/vNext';
13
14
  import type { NewWorkflow } from '@mastra/core/workflows/vNext';
14
15
  import type { QueryResult } from '@mastra/core/vector';
@@ -16,16 +17,16 @@ import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
16
17
  import type { RuntimeContext } from '@mastra/core/runtime-context';
17
18
  import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
18
19
  import { SerializedStepFlowEntry } from '@mastra/core/workflows/vNext';
19
- import { Step } from '@mastra/core/workflows';
20
- import { StepExecutionContext } from '@mastra/core/workflows';
21
- import { StepGraph } from '@mastra/core/workflows';
22
- import { StorageThreadType } from '@mastra/core/memory';
20
+ import { Step } from '@mastra/core';
21
+ import { StepExecutionContext } from '@mastra/core';
22
+ import { StepGraph } from '@mastra/core';
23
+ import { StorageThreadType } from '@mastra/core';
23
24
  import type { ToolAction } from '@mastra/core/tools';
24
25
  import type { VercelTool } from '@mastra/core/tools';
25
26
  import type { Workflow } from '@mastra/core/workflows';
26
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
27
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
27
28
  import { WorkflowResult } from '@mastra/core/workflows/vNext';
28
- import { WorkflowRunResult } from '@mastra/core/workflows';
29
+ import { WorkflowRunResult } from '@mastra/core';
29
30
  import type { WorkflowRuns } from '@mastra/core/storage';
30
31
  import { ZodType } from 'zod';
31
32
  import { ZodTypeDef } from 'zod';
@@ -49,7 +50,7 @@ export declare interface ApiError extends Error {
49
50
  declare type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
50
51
 
51
52
  export declare interface Context {
52
- mastra: Mastra;
53
+ mastra: Mastra_2;
53
54
  }
54
55
 
55
56
  export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
@@ -183,6 +184,85 @@ export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>
183
184
  transports: string[];
184
185
  }>;
185
186
 
187
+ /**
188
+ * Handler for GET /api/mcp/servers/:serverId
189
+ * Returns details about a specific MCP server
190
+ */
191
+ declare const getMcpServerHandler: ({ mastra, serverId }: {
192
+ mastra: Mastra;
193
+ serverId: string;
194
+ }) => Promise<{
195
+ id: string;
196
+ name: string;
197
+ version: string;
198
+ tools: {
199
+ name: string;
200
+ description: any;
201
+ parameters: any;
202
+ }[];
203
+ }>;
204
+ export { getMcpServerHandler }
205
+ export { getMcpServerHandler as getMcpServerHandler_alias_2 }
206
+
207
+ /**
208
+ * Handler for GET /api/mcp/servers/:serverId
209
+ * Returns details about a specific MCP server
210
+ */
211
+ export declare const getMcpServerHandler_alias_1: ({ mastra, serverId }: {
212
+ mastra: Mastra;
213
+ serverId: string;
214
+ }) => Promise<{
215
+ error: string;
216
+ status: number;
217
+ id?: undefined;
218
+ name?: undefined;
219
+ version?: undefined;
220
+ tools?: undefined;
221
+ } | {
222
+ id: string;
223
+ name: string;
224
+ version: string;
225
+ tools: {
226
+ name: string;
227
+ description: string | undefined;
228
+ inputSchema: string | undefined;
229
+ }[];
230
+ error?: undefined;
231
+ status?: undefined;
232
+ }>;
233
+
234
+ /**
235
+ * Handler for GET /api/mcp/servers
236
+ * Lists all MCP servers registered on the Mastra instance
237
+ */
238
+ declare const getMcpServersHandler: ({ mastra }: {
239
+ mastra: Mastra;
240
+ }) => Promise<{
241
+ servers: {
242
+ id: string;
243
+ name: string;
244
+ version: string;
245
+ tools: number;
246
+ }[];
247
+ }>;
248
+ export { getMcpServersHandler }
249
+ export { getMcpServersHandler as getMcpServersHandler_alias_2 }
250
+
251
+ /**
252
+ * Handler for GET /api/mcp/servers
253
+ * Lists all MCP servers registered on the Mastra instance
254
+ */
255
+ export declare const getMcpServersHandler_alias_1: ({ mastra }: {
256
+ mastra: Mastra;
257
+ }) => Promise<{
258
+ servers: {
259
+ id: string;
260
+ name: string;
261
+ version: string;
262
+ tools: number;
263
+ }[];
264
+ }>;
265
+
186
266
  export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
187
267
  result: boolean;
188
268
  }>;
@@ -249,7 +329,13 @@ export declare function getVNextWorkflowByIdHandler({ mastra, workflowId }: VNex
249
329
 
250
330
  export declare function getVNextWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<VNextWorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<NewWorkflow['getWorkflowRun']>>;
251
331
 
252
- export declare function getVNextWorkflowRunsHandler({ mastra, workflowId }: VNextWorkflowContext): Promise<WorkflowRuns>;
332
+ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: VNextWorkflowContext & {
333
+ fromDate?: Date;
334
+ toDate?: Date;
335
+ limit?: number;
336
+ offset?: number;
337
+ resourceId?: string;
338
+ }): Promise<WorkflowRuns>;
253
339
 
254
340
  export declare function getVNextWorkflowsHandler({ mastra }: VNextWorkflowContext): Promise<any>;
255
341
 
@@ -265,7 +351,13 @@ export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowC
265
351
 
266
352
  export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
267
353
 
268
- export declare function getWorkflowRunsHandler({ mastra, workflowId }: WorkflowContext): Promise<WorkflowRuns>;
354
+ export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
355
+ fromDate?: Date;
356
+ toDate?: Date;
357
+ limit?: number;
358
+ offset?: number;
359
+ resourceId?: string;
360
+ }): Promise<WorkflowRuns>;
269
361
 
270
362
  export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
271
363
 
@@ -343,7 +435,7 @@ export declare namespace logs {
343
435
  }
344
436
 
345
437
  declare type LogsContext = {
346
- mastra: Mastra;
438
+ mastra: Mastra_2;
347
439
  transportId?: string;
348
440
  runId?: string;
349
441
  };
@@ -513,6 +605,8 @@ declare interface TelemetryContext extends Context {
513
605
  page?: number;
514
606
  perPage?: number;
515
607
  attribute?: string | string[];
608
+ fromDate?: Date;
609
+ toDate?: Date;
516
610
  };
517
611
  }
518
612
 
@@ -290,13 +290,21 @@ async function resumeWorkflowHandler({
290
290
  return handleError(error, "Error resuming workflow");
291
291
  }
292
292
  }
293
- async function getWorkflowRunsHandler({ mastra, workflowId }) {
293
+ async function getWorkflowRunsHandler({
294
+ mastra,
295
+ workflowId,
296
+ fromDate,
297
+ toDate,
298
+ limit,
299
+ offset,
300
+ resourceId
301
+ }) {
294
302
  try {
295
303
  if (!workflowId) {
296
304
  throw new HTTPException(400, { message: "Workflow ID is required" });
297
305
  }
298
306
  const workflow = mastra.getWorkflow(workflowId);
299
- const workflowRuns = await workflow.getWorkflowRuns() || {
307
+ const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
300
308
  runs: [],
301
309
  total: 0
302
310
  };
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ var chunkFV45V6WC_cjs = require('./chunk-FV45V6WC.cjs');
4
+
5
+ // src/server/handlers/mcp.ts
6
+ var getMcpServersHandler = async ({ mastra }) => {
7
+ const servers = mastra.getMCPServers();
8
+ return {
9
+ servers: servers.map((server) => ({
10
+ id: server.name,
11
+ name: server.name,
12
+ version: server.version,
13
+ tools: Object.keys(server.tools()).length
14
+ }))
15
+ };
16
+ };
17
+ var getMcpServerHandler = async ({ mastra, serverId }) => {
18
+ const server = mastra.getMCPServer(serverId);
19
+ if (!server) {
20
+ throw new chunkFV45V6WC_cjs.HTTPException(404, { message: `MCP server '${serverId}' not found` });
21
+ }
22
+ const tools = server.tools();
23
+ return {
24
+ id: server.name,
25
+ name: server.name,
26
+ version: server.version,
27
+ tools: Object.entries(tools).map(([name, tool]) => ({
28
+ name,
29
+ description: tool.description,
30
+ parameters: tool.parameters
31
+ }))
32
+ };
33
+ };
34
+
35
+ exports.getMcpServerHandler = getMcpServerHandler;
36
+ exports.getMcpServersHandler = getMcpServersHandler;
@@ -22,7 +22,7 @@ async function getTelemetryHandler({ mastra, body }) {
22
22
  if (!body) {
23
23
  throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Body is required" });
24
24
  }
25
- const { name, scope, page, perPage, attribute } = body;
25
+ const { name, scope, page, perPage, attribute, fromDate, toDate } = body;
26
26
  const attributes = attribute ? Object.fromEntries(
27
27
  (Array.isArray(attribute) ? attribute : [attribute]).map((attr) => {
28
28
  const [key, value] = attr.split(":");
@@ -34,7 +34,9 @@ async function getTelemetryHandler({ mastra, body }) {
34
34
  scope,
35
35
  page: Number(page ?? 0),
36
36
  perPage: Number(perPage ?? 100),
37
- attributes
37
+ attributes,
38
+ fromDate: fromDate ? new Date(fromDate) : void 0,
39
+ toDate: toDate ? new Date(toDate) : void 0
38
40
  });
39
41
  return traces;
40
42
  } catch (error2) {
@@ -20,7 +20,7 @@ async function getTelemetryHandler({ mastra, body }) {
20
20
  if (!body) {
21
21
  throw new HTTPException(400, { message: "Body is required" });
22
22
  }
23
- const { name, scope, page, perPage, attribute } = body;
23
+ const { name, scope, page, perPage, attribute, fromDate, toDate } = body;
24
24
  const attributes = attribute ? Object.fromEntries(
25
25
  (Array.isArray(attribute) ? attribute : [attribute]).map((attr) => {
26
26
  const [key, value] = attr.split(":");
@@ -32,7 +32,9 @@ async function getTelemetryHandler({ mastra, body }) {
32
32
  scope,
33
33
  page: Number(page ?? 0),
34
34
  perPage: Number(perPage ?? 100),
35
- attributes
35
+ attributes,
36
+ fromDate: fromDate ? new Date(fromDate) : void 0,
37
+ toDate: toDate ? new Date(toDate) : void 0
36
38
  });
37
39
  return traces;
38
40
  } catch (error2) {
@@ -292,13 +292,21 @@ async function resumeWorkflowHandler({
292
292
  return chunkZLBRQFDD_cjs.handleError(error, "Error resuming workflow");
293
293
  }
294
294
  }
295
- async function getWorkflowRunsHandler({ mastra, workflowId }) {
295
+ async function getWorkflowRunsHandler({
296
+ mastra,
297
+ workflowId,
298
+ fromDate,
299
+ toDate,
300
+ limit,
301
+ offset,
302
+ resourceId
303
+ }) {
296
304
  try {
297
305
  if (!workflowId) {
298
306
  throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
299
307
  }
300
308
  const workflow = mastra.getWorkflow(workflowId);
301
- const workflowRuns = await workflow.getWorkflowRuns() || {
309
+ const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
302
310
  runs: [],
303
311
  total: 0
304
312
  };
@@ -287,13 +287,21 @@ async function resumeVNextWorkflowHandler({
287
287
  return chunkZLBRQFDD_cjs.handleError(error, "Error resuming workflow");
288
288
  }
289
289
  }
290
- async function getVNextWorkflowRunsHandler({ mastra, workflowId }) {
290
+ async function getVNextWorkflowRunsHandler({
291
+ mastra,
292
+ workflowId,
293
+ fromDate,
294
+ toDate,
295
+ limit,
296
+ offset,
297
+ resourceId
298
+ }) {
291
299
  try {
292
300
  if (!workflowId) {
293
301
  throw new chunkFV45V6WC_cjs.HTTPException(400, { message: "Workflow ID is required" });
294
302
  }
295
303
  const workflow = mastra.vnext_getWorkflow(workflowId);
296
- const workflowRuns = await workflow.getWorkflowRuns() || {
304
+ const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
297
305
  runs: [],
298
306
  total: 0
299
307
  };
@@ -0,0 +1,33 @@
1
+ import { HTTPException } from './chunk-TRDNDNGQ.js';
2
+
3
+ // src/server/handlers/mcp.ts
4
+ var getMcpServersHandler = async ({ mastra }) => {
5
+ const servers = mastra.getMCPServers();
6
+ return {
7
+ servers: servers.map((server) => ({
8
+ id: server.name,
9
+ name: server.name,
10
+ version: server.version,
11
+ tools: Object.keys(server.tools()).length
12
+ }))
13
+ };
14
+ };
15
+ var getMcpServerHandler = async ({ mastra, serverId }) => {
16
+ const server = mastra.getMCPServer(serverId);
17
+ if (!server) {
18
+ throw new HTTPException(404, { message: `MCP server '${serverId}' not found` });
19
+ }
20
+ const tools = server.tools();
21
+ return {
22
+ id: server.name,
23
+ name: server.name,
24
+ version: server.version,
25
+ tools: Object.entries(tools).map(([name, tool]) => ({
26
+ name,
27
+ description: tool.description,
28
+ parameters: tool.parameters
29
+ }))
30
+ };
31
+ };
32
+
33
+ export { getMcpServerHandler, getMcpServersHandler };
@@ -285,13 +285,21 @@ async function resumeVNextWorkflowHandler({
285
285
  return handleError(error, "Error resuming workflow");
286
286
  }
287
287
  }
288
- async function getVNextWorkflowRunsHandler({ mastra, workflowId }) {
288
+ async function getVNextWorkflowRunsHandler({
289
+ mastra,
290
+ workflowId,
291
+ fromDate,
292
+ toDate,
293
+ limit,
294
+ offset,
295
+ resourceId
296
+ }) {
289
297
  try {
290
298
  if (!workflowId) {
291
299
  throw new HTTPException(400, { message: "Workflow ID is required" });
292
300
  }
293
301
  const workflow = mastra.vnext_getWorkflow(workflowId);
294
- const workflowRuns = await workflow.getWorkflowRuns() || {
302
+ const workflowRuns = await workflow.getWorkflowRuns({ fromDate, toDate, limit, offset, resourceId }) || {
295
303
  runs: [],
296
304
  total: 0
297
305
  };
package/dist/index.cjs CHANGED
@@ -1,2 +1,14 @@
1
1
  'use strict';
2
2
 
3
+ var chunk74DLDQTQ_cjs = require('./chunk-74DLDQTQ.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "getMcpServerHandler", {
8
+ enumerable: true,
9
+ get: function () { return chunk74DLDQTQ_cjs.getMcpServerHandler; }
10
+ });
11
+ Object.defineProperty(exports, "getMcpServersHandler", {
12
+ enumerable: true,
13
+ get: function () { return chunk74DLDQTQ_cjs.getMcpServersHandler; }
14
+ });
package/dist/index.d.cts CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ export { getMcpServersHandler } from './_tsup-dts-rollup.cjs';
2
+ export { getMcpServerHandler } from './_tsup-dts-rollup.cjs';
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ export { getMcpServersHandler } from './_tsup-dts-rollup.js';
2
+ export { getMcpServerHandler } from './_tsup-dts-rollup.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
-
1
+ export { getMcpServerHandler, getMcpServersHandler } from './chunk-HAA5T7JL.js';
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunk74DLDQTQ_cjs = require('../../chunk-74DLDQTQ.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "getMcpServerHandler", {
8
+ enumerable: true,
9
+ get: function () { return chunk74DLDQTQ_cjs.getMcpServerHandler; }
10
+ });
11
+ Object.defineProperty(exports, "getMcpServersHandler", {
12
+ enumerable: true,
13
+ get: function () { return chunk74DLDQTQ_cjs.getMcpServersHandler; }
14
+ });
@@ -0,0 +1,2 @@
1
+ export { getMcpServersHandler_alias_2 as getMcpServersHandler } from '../../_tsup-dts-rollup.cjs';
2
+ export { getMcpServerHandler_alias_2 as getMcpServerHandler } from '../../_tsup-dts-rollup.cjs';
@@ -0,0 +1,2 @@
1
+ export { getMcpServersHandler_alias_2 as getMcpServersHandler } from '../../_tsup-dts-rollup.js';
2
+ export { getMcpServerHandler_alias_2 as getMcpServerHandler } from '../../_tsup-dts-rollup.js';
@@ -0,0 +1 @@
1
+ export { getMcpServerHandler, getMcpServersHandler } from '../../chunk-HAA5T7JL.js';
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunk7IWQE76Z_cjs = require('../../chunk-7IWQE76Z.cjs');
3
+ var chunkAMVOS7YB_cjs = require('../../chunk-AMVOS7YB.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "getTelemetryHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunk7IWQE76Z_cjs.getTelemetryHandler; }
9
+ get: function () { return chunkAMVOS7YB_cjs.getTelemetryHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "storeTelemetryHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunk7IWQE76Z_cjs.storeTelemetryHandler; }
13
+ get: function () { return chunkAMVOS7YB_cjs.storeTelemetryHandler; }
14
14
  });
@@ -1 +1 @@
1
- export { getTelemetryHandler, storeTelemetryHandler } from '../../chunk-WTHDCRMY.js';
1
+ export { getTelemetryHandler, storeTelemetryHandler } from '../../chunk-BPL2CBLV.js';
@@ -1,46 +1,46 @@
1
1
  'use strict';
2
2
 
3
- var chunkAELYAUEE_cjs = require('../../chunk-AELYAUEE.cjs');
3
+ var chunkFOXHTOQZ_cjs = require('../../chunk-FOXHTOQZ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createVNextWorkflowRunHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunkAELYAUEE_cjs.createVNextWorkflowRunHandler; }
9
+ get: function () { return chunkFOXHTOQZ_cjs.createVNextWorkflowRunHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getVNextWorkflowByIdHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunkAELYAUEE_cjs.getVNextWorkflowByIdHandler; }
13
+ get: function () { return chunkFOXHTOQZ_cjs.getVNextWorkflowByIdHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getVNextWorkflowRunHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunkAELYAUEE_cjs.getVNextWorkflowRunHandler; }
17
+ get: function () { return chunkFOXHTOQZ_cjs.getVNextWorkflowRunHandler; }
18
18
  });
19
19
  Object.defineProperty(exports, "getVNextWorkflowRunsHandler", {
20
20
  enumerable: true,
21
- get: function () { return chunkAELYAUEE_cjs.getVNextWorkflowRunsHandler; }
21
+ get: function () { return chunkFOXHTOQZ_cjs.getVNextWorkflowRunsHandler; }
22
22
  });
23
23
  Object.defineProperty(exports, "getVNextWorkflowsHandler", {
24
24
  enumerable: true,
25
- get: function () { return chunkAELYAUEE_cjs.getVNextWorkflowsHandler; }
25
+ get: function () { return chunkFOXHTOQZ_cjs.getVNextWorkflowsHandler; }
26
26
  });
27
27
  Object.defineProperty(exports, "resumeAsyncVNextWorkflowHandler", {
28
28
  enumerable: true,
29
- get: function () { return chunkAELYAUEE_cjs.resumeAsyncVNextWorkflowHandler; }
29
+ get: function () { return chunkFOXHTOQZ_cjs.resumeAsyncVNextWorkflowHandler; }
30
30
  });
31
31
  Object.defineProperty(exports, "resumeVNextWorkflowHandler", {
32
32
  enumerable: true,
33
- get: function () { return chunkAELYAUEE_cjs.resumeVNextWorkflowHandler; }
33
+ get: function () { return chunkFOXHTOQZ_cjs.resumeVNextWorkflowHandler; }
34
34
  });
35
35
  Object.defineProperty(exports, "startAsyncVNextWorkflowHandler", {
36
36
  enumerable: true,
37
- get: function () { return chunkAELYAUEE_cjs.startAsyncVNextWorkflowHandler; }
37
+ get: function () { return chunkFOXHTOQZ_cjs.startAsyncVNextWorkflowHandler; }
38
38
  });
39
39
  Object.defineProperty(exports, "startVNextWorkflowRunHandler", {
40
40
  enumerable: true,
41
- get: function () { return chunkAELYAUEE_cjs.startVNextWorkflowRunHandler; }
41
+ get: function () { return chunkFOXHTOQZ_cjs.startVNextWorkflowRunHandler; }
42
42
  });
43
43
  Object.defineProperty(exports, "watchVNextWorkflowHandler", {
44
44
  enumerable: true,
45
- get: function () { return chunkAELYAUEE_cjs.watchVNextWorkflowHandler; }
45
+ get: function () { return chunkFOXHTOQZ_cjs.watchVNextWorkflowHandler; }
46
46
  });
@@ -1 +1 @@
1
- export { createVNextWorkflowRunHandler, getVNextWorkflowByIdHandler, getVNextWorkflowRunHandler, getVNextWorkflowRunsHandler, getVNextWorkflowsHandler, resumeAsyncVNextWorkflowHandler, resumeVNextWorkflowHandler, startAsyncVNextWorkflowHandler, startVNextWorkflowRunHandler, watchVNextWorkflowHandler } from '../../chunk-JPB6RPGB.js';
1
+ export { createVNextWorkflowRunHandler, getVNextWorkflowByIdHandler, getVNextWorkflowRunHandler, getVNextWorkflowRunsHandler, getVNextWorkflowsHandler, resumeAsyncVNextWorkflowHandler, resumeVNextWorkflowHandler, startAsyncVNextWorkflowHandler, startVNextWorkflowRunHandler, watchVNextWorkflowHandler } from '../../chunk-IQTNZSFP.js';
@@ -1,46 +1,46 @@
1
1
  'use strict';
2
2
 
3
- var chunkEVCC233P_cjs = require('../../chunk-EVCC233P.cjs');
3
+ var chunkCHFORQ7J_cjs = require('../../chunk-CHFORQ7J.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createRunHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunkEVCC233P_cjs.createRunHandler; }
9
+ get: function () { return chunkCHFORQ7J_cjs.createRunHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "getWorkflowByIdHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunkEVCC233P_cjs.getWorkflowByIdHandler; }
13
+ get: function () { return chunkCHFORQ7J_cjs.getWorkflowByIdHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getWorkflowRunHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunkEVCC233P_cjs.getWorkflowRunHandler; }
17
+ get: function () { return chunkCHFORQ7J_cjs.getWorkflowRunHandler; }
18
18
  });
19
19
  Object.defineProperty(exports, "getWorkflowRunsHandler", {
20
20
  enumerable: true,
21
- get: function () { return chunkEVCC233P_cjs.getWorkflowRunsHandler; }
21
+ get: function () { return chunkCHFORQ7J_cjs.getWorkflowRunsHandler; }
22
22
  });
23
23
  Object.defineProperty(exports, "getWorkflowsHandler", {
24
24
  enumerable: true,
25
- get: function () { return chunkEVCC233P_cjs.getWorkflowsHandler; }
25
+ get: function () { return chunkCHFORQ7J_cjs.getWorkflowsHandler; }
26
26
  });
27
27
  Object.defineProperty(exports, "resumeAsyncWorkflowHandler", {
28
28
  enumerable: true,
29
- get: function () { return chunkEVCC233P_cjs.resumeAsyncWorkflowHandler; }
29
+ get: function () { return chunkCHFORQ7J_cjs.resumeAsyncWorkflowHandler; }
30
30
  });
31
31
  Object.defineProperty(exports, "resumeWorkflowHandler", {
32
32
  enumerable: true,
33
- get: function () { return chunkEVCC233P_cjs.resumeWorkflowHandler; }
33
+ get: function () { return chunkCHFORQ7J_cjs.resumeWorkflowHandler; }
34
34
  });
35
35
  Object.defineProperty(exports, "startAsyncWorkflowHandler", {
36
36
  enumerable: true,
37
- get: function () { return chunkEVCC233P_cjs.startAsyncWorkflowHandler; }
37
+ get: function () { return chunkCHFORQ7J_cjs.startAsyncWorkflowHandler; }
38
38
  });
39
39
  Object.defineProperty(exports, "startWorkflowRunHandler", {
40
40
  enumerable: true,
41
- get: function () { return chunkEVCC233P_cjs.startWorkflowRunHandler; }
41
+ get: function () { return chunkCHFORQ7J_cjs.startWorkflowRunHandler; }
42
42
  });
43
43
  Object.defineProperty(exports, "watchWorkflowHandler", {
44
44
  enumerable: true,
45
- get: function () { return chunkEVCC233P_cjs.watchWorkflowHandler; }
45
+ get: function () { return chunkCHFORQ7J_cjs.watchWorkflowHandler; }
46
46
  });
@@ -1 +1 @@
1
- export { createRunHandler, getWorkflowByIdHandler, getWorkflowRunHandler, getWorkflowRunsHandler, getWorkflowsHandler, resumeAsyncWorkflowHandler, resumeWorkflowHandler, startAsyncWorkflowHandler, startWorkflowRunHandler, watchWorkflowHandler } from '../../chunk-M3YJLWTU.js';
1
+ export { createRunHandler, getWorkflowByIdHandler, getWorkflowRunHandler, getWorkflowRunsHandler, getWorkflowsHandler, resumeAsyncWorkflowHandler, resumeWorkflowHandler, startAsyncWorkflowHandler, startWorkflowRunHandler, watchWorkflowHandler } from '../../chunk-3XTEV33Q.js';
@@ -1,25 +1,29 @@
1
1
  'use strict';
2
2
 
3
+ var chunkAMVOS7YB_cjs = require('../chunk-AMVOS7YB.cjs');
3
4
  var chunkD3G23FP3_cjs = require('../chunk-D3G23FP3.cjs');
4
- var chunkAELYAUEE_cjs = require('../chunk-AELYAUEE.cjs');
5
+ var chunkFOXHTOQZ_cjs = require('../chunk-FOXHTOQZ.cjs');
5
6
  var chunkM56ECCHK_cjs = require('../chunk-M56ECCHK.cjs');
6
7
  var chunk55HTWX4C_cjs = require('../chunk-55HTWX4C.cjs');
7
- var chunkEVCC233P_cjs = require('../chunk-EVCC233P.cjs');
8
+ var chunkCHFORQ7J_cjs = require('../chunk-CHFORQ7J.cjs');
8
9
  var chunk4BIX6GMY_cjs = require('../chunk-4BIX6GMY.cjs');
9
10
  var chunkSKBVVI24_cjs = require('../chunk-SKBVVI24.cjs');
10
11
  var chunk2FJURXCL_cjs = require('../chunk-2FJURXCL.cjs');
11
12
  var chunk5YGDYMRB_cjs = require('../chunk-5YGDYMRB.cjs');
12
- var chunk7IWQE76Z_cjs = require('../chunk-7IWQE76Z.cjs');
13
13
 
14
14
 
15
15
 
16
+ Object.defineProperty(exports, "telemetry", {
17
+ enumerable: true,
18
+ get: function () { return chunkAMVOS7YB_cjs.telemetry_exports; }
19
+ });
16
20
  Object.defineProperty(exports, "tools", {
17
21
  enumerable: true,
18
22
  get: function () { return chunkD3G23FP3_cjs.tools_exports; }
19
23
  });
20
24
  Object.defineProperty(exports, "vNextWorkflows", {
21
25
  enumerable: true,
22
- get: function () { return chunkAELYAUEE_cjs.vNextWorkflows_exports; }
26
+ get: function () { return chunkFOXHTOQZ_cjs.vNextWorkflows_exports; }
23
27
  });
24
28
  Object.defineProperty(exports, "vector", {
25
29
  enumerable: true,
@@ -31,7 +35,7 @@ Object.defineProperty(exports, "voice", {
31
35
  });
32
36
  Object.defineProperty(exports, "workflows", {
33
37
  enumerable: true,
34
- get: function () { return chunkEVCC233P_cjs.workflows_exports; }
38
+ get: function () { return chunkCHFORQ7J_cjs.workflows_exports; }
35
39
  });
36
40
  Object.defineProperty(exports, "agents", {
37
41
  enumerable: true,
@@ -49,7 +53,3 @@ Object.defineProperty(exports, "network", {
49
53
  enumerable: true,
50
54
  get: function () { return chunk5YGDYMRB_cjs.network_exports; }
51
55
  });
52
- Object.defineProperty(exports, "telemetry", {
53
- enumerable: true,
54
- get: function () { return chunk7IWQE76Z_cjs.telemetry_exports; }
55
- });
@@ -1,10 +1,10 @@
1
+ export { telemetry_exports as telemetry } from '../chunk-BPL2CBLV.js';
1
2
  export { tools_exports as tools } from '../chunk-5JNVY6DU.js';
2
- export { vNextWorkflows_exports as vNextWorkflows } from '../chunk-JPB6RPGB.js';
3
+ export { vNextWorkflows_exports as vNextWorkflows } from '../chunk-IQTNZSFP.js';
3
4
  export { vector_exports as vector } from '../chunk-4JINXASC.js';
4
5
  export { voice_exports as voice } from '../chunk-Q6SHQECN.js';
5
- export { workflows_exports as workflows } from '../chunk-M3YJLWTU.js';
6
+ export { workflows_exports as workflows } from '../chunk-3XTEV33Q.js';
6
7
  export { agents_exports as agents } from '../chunk-Y3SV5XK4.js';
7
8
  export { logs_exports as logs } from '../chunk-3EJZQ6TQ.js';
8
9
  export { memory_exports as memory } from '../chunk-RBQASTUP.js';
9
10
  export { network_exports as network } from '../chunk-QJ3AHN64.js';
10
- export { telemetry_exports as telemetry } from '../chunk-WTHDCRMY.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/server",
3
- "version": "0.0.0-mcp-schema-serializer-20250430202337",
3
+ "version": "0.0.0-mcp-server-deploy-20250507160341",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -46,7 +46,7 @@
46
46
  "license": "Elastic-2.0",
47
47
  "dependencies": {},
48
48
  "peerDependencies": {
49
- "@mastra/core": "0.0.0-mcp-schema-serializer-20250430202337"
49
+ "@mastra/core": "0.0.0-mcp-server-deploy-20250507160341"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@ai-sdk/openai": "^1.3.2",
@@ -59,7 +59,7 @@
59
59
  "vitest": "^2.1.9",
60
60
  "zod-to-json-schema": "^3.24.3",
61
61
  "@internal/lint": "0.0.2",
62
- "@mastra/core": "0.0.0-mcp-schema-serializer-20250430202337"
62
+ "@mastra/core": "0.0.0-mcp-server-deploy-20250507160341"
63
63
  },
64
64
  "scripts": {
65
65
  "build": "tsup src/index.ts src/server/handlers.ts src/server/handlers/*.ts !src/server/handlers/*.test.ts --format esm,cjs --clean --experimental-dts --treeshake=smallest --splitting",