@mastra/deployer 1.18.0 → 1.19.0-alpha.2

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.
@@ -3284,30 +3284,32 @@ var MastraServer = class extends MastraServer$1 {
3284
3284
  } else if (route.responseType === "mcp-http") {
3285
3285
  const { server, httpPath, mcpOptions: routeMcpOptions } = result;
3286
3286
  const { req, res } = toReqRes(response.req.raw);
3287
- try {
3288
- const options = { ...this.mcpOptions, ...routeMcpOptions };
3289
- await server.startHTTP({
3290
- url: new URL(response.req.url),
3291
- httpPath: `${resolvedPrefix}${httpPath}`,
3292
- req,
3293
- res,
3294
- options: Object.keys(options).length > 0 ? options : void 0
3287
+ const options = { ...this.mcpOptions, ...routeMcpOptions };
3288
+ server.startHTTP({
3289
+ url: new URL(response.req.url),
3290
+ httpPath: `${resolvedPrefix}${httpPath}`,
3291
+ req,
3292
+ res,
3293
+ options: Object.keys(options).length > 0 ? options : void 0
3294
+ }).catch((e) => {
3295
+ this.mastra.getLogger()?.error("[MCP HTTP] Error in background startHTTP:", {
3296
+ error: e instanceof Error ? { message: e.message, stack: e.stack } : e
3295
3297
  });
3296
- return await toFetchResponse(res);
3297
- } catch {
3298
- if (!res.headersSent) {
3299
- res.writeHead(500, { "Content-Type": "application/json" });
3300
- res.end(
3301
- JSON.stringify({
3302
- jsonrpc: "2.0",
3303
- error: { code: -32603, message: "Internal server error" },
3304
- id: null
3305
- })
3306
- );
3307
- return await toFetchResponse(res);
3298
+ try {
3299
+ if (!res.headersSent) {
3300
+ res.writeHead(500, { "Content-Type": "application/json" });
3301
+ res.end(
3302
+ JSON.stringify({
3303
+ jsonrpc: "2.0",
3304
+ error: { code: -32603, message: "Internal server error" },
3305
+ id: null
3306
+ })
3307
+ );
3308
+ }
3309
+ } catch {
3308
3310
  }
3309
- return await toFetchResponse(res);
3310
- }
3311
+ });
3312
+ return await toFetchResponse(res);
3311
3313
  } else if (route.responseType === "mcp-sse") {
3312
3314
  const { server, ssePath, messagePath } = result;
3313
3315
  try {