@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.
- package/CHANGELOG.md +24 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-deployment-monorepo.md +0 -6
- package/dist/server/index.cjs +24 -22
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +24 -22
- package/dist/server/index.js.map +1 -1
- package/package.json +7 -7
package/dist/server/index.js
CHANGED
|
@@ -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
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
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
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
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
|
-
|
|
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 {
|