@mastra/deployer 0.10.5 → 0.10.6-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.
- package/dist/_tsup-dts-rollup.d.cts +2 -2
- package/dist/_tsup-dts-rollup.d.ts +2 -2
- package/dist/server/index.cjs +47 -10
- package/dist/server/index.js +47 -10
- package/package.json +12 -12
|
@@ -517,9 +517,9 @@ is_latest: boolean;
|
|
|
517
517
|
}, ContentfulStatusCode, "json">)>;
|
|
518
518
|
|
|
519
519
|
/**
|
|
520
|
-
* Handler for POST /api/mcp/:serverId/mcp
|
|
520
|
+
* Handler for Streamable HTTP requests (POST, GET, DELETE) to /api/mcp/:serverId/mcp
|
|
521
521
|
*/
|
|
522
|
-
export declare const getMcpServerMessageHandler: (c: Context) => Promise<Response>;
|
|
522
|
+
export declare const getMcpServerMessageHandler: (c: Context) => Promise<Response | undefined>;
|
|
523
523
|
|
|
524
524
|
/**
|
|
525
525
|
* Handler for SSE related routes for an MCP server.
|
|
@@ -517,9 +517,9 @@ is_latest: boolean;
|
|
|
517
517
|
}, ContentfulStatusCode, "json">)>;
|
|
518
518
|
|
|
519
519
|
/**
|
|
520
|
-
* Handler for POST /api/mcp/:serverId/mcp
|
|
520
|
+
* Handler for Streamable HTTP requests (POST, GET, DELETE) to /api/mcp/:serverId/mcp
|
|
521
521
|
*/
|
|
522
|
-
export declare const getMcpServerMessageHandler: (c: Context) => Promise<Response>;
|
|
522
|
+
export declare const getMcpServerMessageHandler: (c: Context) => Promise<Response | undefined>;
|
|
523
523
|
|
|
524
524
|
/**
|
|
525
525
|
* Handler for SSE related routes for an MCP server.
|
package/dist/server/index.cjs
CHANGED
|
@@ -736,7 +736,7 @@ var middleware = (options) => async (c2) => {
|
|
|
736
736
|
);
|
|
737
737
|
};
|
|
738
738
|
|
|
739
|
-
// ../../node_modules/.pnpm/hono-openapi@0.4.8_hono@4.7.11_openapi-types@12.1.3_zod@3.25.
|
|
739
|
+
// ../../node_modules/.pnpm/hono-openapi@0.4.8_hono@4.7.11_openapi-types@12.1.3_zod@3.25.57/node_modules/hono-openapi/utils.js
|
|
740
740
|
var e = Symbol("openapi");
|
|
741
741
|
var n = ["GET", "PUT", "POST", "DELETE", "OPTIONS", "HEAD", "PATCH", "TRACE"];
|
|
742
742
|
var s2 = (e2) => e2.charAt(0).toUpperCase() + e2.slice(1);
|
|
@@ -3378,22 +3378,35 @@ var getMcpServerMessageHandler = async (c2) => {
|
|
|
3378
3378
|
const { req, res } = toReqRes(c2.req.raw);
|
|
3379
3379
|
const server = mastra.getMCPServer(serverId);
|
|
3380
3380
|
if (!server) {
|
|
3381
|
-
|
|
3381
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
3382
|
+
res.end(JSON.stringify({ error: `MCP server '${serverId}' not found` }));
|
|
3383
|
+
return;
|
|
3382
3384
|
}
|
|
3383
3385
|
try {
|
|
3384
3386
|
await server.startHTTP({
|
|
3385
3387
|
url: new URL(c2.req.url),
|
|
3386
3388
|
httpPath: `/api/mcp/${serverId}/mcp`,
|
|
3387
3389
|
req,
|
|
3388
|
-
res
|
|
3389
|
-
options: {
|
|
3390
|
-
sessionIdGenerator: void 0
|
|
3391
|
-
}
|
|
3390
|
+
res
|
|
3392
3391
|
});
|
|
3393
|
-
|
|
3394
|
-
return toFetchRes;
|
|
3392
|
+
return await toFetchResponse(res);
|
|
3395
3393
|
} catch (error) {
|
|
3396
|
-
|
|
3394
|
+
if (!res.headersSent) {
|
|
3395
|
+
res.writeHead(500, { "Content-Type": "application/json" });
|
|
3396
|
+
res.end(
|
|
3397
|
+
JSON.stringify({
|
|
3398
|
+
jsonrpc: "2.0",
|
|
3399
|
+
error: {
|
|
3400
|
+
code: -32603,
|
|
3401
|
+
message: "Internal server error"
|
|
3402
|
+
},
|
|
3403
|
+
id: null
|
|
3404
|
+
// Cannot determine original request ID in catch
|
|
3405
|
+
})
|
|
3406
|
+
);
|
|
3407
|
+
} else {
|
|
3408
|
+
c2.get("logger")?.error("Error after headers sent:", error);
|
|
3409
|
+
}
|
|
3397
3410
|
}
|
|
3398
3411
|
};
|
|
3399
3412
|
var getMcpServerSseHandler = async (c2) => {
|
|
@@ -4261,7 +4274,7 @@ async function streamWorkflowHandler(c2) {
|
|
|
4261
4274
|
c2,
|
|
4262
4275
|
async (stream4) => {
|
|
4263
4276
|
try {
|
|
4264
|
-
const result = workflows.streamWorkflowHandler({
|
|
4277
|
+
const result = await workflows.streamWorkflowHandler({
|
|
4265
4278
|
mastra,
|
|
4266
4279
|
workflowId,
|
|
4267
4280
|
runId,
|
|
@@ -5662,6 +5675,30 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
5662
5675
|
}),
|
|
5663
5676
|
getMcpServerMessageHandler
|
|
5664
5677
|
);
|
|
5678
|
+
app.get(
|
|
5679
|
+
"/api/mcp/:serverId/mcp",
|
|
5680
|
+
w({
|
|
5681
|
+
description: "Send a message to an MCP server using Streamable HTTP",
|
|
5682
|
+
tags: ["mcp"],
|
|
5683
|
+
parameters: [
|
|
5684
|
+
{
|
|
5685
|
+
name: "serverId",
|
|
5686
|
+
in: "path",
|
|
5687
|
+
required: true,
|
|
5688
|
+
schema: { type: "string" }
|
|
5689
|
+
}
|
|
5690
|
+
],
|
|
5691
|
+
responses: {
|
|
5692
|
+
200: {
|
|
5693
|
+
description: "Streamable HTTP connection processed"
|
|
5694
|
+
},
|
|
5695
|
+
404: {
|
|
5696
|
+
description: "MCP server not found"
|
|
5697
|
+
}
|
|
5698
|
+
}
|
|
5699
|
+
}),
|
|
5700
|
+
getMcpServerMessageHandler
|
|
5701
|
+
);
|
|
5665
5702
|
const mcpSseBasePath = "/api/mcp/:serverId/sse";
|
|
5666
5703
|
const mcpSseMessagePath = "/api/mcp/:serverId/messages";
|
|
5667
5704
|
app.get(
|
package/dist/server/index.js
CHANGED
|
@@ -729,7 +729,7 @@ var middleware = (options) => async (c2) => {
|
|
|
729
729
|
);
|
|
730
730
|
};
|
|
731
731
|
|
|
732
|
-
// ../../node_modules/.pnpm/hono-openapi@0.4.8_hono@4.7.11_openapi-types@12.1.3_zod@3.25.
|
|
732
|
+
// ../../node_modules/.pnpm/hono-openapi@0.4.8_hono@4.7.11_openapi-types@12.1.3_zod@3.25.57/node_modules/hono-openapi/utils.js
|
|
733
733
|
var e = Symbol("openapi");
|
|
734
734
|
var n = ["GET", "PUT", "POST", "DELETE", "OPTIONS", "HEAD", "PATCH", "TRACE"];
|
|
735
735
|
var s2 = (e2) => e2.charAt(0).toUpperCase() + e2.slice(1);
|
|
@@ -3371,22 +3371,35 @@ var getMcpServerMessageHandler = async (c2) => {
|
|
|
3371
3371
|
const { req, res } = toReqRes(c2.req.raw);
|
|
3372
3372
|
const server = mastra.getMCPServer(serverId);
|
|
3373
3373
|
if (!server) {
|
|
3374
|
-
|
|
3374
|
+
res.writeHead(404, { "Content-Type": "application/json" });
|
|
3375
|
+
res.end(JSON.stringify({ error: `MCP server '${serverId}' not found` }));
|
|
3376
|
+
return;
|
|
3375
3377
|
}
|
|
3376
3378
|
try {
|
|
3377
3379
|
await server.startHTTP({
|
|
3378
3380
|
url: new URL(c2.req.url),
|
|
3379
3381
|
httpPath: `/api/mcp/${serverId}/mcp`,
|
|
3380
3382
|
req,
|
|
3381
|
-
res
|
|
3382
|
-
options: {
|
|
3383
|
-
sessionIdGenerator: void 0
|
|
3384
|
-
}
|
|
3383
|
+
res
|
|
3385
3384
|
});
|
|
3386
|
-
|
|
3387
|
-
return toFetchRes;
|
|
3385
|
+
return await toFetchResponse(res);
|
|
3388
3386
|
} catch (error) {
|
|
3389
|
-
|
|
3387
|
+
if (!res.headersSent) {
|
|
3388
|
+
res.writeHead(500, { "Content-Type": "application/json" });
|
|
3389
|
+
res.end(
|
|
3390
|
+
JSON.stringify({
|
|
3391
|
+
jsonrpc: "2.0",
|
|
3392
|
+
error: {
|
|
3393
|
+
code: -32603,
|
|
3394
|
+
message: "Internal server error"
|
|
3395
|
+
},
|
|
3396
|
+
id: null
|
|
3397
|
+
// Cannot determine original request ID in catch
|
|
3398
|
+
})
|
|
3399
|
+
);
|
|
3400
|
+
} else {
|
|
3401
|
+
c2.get("logger")?.error("Error after headers sent:", error);
|
|
3402
|
+
}
|
|
3390
3403
|
}
|
|
3391
3404
|
};
|
|
3392
3405
|
var getMcpServerSseHandler = async (c2) => {
|
|
@@ -4254,7 +4267,7 @@ async function streamWorkflowHandler(c2) {
|
|
|
4254
4267
|
c2,
|
|
4255
4268
|
async (stream4) => {
|
|
4256
4269
|
try {
|
|
4257
|
-
const result = streamWorkflowHandler$1({
|
|
4270
|
+
const result = await streamWorkflowHandler$1({
|
|
4258
4271
|
mastra,
|
|
4259
4272
|
workflowId,
|
|
4260
4273
|
runId,
|
|
@@ -5655,6 +5668,30 @@ ${err.stack.split("\n").slice(1).join("\n")}
|
|
|
5655
5668
|
}),
|
|
5656
5669
|
getMcpServerMessageHandler
|
|
5657
5670
|
);
|
|
5671
|
+
app.get(
|
|
5672
|
+
"/api/mcp/:serverId/mcp",
|
|
5673
|
+
w({
|
|
5674
|
+
description: "Send a message to an MCP server using Streamable HTTP",
|
|
5675
|
+
tags: ["mcp"],
|
|
5676
|
+
parameters: [
|
|
5677
|
+
{
|
|
5678
|
+
name: "serverId",
|
|
5679
|
+
in: "path",
|
|
5680
|
+
required: true,
|
|
5681
|
+
schema: { type: "string" }
|
|
5682
|
+
}
|
|
5683
|
+
],
|
|
5684
|
+
responses: {
|
|
5685
|
+
200: {
|
|
5686
|
+
description: "Streamable HTTP connection processed"
|
|
5687
|
+
},
|
|
5688
|
+
404: {
|
|
5689
|
+
description: "MCP server not found"
|
|
5690
|
+
}
|
|
5691
|
+
}
|
|
5692
|
+
}),
|
|
5693
|
+
getMcpServerMessageHandler
|
|
5694
|
+
);
|
|
5658
5695
|
const mcpSseBasePath = "/api/mcp/:serverId/sse";
|
|
5659
5696
|
const mcpSseMessagePath = "/api/mcp/:serverId/messages";
|
|
5660
5697
|
app.get(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/deployer",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -95,29 +95,29 @@
|
|
|
95
95
|
"@rollup/plugin-virtual": "^3.0.2",
|
|
96
96
|
"@sindresorhus/slugify": "^2.2.1",
|
|
97
97
|
"builtins": "^5.1.0",
|
|
98
|
-
"detect-libc": "^2.0.
|
|
98
|
+
"detect-libc": "^2.0.4",
|
|
99
99
|
"dotenv": "^16.5.0",
|
|
100
|
-
"esbuild": "^0.25.
|
|
100
|
+
"esbuild": "^0.25.5",
|
|
101
101
|
"find-workspaces": "^0.3.1",
|
|
102
102
|
"fs-extra": "^11.3.0",
|
|
103
103
|
"globby": "^14.1.0",
|
|
104
104
|
"hono": "^4.7.11",
|
|
105
105
|
"resolve-from": "^5.0.0",
|
|
106
|
-
"rollup": "^4.
|
|
106
|
+
"rollup": "^4.43.0",
|
|
107
107
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
108
108
|
"rollup-plugin-node-externals": "^8.0.0",
|
|
109
109
|
"typescript-paths": "^1.5.1",
|
|
110
|
-
"zod": "^3.25.
|
|
111
|
-
"@mastra/server": "^0.10.
|
|
110
|
+
"zod": "^3.25.57",
|
|
111
|
+
"@mastra/server": "^0.10.6-alpha.0"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
|
-
"@hono/node-server": "^1.14.
|
|
115
|
-
"@hono/swagger-ui": "^0.5.
|
|
114
|
+
"@hono/node-server": "^1.14.4",
|
|
115
|
+
"@hono/swagger-ui": "^0.5.2",
|
|
116
116
|
"@microsoft/api-extractor": "^7.52.8",
|
|
117
117
|
"@types/babel__core": "^7.20.5",
|
|
118
118
|
"@types/babel__helper-module-imports": "^7.18.3",
|
|
119
119
|
"@types/fs-extra": "^11.0.4",
|
|
120
|
-
"@types/node": "^20.
|
|
120
|
+
"@types/node": "^20.19.0",
|
|
121
121
|
"eslint": "^9.28.0",
|
|
122
122
|
"fetch-to-node": "^2.1.0",
|
|
123
123
|
"hono-openapi": "^0.4.8",
|
|
@@ -125,11 +125,11 @@
|
|
|
125
125
|
"superjson": "^2.2.2",
|
|
126
126
|
"tsup": "^8.5.0",
|
|
127
127
|
"type-fest": "^4.41.0",
|
|
128
|
-
"typescript": "^5.8.
|
|
128
|
+
"typescript": "^5.8.3",
|
|
129
129
|
"vitest": "^2.1.9",
|
|
130
|
-
"@mastra/core": "0.10.5",
|
|
131
130
|
"@internal/lint": "0.0.12",
|
|
132
|
-
"@mastra/
|
|
131
|
+
"@mastra/core": "0.10.6-alpha.0",
|
|
132
|
+
"@mastra/mcp": "^0.10.4-alpha.0"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@mastra/core": "^0.10.2-alpha.0"
|