@mastra/mcp 1.9.0 → 1.9.1

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/index.js CHANGED
@@ -3880,9 +3880,10 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
3880
3880
  * ```
3881
3881
  */
3882
3882
  async startHonoSSE({ url, ssePath, messagePath, context }) {
3883
+ const honoContext = context;
3883
3884
  try {
3884
3885
  if (url.pathname === ssePath) {
3885
- return streamSSE(context, async (stream2) => {
3886
+ return streamSSE(honoContext, async (stream2) => {
3886
3887
  await this.connectHonoSSE({
3887
3888
  messagePath,
3888
3889
  stream: stream2
@@ -3890,22 +3891,22 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
3890
3891
  });
3891
3892
  } else if (url.pathname === messagePath) {
3892
3893
  this.logger.debug("Received message");
3893
- const sessionId = context.req.query("sessionId");
3894
+ const sessionId = honoContext.req.query("sessionId");
3894
3895
  this.logger.debug("Received message for sessionId", { sessionId });
3895
3896
  if (!sessionId) {
3896
- return context.text("No sessionId provided", 400);
3897
+ return honoContext.text("No sessionId provided", 400);
3897
3898
  }
3898
3899
  if (!this.sseHonoTransports.has(sessionId)) {
3899
- return context.text(`No transport found for sessionId ${sessionId}`, 400);
3900
+ return honoContext.text(`No transport found for sessionId ${sessionId}`, 400);
3900
3901
  }
3901
- const message = await this.sseHonoTransports.get(sessionId)?.handlePostMessage(context);
3902
+ const message = await this.sseHonoTransports.get(sessionId)?.handlePostMessage(honoContext);
3902
3903
  if (!message) {
3903
- return context.text("Transport not found", 400);
3904
+ return honoContext.text("Transport not found", 400);
3904
3905
  }
3905
3906
  return message;
3906
3907
  } else {
3907
3908
  this.logger.debug("Unknown path:", { path: url.pathname });
3908
- return context.text("Unknown path", 404);
3909
+ return honoContext.text("Unknown path", 404);
3909
3910
  }
3910
3911
  } catch (e) {
3911
3912
  const mastraError = new MastraError(