hotstaq 0.8.140 → 0.8.141

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.
@@ -1,6 +1,5 @@
1
1
  import express from "express";
2
2
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
- import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
4
3
  import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
5
4
  import { HotAPI } from "./HotAPI";
6
5
  import { ServerAuthorizationFunction } from "./HotRouteMethod";
@@ -45,11 +44,19 @@ interface MCPToolDefinition {
45
44
  methodName: string;
46
45
  }
47
46
  /**
48
- * Exposes a HotAPI as an MCP (Model Context Protocol) server using SSE transport.
47
+ * Exposes a HotAPI as an MCP (Model Context Protocol) server using the
48
+ * Streamable HTTP transport in stateless mode.
49
49
  *
50
50
  * This class walks all routes and methods on a HotAPI instance and registers
51
- * them as MCP tools. When a tool is called via MCP, it makes an internal HTTP
52
- * fetch to the actual API endpoint and returns the result.
51
+ * them as MCP tools. When a tool is called via MCP, it makes an internal
52
+ * in-process call through the full HotStaq request pipeline and returns
53
+ * the result.
54
+ *
55
+ * Each POST to the MCP route is self-contained: a fresh Server + transport
56
+ * are created per request, authorization runs once, and cleanup fires when
57
+ * the response closes. There is no long-lived session state — which means
58
+ * no "Session not found" 404s when a reverse proxy reaps an idle SSE
59
+ * stream.
53
60
  */
54
61
  export declare class HotMCPServer {
55
62
  /**
@@ -65,56 +72,46 @@ export declare class HotMCPServer {
65
72
  * The associated logger.
66
73
  */
67
74
  logger: HotLog;
68
- /**
69
- * The MCP Server instances keyed by session ID.
70
- * A new Server instance is created per SSE connection because the MCP SDK
71
- * Server class only supports one active transport at a time.
72
- */
73
- servers: {
74
- [sessionId: string]: Server;
75
- };
76
75
  /**
77
76
  * The registered tool definitions.
78
77
  */
79
78
  tools: MCPToolDefinition[];
80
79
  /**
81
- * Active SSE transports keyed by session ID.
82
- */
83
- transports: {
84
- [sessionId: string]: SSEServerTransport;
85
- };
86
- /**
87
- * Authorized values from connection-level authorization, keyed by session ID.
88
- * Set when onServerAuthorize is used and a connection is successfully authorized.
89
- */
90
- authorizedValues: {
91
- [sessionId: string]: any;
92
- };
93
- /**
94
- * Executes when authorizing an incoming MCP SSE connection. The value
95
- * returned from here will be stored as the connection's authorizedValue
96
- * and passed into tool call ServerRequests via bearerToken. Returning
97
- * undefined means authorization failed and the connection will be closed.
98
- * If any exceptions are thrown, the connection will be closed with an error.
80
+ * Executes when authorizing an incoming MCP request. The value returned
81
+ * from here is stored as the connection's authorizedValue and passed
82
+ * into tool call ServerRequests via bearerToken. Returning undefined
83
+ * means authorization failed and the request will be rejected with 401.
84
+ * If any exceptions are thrown, the request will be rejected with 401
85
+ * and the exception message in the body.
86
+ *
87
+ * The bearer token from the request (Authorization header or `?token=`
88
+ * query param) is passed via request.bearerToken.
99
89
  *
100
- * The bearer token from the MCP connection request (query param or header)
101
- * will be passed in via request.bearerToken.
90
+ * Set to null to skip authorization (default).
102
91
  *
103
- * Set to null to skip connection-level authorization (default).
92
+ * Note on semantics change from pre-0.8.141: under the SSE transport
93
+ * this ran once per long-lived connection. Under the Streamable HTTP
94
+ * transport it runs once per tool-call request.
104
95
  */
105
96
  onServerAuthorize: ServerAuthorizationFunction;
106
97
  /**
107
- * Executes after a successful MCP SSE connection is established.
98
+ * Executes after a successful MCP request is authorized.
99
+ *
100
+ * Note on semantics change from pre-0.8.141: under the SSE transport
101
+ * this ran once per long-lived connection. Under the Streamable HTTP
102
+ * transport it runs once per tool-call request. The sessionId argument
103
+ * is always a freshly-generated UUID for request tracing; it does not
104
+ * persist across requests.
108
105
  */
109
106
  onSuccessfulConnection: ((sessionId: string, authorizedValue: any) => Promise<void>);
110
107
  /**
111
108
  * Executes right when a client connects before onServerAuthorize is called.
112
- * If this returns false, the connection will be closed immediately.
109
+ * If this returns false, the request will be rejected with 403 Forbidden.
113
110
  * Use onServerAuthorize for authorization logic, not here.
114
111
  */
115
112
  onConnection: ((req: express.Request) => Promise<boolean>);
116
113
  /**
117
- * Executes after a connection fails authorization.
114
+ * Executes after a request fails authorization.
118
115
  */
119
116
  onConnectionError: ((req: express.Request, errorMessage: string) => Promise<void>);
120
117
  constructor(api: HotAPI, route?: string);
@@ -123,31 +120,40 @@ export declare class HotMCPServer {
123
120
  */
124
121
  protected buildToolDefinitions(): void;
125
122
  /**
126
- * Create a fresh MCP Server instance with handlers registered.
127
- * A new instance is required per SSE connection because the MCP SDK
128
- * Server class only supports one active transport at a time.
123
+ * Create a fresh MCP Server instance with handlers registered for this
124
+ * request. The authorizedValue (from onServerAuthorize or the raw bearer
125
+ * token) is captured in closure so tool calls can flow it through as
126
+ * connection-level auth.
129
127
  */
130
- protected createServerInstance(sessionId: string): Server;
128
+ protected createServerInstance(authorizedValue: any): Server;
131
129
  /**
132
130
  * Register the MCP request handlers for tools/list and tools/call on
133
- * the given Server instance. The sessionId is used to look up the
134
- * connection-level authorizedValue for authenticated tool calls.
131
+ * the given Server instance. The authorizedValue is used as a fallback
132
+ * bearer token when a per-call token isn't supplied via _meta.
135
133
  */
136
- protected registerHandlers(instance: Server, sessionId: string): void;
134
+ protected registerHandlers(instance: Server, authorizedValue: any): void;
137
135
  /**
138
136
  * Execute a tool call by calling processRequest directly, going through
139
137
  * the full HotStaq sanitization pipeline (validation, authorization,
140
138
  * pre/post execute hooks, etc).
141
139
  */
142
- protected executeToolCall(tool: MCPToolDefinition, args: any, mcpRequest?: any, sessionId?: string): Promise<CallToolResult>;
140
+ protected executeToolCall(tool: MCPToolDefinition, args: any, mcpRequest?: any, authorizedValue?: any): Promise<CallToolResult>;
143
141
  /**
144
- * Handle an incoming SSE connection request, running the connection lifecycle:
145
- * onConnection (early gate), onServerAuthorize (auth), then establishing
146
- * the MCP SSE transport. Mirrors HotWebSocketServer's connection handling.
142
+ * Handle an incoming MCP POST request via the Streamable HTTP transport.
143
+ *
144
+ * Each request is fully self-contained: connection gate → bearer-token
145
+ * extraction → onServerAuthorize → fresh Server + transport → tool call
146
+ * → response → cleanup. No state persists between requests, so there's
147
+ * no session map to invalidate and no long-lived connection to reap.
147
148
  */
148
- protected handleSSEConnection(req: express.Request, res: express.Response, messageRoute: string): Promise<void>;
149
+ protected handleMCPRequest(req: express.Request, res: express.Response): Promise<void>;
149
150
  /**
150
- * Attach the MCP SSE endpoints to an Express application.
151
+ * Attach the MCP endpoints to an Express application.
152
+ *
153
+ * The server speaks the Streamable HTTP transport on a single POST
154
+ * route. GET and DELETE on the same route return 405 Method Not
155
+ * Allowed so misbehaving clients see a clear failure instead of a
156
+ * quiet hang.
151
157
  */
152
158
  attach(app: express.Express): Promise<void>;
153
159
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HotMCPServer.d.ts","sourceRoot":"","sources":["../../src/HotMCPServer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAiD,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEnH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAiD,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC9G,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAK/C;;GAEG;AACH,UAAU,iBAAiB;IAE1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE;QACZ,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE;YAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;SAAE,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OA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AAE,GAAG,EAAE,eAAe,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC;IAmKtI;;;;;;;OAOG;cACa,gBAAgB,CAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAyJ7F;;;;;;;OAOG;IACG,MAAM,CAAE,GAAG,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAyBlD"}
@@ -11,18 +11,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.HotMCPServer = void 0;
13
13
  const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
14
- const sse_js_1 = require("@modelcontextprotocol/sdk/server/sse.js");
14
+ const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
15
15
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
16
16
  const HotRouteMethod_1 = require("./HotRouteMethod");
17
17
  const HotLog_1 = require("./HotLog");
18
18
  const HotStaq_1 = require("./HotStaq");
19
19
  const HotHTTPServerProcessRequest_1 = require("./HotHTTPServerProcessRequest");
20
20
  /**
21
- * Exposes a HotAPI as an MCP (Model Context Protocol) server using SSE transport.
21
+ * Exposes a HotAPI as an MCP (Model Context Protocol) server using the
22
+ * Streamable HTTP transport in stateless mode.
22
23
  *
23
24
  * This class walks all routes and methods on a HotAPI instance and registers
24
- * them as MCP tools. When a tool is called via MCP, it makes an internal HTTP
25
- * fetch to the actual API endpoint and returns the result.
25
+ * them as MCP tools. When a tool is called via MCP, it makes an internal
26
+ * in-process call through the full HotStaq request pipeline and returns
27
+ * the result.
28
+ *
29
+ * Each POST to the MCP route is self-contained: a fresh Server + transport
30
+ * are created per request, authorization runs once, and cleanup fires when
31
+ * the response closes. There is no long-lived session state — which means
32
+ * no "Session not found" 404s when a reverse proxy reaps an idle SSE
33
+ * stream.
26
34
  */
27
35
  class HotMCPServer {
28
36
  constructor(api, route = "/mcp") {
@@ -30,9 +38,6 @@ class HotMCPServer {
30
38
  this.route = route;
31
39
  this.logger = new HotLog_1.HotLog(HotLog_1.HotLogLevel.All);
32
40
  this.tools = [];
33
- this.transports = {};
34
- this.servers = {};
35
- this.authorizedValues = {};
36
41
  this.onServerAuthorize = null;
37
42
  this.onSuccessfulConnection = null;
38
43
  this.onConnection = null;
@@ -88,28 +93,29 @@ class HotMCPServer {
88
93
  }
89
94
  }
90
95
  /**
91
- * Create a fresh MCP Server instance with handlers registered.
92
- * A new instance is required per SSE connection because the MCP SDK
93
- * Server class only supports one active transport at a time.
96
+ * Create a fresh MCP Server instance with handlers registered for this
97
+ * request. The authorizedValue (from onServerAuthorize or the raw bearer
98
+ * token) is captured in closure so tool calls can flow it through as
99
+ * connection-level auth.
94
100
  */
95
- createServerInstance(sessionId) {
101
+ createServerInstance(authorizedValue) {
96
102
  let instance = new index_js_1.Server({
97
103
  name: "HotStaq MCP Server",
98
- version: "1.0.0"
104
+ version: HotStaq_1.HotStaq.version
99
105
  }, {
100
106
  capabilities: {
101
107
  tools: {}
102
108
  }
103
109
  });
104
- this.registerHandlers(instance, sessionId);
110
+ this.registerHandlers(instance, authorizedValue);
105
111
  return (instance);
106
112
  }
107
113
  /**
108
114
  * Register the MCP request handlers for tools/list and tools/call on
109
- * the given Server instance. The sessionId is used to look up the
110
- * connection-level authorizedValue for authenticated tool calls.
115
+ * the given Server instance. The authorizedValue is used as a fallback
116
+ * bearer token when a per-call token isn't supplied via _meta.
111
117
  */
112
- registerHandlers(instance, sessionId) {
118
+ registerHandlers(instance, authorizedValue) {
113
119
  instance.setRequestHandler(types_js_1.ListToolsRequestSchema, () => __awaiter(this, void 0, void 0, function* () {
114
120
  return ({
115
121
  tools: this.tools.map((tool) => {
@@ -133,7 +139,7 @@ class HotMCPServer {
133
139
  return (result);
134
140
  }
135
141
  try {
136
- let result = yield this.executeToolCall(tool, args, request, sessionId);
142
+ let result = yield this.executeToolCall(tool, args, request, authorizedValue);
137
143
  return (result);
138
144
  }
139
145
  catch (ex) {
@@ -155,7 +161,7 @@ class HotMCPServer {
155
161
  * the full HotStaq sanitization pipeline (validation, authorization,
156
162
  * pre/post execute hooks, etc).
157
163
  */
158
- executeToolCall(tool, args, mcpRequest, sessionId) {
164
+ executeToolCall(tool, args, mcpRequest, authorizedValue) {
159
165
  return __awaiter(this, void 0, void 0, function* () {
160
166
  let server = this.api.connection;
161
167
  let route = this.api.routes[tool.routeName];
@@ -175,18 +181,13 @@ class HotMCPServer {
175
181
  if (bearerToken.startsWith("Bearer ") || bearerToken.startsWith("bearer "))
176
182
  bearerToken = bearerToken.substring(7);
177
183
  }
178
- // If no per-call token was provided, check for a connection-level
179
- // authorized value. When onServerAuthorize is set and the SSE
180
- // connection was authenticated, the returned value (e.g. a JWT or
181
- // user object) is stored in authorizedValues keyed by session ID.
182
- // We pass it through as bearerToken so processRequest's
183
- // onAuthorizeUser sees it the same way it would for an HTTP request.
184
- let connectionAuthorizedValue = null;
185
- if (sessionId != null && this.authorizedValues[sessionId] != null)
186
- connectionAuthorizedValue = this.authorizedValues[sessionId];
187
- if (bearerToken === "" && connectionAuthorizedValue != null &&
188
- typeof (connectionAuthorizedValue) === "string") {
189
- bearerToken = connectionAuthorizedValue;
184
+ // Fall back to the connection-level authorizedValue (from onServerAuthorize
185
+ // or raw header) when no per-call token was sent. We pass it through as
186
+ // bearerToken so processRequest's onAuthorizeUser sees it the same way
187
+ // it would for an HTTP request.
188
+ if (bearerToken === "" && authorizedValue != null &&
189
+ typeof (authorizedValue) === "string") {
190
+ bearerToken = authorizedValue;
190
191
  }
191
192
  // Build the authorization header so processRequest can read it the same way
192
193
  // it does for normal HTTP requests.
@@ -289,13 +290,16 @@ class HotMCPServer {
289
290
  });
290
291
  }
291
292
  /**
292
- * Handle an incoming SSE connection request, running the connection lifecycle:
293
- * onConnection (early gate), onServerAuthorize (auth), then establishing
294
- * the MCP SSE transport. Mirrors HotWebSocketServer's connection handling.
293
+ * Handle an incoming MCP POST request via the Streamable HTTP transport.
294
+ *
295
+ * Each request is fully self-contained: connection gate → bearer-token
296
+ * extraction → onServerAuthorize → fresh Server + transport → tool call
297
+ * → response → cleanup. No state persists between requests, so there's
298
+ * no session map to invalidate and no long-lived connection to reap.
295
299
  */
296
- handleSSEConnection(req, res, messageRoute) {
300
+ handleMCPRequest(req, res) {
297
301
  return __awaiter(this, void 0, void 0, function* () {
298
- this.logger.verbose(() => `New MCP SSE connection from ${req.ip}`);
302
+ this.logger.verbose(() => `New MCP request from ${req.ip}`);
299
303
  // Early connection gate — developer can reject before auth runs.
300
304
  if (this.onConnection != null) {
301
305
  let allowed = false;
@@ -308,7 +312,7 @@ class HotMCPServer {
308
312
  return;
309
313
  }
310
314
  if (allowed === false) {
311
- this.logger.verbose(`MCP connection rejected by onConnection from ${req.ip}`);
315
+ this.logger.verbose(`MCP request rejected by onConnection from ${req.ip}`);
312
316
  res.status(403).json({ error: "Forbidden" });
313
317
  return;
314
318
  }
@@ -325,9 +329,9 @@ class HotMCPServer {
325
329
  else if ((req.query.token != null) && (typeof (req.query.token) === "string")) {
326
330
  bearerToken = req.query.token;
327
331
  }
328
- // Connection-level authorization — optional, mirrors HotWebSocketServer.onServerAuthorize.
329
- // When set, the callback validates the token and returns an authorized value.
330
- // When not set, the raw bearer token is stored so it can flow into tool calls.
332
+ // Request-level authorization — optional. When set, the callback
333
+ // validates the token and returns an authorized value. When not set,
334
+ // the raw bearer token is stored so it can flow into tool calls.
331
335
  let authorizedValue = bearerToken !== "" ? bearerToken : null;
332
336
  if (this.onServerAuthorize != null) {
333
337
  let request = new HotRouteMethod_1.ServerRequest({
@@ -350,65 +354,92 @@ class HotMCPServer {
350
354
  return;
351
355
  }
352
356
  if (authorizedValue === undefined) {
353
- this.logger.verbose(`MCP unauthorized connection from ${req.ip}`);
357
+ this.logger.verbose(`MCP unauthorized request from ${req.ip}`);
354
358
  if (this.onConnectionError != null)
355
359
  yield this.onConnectionError(req, "Unauthorized");
356
360
  res.status(401).json({ error: "Unauthorized" });
357
361
  return;
358
362
  }
359
363
  }
360
- this.logger.verbose(() => `MCP SSE connection authorized from ${req.ip}`);
361
- let transport = new sse_js_1.SSEServerTransport(messageRoute, res);
362
- // Create a fresh Server instance per connection the MCP SDK Server
363
- // only supports one active transport at a time. Pass the session ID
364
- // so tool call handlers can look up connection-level auth.
365
- let sessionServer = this.createServerInstance(transport.sessionId);
366
- this.transports[transport.sessionId] = transport;
367
- this.servers[transport.sessionId] = sessionServer;
368
- if (authorizedValue != null)
369
- this.authorizedValues[transport.sessionId] = authorizedValue;
370
- transport.onclose = () => {
371
- delete this.transports[transport.sessionId];
372
- delete this.servers[transport.sessionId];
373
- delete this.authorizedValues[transport.sessionId];
374
- };
375
- yield sessionServer.connect(transport);
376
- if (this.onSuccessfulConnection != null)
377
- yield this.onSuccessfulConnection(transport.sessionId, authorizedValue);
364
+ this.logger.verbose(() => `MCP request authorized from ${req.ip}`);
365
+ // Stateless mode: sessionIdGenerator undefined → no session ID, no
366
+ // validation, no map to poison. Each request is independent.
367
+ let transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
368
+ sessionIdGenerator: undefined
369
+ });
370
+ let sessionServer = this.createServerInstance(authorizedValue);
371
+ try {
372
+ yield sessionServer.connect(transport);
373
+ if (this.onSuccessfulConnection != null) {
374
+ // Synthesize a per-request identifier for the callback's telemetry.
375
+ // This does not persist across requests — the stateless transport
376
+ // has no concept of a durable session.
377
+ let requestId = `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
378
+ yield this.onSuccessfulConnection(requestId, authorizedValue);
379
+ }
380
+ // The transport consumes the pre-parsed Express body so the JSON
381
+ // middleware that's already drained the stream doesn't leave us
382
+ // staring at an empty read.
383
+ yield transport.handleRequest(req, res, req.body);
384
+ }
385
+ catch (ex) {
386
+ this.logger.error(`MCP request error: ${ex.message}`);
387
+ if (res.headersSent === false) {
388
+ res.status(500).json({
389
+ jsonrpc: "2.0",
390
+ error: { code: -32603, message: "Internal server error" },
391
+ id: null
392
+ });
393
+ }
394
+ }
395
+ finally {
396
+ // Clean up the per-request transport + server when the response
397
+ // finishes. The SDK's close() is idempotent so calling it here is
398
+ // safe even if the transport already closed naturally.
399
+ let cleanup = () => {
400
+ try {
401
+ transport.close();
402
+ }
403
+ catch (_) { }
404
+ try {
405
+ sessionServer.close();
406
+ }
407
+ catch (_) { }
408
+ };
409
+ if (res.writableEnded)
410
+ cleanup();
411
+ else
412
+ res.on("close", cleanup);
413
+ }
378
414
  });
379
415
  }
380
416
  /**
381
- * Attach the MCP SSE endpoints to an Express application.
417
+ * Attach the MCP endpoints to an Express application.
418
+ *
419
+ * The server speaks the Streamable HTTP transport on a single POST
420
+ * route. GET and DELETE on the same route return 405 Method Not
421
+ * Allowed so misbehaving clients see a clear failure instead of a
422
+ * quiet hang.
382
423
  */
383
424
  attach(app) {
384
425
  return __awaiter(this, void 0, void 0, function* () {
385
- let sseRoute = `${this.route}/sse`;
386
- let messageRoute = `${this.route}/message`;
387
- // SSE endpoint (/mcp/sse)
388
- app.get(sseRoute, (req, res) => __awaiter(this, void 0, void 0, function* () {
389
- yield this.handleSSEConnection(req, res, messageRoute);
390
- }));
391
- // Also handle GET on the base route as SSE (/mcp)
392
- app.get(this.route, (req, res) => __awaiter(this, void 0, void 0, function* () {
393
- yield this.handleSSEConnection(req, res, messageRoute);
394
- }));
395
- // Message endpoint — routes MCP JSON-RPC messages to the correct session transport.
396
- app.post(messageRoute, (req, res) => __awaiter(this, void 0, void 0, function* () {
397
- let sessionId = req.query.sessionId;
398
- if (sessionId == null) {
399
- res.status(400).json({ error: "Missing sessionId query parameter" });
400
- return;
401
- }
402
- let transport = this.transports[sessionId];
403
- if (transport == null) {
404
- res.status(404).json({ error: "Session not found" });
405
- return;
406
- }
407
- // Pass req.body as the pre-parsed body — Express's JSON middleware
408
- // consumes the stream before this handler runs, so we must provide
409
- // the already-parsed body explicitly.
410
- yield transport.handlePostMessage(req, res, req.body);
426
+ app.post(this.route, (req, res) => __awaiter(this, void 0, void 0, function* () {
427
+ yield this.handleMCPRequest(req, res);
411
428
  }));
429
+ app.get(this.route, (_req, res) => {
430
+ res.status(405).json({
431
+ jsonrpc: "2.0",
432
+ error: { code: -32000, message: "Method not allowed. Use POST for Streamable HTTP MCP." },
433
+ id: null
434
+ });
435
+ });
436
+ app.delete(this.route, (_req, res) => {
437
+ res.status(405).json({
438
+ jsonrpc: "2.0",
439
+ error: { code: -32000, message: "Method not allowed." },
440
+ id: null
441
+ });
442
+ });
412
443
  });
413
444
  }
414
445
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HotMCPServer.js","sourceRoot":"","sources":["../../src/HotMCPServer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,wEAAmE;AACnE,oEAA6E;AAC7E,iEAAmH;AAInH,qDAA8G;AAC9G,qCAA+C;AAE/C,uCAAoC;AACpC,+EAA+D;AAyC/D;;;;;;GAMG;AACH,MAAa,YAAY;IA8DxB,YAAa,GAAW,EAAE,QAAgB,MAAM;QAE/C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAE,oBAAW,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAE9B,IAAI,CAAC,oBAAoB,EAAG,CAAC;I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OAAO,EAAG,CAAC;;oBAEX,GAAG,CAAC,EAAE,CAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC5B,CAAC;QACF,CAAC;KAAA;IAED;;;;;;;OAOG;IACG,MAAM,CAAE,GAAoB;;YAEjC,GAAG,CAAC,IAAI,CAAE,IAAI,CAAC,KAAK,EAAE,CAAO,GAAoB,EAAE,GAAqB,EAAE,EAAE;gBAE1E,MAAM,IAAI,CAAC,gBAAgB,CAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC,CAAA,CAAC,CAAC;YAEJ,GAAG,CAAC,GAAG,CAAE,IAAI,CAAC,KAAK,EAAE,CAAC,IAAqB,EAAE,GAAqB,EAAE,EAAE;gBAEpE,GAAG,CAAC,MAAM,CAAE,GAAG,CAAC,CAAC,IAAI,CAAE;oBACrB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,uDAAuD,EAAE;oBACzF,EAAE,EAAE,IAAI;iBACR,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEJ,GAAG,CAAC,MAAM,CAAE,IAAI,CAAC,KAAK,EAAE,CAAC,IAAqB,EAAE,GAAqB,EAAE,EAAE;gBAEvE,GAAG,CAAC,MAAM,CAAE,GAAG,CAAC,CAAC,IAAI,CAAE;oBACrB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,qBAAqB,EAAE;oBACvD,EAAE,EAAE,IAAI;iBACR,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;KAAA;CACD;AA7kBD,oCA6kBC"}
@@ -2362,7 +2362,7 @@ exports.HotStaq = HotStaq;
2362
2362
  /**
2363
2363
  * The current version of HotStaq.
2364
2364
  */
2365
- HotStaq.version = "0.8.140";
2365
+ HotStaq.version = "0.8.141";
2366
2366
  /**
2367
2367
  * Indicates if this is a web build.
2368
2368
  */