@mongodb-js/mcp-http-runners 3.0.0-prerelease.2 → 3.0.0-prerelease.3

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,12 +1,23 @@
1
- import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
2
- import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
1
+ import { createMcpHandler, isLegacyRequest, } from "@modelcontextprotocol/server";
2
+ import { toNodeHandler, toWebRequest } from "@modelcontextprotocol/node";
3
3
  import express from "express";
4
- import { LogId, JSON_RPC_ERROR_CODE_SESSION_ID_REQUIRED, JSON_RPC_ERROR_CODE_SESSION_ID_INVALID, JSON_RPC_ERROR_CODE_INVALID_REQUEST, JSON_RPC_ERROR_CODE_SESSION_NOT_FOUND, JSON_RPC_ERROR_CODE_DISALLOWED_EXTERNAL_SESSION, JSON_RPC_ERROR_CODE_PROCESSING_REQUEST_FAILED, JSON_RPC_ERROR_CODE_SESSION_LIMIT_EXCEEDED, UserFacingError, getRandomUUID, SessionRejectedError, SessionLimitExceededError, requestIdAttr, } from "@mongodb-js/mcp-core";
4
+ import { LogId, JSON_RPC_ERROR_CODE_PROCESSING_REQUEST_FAILED, UserFacingError, requestIdAttr, SessionStore, } from "@mongodb-js/mcp-core";
5
5
  import { ExpressBasedHttpServer } from "./expressBasedHttpServer.js";
6
- import { sleep } from "./utils.js";
6
+ import { LegacyMcpHttpHandler } from "./legacyMcpHttpHandler.js";
7
7
  /**
8
- * HTTP server that handles MCP requests over HTTP using the Streamable HTTP transport.
8
+ * HTTP server that serves MCP requests over HTTP.
9
9
  *
10
+ * The 2026-07-28 protocol is served **statelessly** through the SDK's
11
+ * `createMcpHandler` (`legacy: 'reject'`): each request builds a fresh
12
+ * request-scoped server and carries client identity per request in the `_meta`
13
+ * envelope. No per-client sessions, no `mcp-session-id` routing on that path.
14
+ *
15
+ * 2025-era (legacy) requests are delegated to a sessionful
16
+ * {@link LegacyMcpHttpHandler} (see its docs for why): the 2025 protocol needs
17
+ * a live, correlated transport for its `initialize`-declared capabilities and
18
+ * server→client elicitation, which the SDK's `legacy: 'stateless'` mode cannot
19
+ * provide. The modern/legacy split is isolated from this class so each path
20
+ * stays clean.
10
21
  *
11
22
  * @example
12
23
  * ```typescript
@@ -18,7 +29,7 @@ import { sleep } from "./utils.js";
18
29
  * ```
19
30
  */
20
31
  export class MCPHttpServer extends ExpressBasedHttpServer {
21
- constructor({ options, logger, metrics, sessionStore }) {
32
+ constructor({ options, logger, metrics, sessionOptions }) {
22
33
  super({
23
34
  options: {
24
35
  logContext: "mcpHttpServer",
@@ -26,293 +37,90 @@ export class MCPHttpServer extends ExpressBasedHttpServer {
26
37
  },
27
38
  logger,
28
39
  });
29
- this.pendingInitializations = new Map();
30
- this.sessionOptions = options.session;
31
40
  this.metrics = metrics;
32
- this.sessionStore = sessionStore;
41
+ this.modernHandler = this.createModernHandler();
42
+ this.legacyHandler = this.createLegacyHandler({ logger, http: options.http, sessionOptions });
33
43
  }
34
44
  async stop() {
35
- await Promise.all([this.sessionStore.closeAllSessions(), super.stop()]);
45
+ await Promise.allSettled([this.modernHandler.close(), this.legacyHandler.close()]);
46
+ await super.stop();
36
47
  }
37
- reportSessionError(res, errorCode) {
38
- let message;
39
- let statusCode = 400;
40
- switch (errorCode) {
41
- case JSON_RPC_ERROR_CODE_SESSION_ID_REQUIRED:
42
- message = "session id is required";
43
- break;
44
- case JSON_RPC_ERROR_CODE_SESSION_ID_INVALID:
45
- message = "session id is invalid";
46
- break;
47
- case JSON_RPC_ERROR_CODE_INVALID_REQUEST:
48
- message = "invalid request";
49
- break;
50
- case JSON_RPC_ERROR_CODE_SESSION_NOT_FOUND:
51
- message = "session not found";
52
- statusCode = 404;
53
- break;
54
- case JSON_RPC_ERROR_CODE_DISALLOWED_EXTERNAL_SESSION:
55
- message = "cannot provide sessionId when externally managed sessions are disabled";
56
- break;
57
- case JSON_RPC_ERROR_CODE_SESSION_LIMIT_EXCEEDED:
58
- message = "server has reached the maximum number of concurrent sessions, try again later";
59
- statusCode = 503;
60
- break;
61
- default:
62
- message = "unknown error";
63
- statusCode = 500;
64
- }
65
- res.status(statusCode).json({
66
- jsonrpc: "2.0",
67
- error: {
68
- code: errorCode,
69
- message,
70
- },
48
+ /**
49
+ * Builds the handler that serves 2025-era (legacy) traffic. Subclasses may
50
+ * override this to plug in an alternative legacy transport/session
51
+ * implementation; the default returns a {@link LegacyMcpHttpHandler} built
52
+ * from {@link MCPHttpServer.createServerForRequest}.
53
+ */
54
+ createLegacyHandler({ logger, http, sessionOptions, }) {
55
+ return new LegacyMcpHttpHandler({
56
+ createServer: async (request) => this.createServerForRequest(request),
57
+ logger,
58
+ http,
59
+ sessionStore: new SessionStore({
60
+ options: {
61
+ idleTimeoutMS: sessionOptions?.idleTimeoutMS ?? 600000,
62
+ notificationTimeoutMS: sessionOptions?.notificationTimeoutMS ?? 540000,
63
+ maxSessions: sessionOptions?.maxSessions ?? 1000,
64
+ evictionIdleGraceMS: sessionOptions?.evictionIdleGraceMS ?? 120000,
65
+ },
66
+ logger,
67
+ metrics: this.metrics,
68
+ }),
71
69
  });
72
70
  }
73
- async startKeepAliveLoop({ transport, logger, signal, }) {
74
- if (this.httpOptions.responseType === "json") {
75
- // Don't start the ping loop for JSON response type since the connection is short-lived and pings aren't needed
76
- return;
77
- }
78
- let failedPings = 0;
79
- while (!signal.aborted) {
80
- try {
81
- logger.debug({
82
- id: LogId.streamableHttpTransportKeepAlive,
83
- context: "streamableHttpTransport",
84
- message: "Sending ping",
85
- });
86
- await transport.send({
87
- jsonrpc: "2.0",
88
- method: "ping",
89
- });
90
- failedPings = 0;
91
- }
92
- catch (err) {
93
- try {
94
- failedPings++;
95
- logger.warning({
96
- id: LogId.streamableHttpTransportKeepAliveFailure,
97
- context: "streamableHttpTransport",
98
- message: `Error sending ping (attempt #${failedPings}): ${err instanceof Error ? err.message : String(err)}`,
99
- });
100
- if (failedPings > 3) {
101
- await transport.close();
102
- return;
103
- }
104
- }
105
- catch {
106
- // Ignore the error of the transport close
107
- }
108
- }
109
- await sleep(30000, { signal });
110
- }
111
- }
71
+ /** Request middleware hook for `/mcp`, called after body parse + header validation, before routing. */
72
+ registerMiddlewares() { }
112
73
  /**
113
- * Ensures the session for the given sessionId is initialized, serializing
114
- * concurrent initialization attempts so only one runs at a time.
115
- *
116
- * If a session already exists in the store, this is a no-op.
117
- * If another request is already initializing this session, this call waits
118
- * for that initialization to complete.
119
- * Otherwise, this call performs the initialization.
120
- *
121
- * After this method resolves, the caller should look up the transport from
122
- * the session store via `sessionStore.getSession()`.
123
- *
124
- * When `isImplicitInitialization` is true, the transport is pre-configured as
125
- * initialized (bypassing the MCP initialize handshake) so that it can handle
126
- * non-initialize requests immediately. When false, the transport is left in
127
- * its default state so it can process the initialize request normally.
74
+ * Builds the 2026-07-28 serving entry. One factory backs every modern
75
+ * request: it constructs a fresh request-scoped server, registers it, and
76
+ * hands the underlying {@link McpServer} to `createMcpHandler`.
77
+ * `legacy: 'reject'` means this entry serves ONLY the 2026-07-28 era;
78
+ * 2025-era traffic is routed to the sessionful legacy handler (see
79
+ * {@link LegacyMcpHttpHandler}).
128
80
  */
129
- async ensureSessionInitialized({ req, sessionId: providedSessionId, isImplicitInitialization, }) {
130
- const sessionId = providedSessionId ?? getRandomUUID();
131
- const requestIdAttrs = requestIdAttr(req.headers);
132
- // Check if session already exists
133
- if (await this.sessionStore.getSession(sessionId, req.headers)) {
134
- return sessionId;
135
- }
136
- // Serialize initializations: if another request is initializing, wait for it
137
- const pendingInit = this.pendingInitializations.get(sessionId);
138
- if (pendingInit) {
139
- this.logger.debug({
140
- id: LogId.streamableHttpTransportSessionNotFound,
141
- context: "streamableHttpTransport",
142
- message: `Session with ID ${sessionId} is already being initialized, waiting`,
143
- attributes: { ...requestIdAttrs },
144
- });
145
- try {
146
- await pendingInit;
147
- }
148
- catch {
149
- // The initializer handles its own error
150
- }
151
- return sessionId;
152
- }
153
- this.logger.debug({
154
- id: LogId.streamableHttpTransportSessionNotFound,
155
- context: "streamableHttpTransport",
156
- message: `Session with ID ${sessionId} not found, initializing new session`,
157
- attributes: {
158
- ...requestIdAttrs,
159
- },
160
- });
161
- const initPromise = (async () => {
81
+ createModernHandler() {
82
+ const handler = createMcpHandler(async (ctx) => {
162
83
  const request = {
163
- headers: req.headers,
164
- query: req.query,
84
+ headers: Object.fromEntries(ctx.requestInfo?.headers ?? []),
85
+ query: ctx.requestInfo?.url
86
+ ? Object.fromEntries(new URL(ctx.requestInfo.url).searchParams)
87
+ : undefined,
88
+ // The explicit auth state of this request, normalized from the
89
+ // SDK's pass-through authInfo (hosts supply it via `req.auth`
90
+ // through the node adapter, or directly). "Unauthenticated" when
91
+ // no identity was injected.
92
+ authInfo: ctx.authInfo
93
+ ? { mode: "authenticated", state: ctx.authInfo }
94
+ : { mode: "unauthenticated" },
165
95
  };
166
96
  const server = await this.createServerForRequest(request);
167
- const transport = new StreamableHTTPServerTransport({
168
- sessionIdGenerator: () => sessionId,
169
- enableJsonResponse: this.httpOptions.responseType === "json",
170
- onsessionclosed: async (sessionId) => {
171
- try {
172
- await this.sessionStore.closeSession({ sessionId, reason: "transport_closed" });
173
- }
174
- catch (error) {
175
- this.logger.error({
176
- id: LogId.sessionCloseFailure,
177
- context: "streamableHttpTransport",
178
- message: `Error closing session ${sessionId}: ${error instanceof Error ? error.message : String(error)}`,
179
- });
180
- }
181
- },
182
- });
183
- // HACK: When we're implicitly initializing the session, we want to configure the session id and _initialized flag on the transport
184
- // so that it believes it actually went through the initialization flow. Without it, we'd get errors like "transport not initialized"
185
- // when we try to use it without initialize request
186
- if (isImplicitInitialization) {
187
- const internalTransport = transport["_webStandardTransport"];
188
- internalTransport._initialized = true;
189
- internalTransport.sessionId = sessionId;
190
- }
191
- server.session?.logger.setAttribute("sessionId", sessionId);
192
- const keepAliveController = new AbortController();
193
- void this.startKeepAliveLoop({
194
- transport,
195
- logger: server.session?.logger ?? this.logger,
196
- signal: keepAliveController.signal,
197
- });
198
- transport.onclose = () => {
199
- keepAliveController.abort();
200
- server.close().catch((error) => {
201
- this.logger.error({
202
- id: LogId.streamableHttpTransportCloseFailure,
203
- context: "streamableHttpTransport",
204
- message: `Error closing server: ${error instanceof Error ? error.message : String(error)}`,
205
- });
206
- });
207
- };
208
- await server.connect(transport);
209
- if (isImplicitInitialization) {
210
- await this.restoreNegotiatedClientState(server, sessionId, req.headers);
211
- }
212
- else {
213
- this.captureNegotiatedClientStateOnInitialize(server, sessionId, req.headers);
214
- }
215
- await this.sessionStore.addSession({
216
- sessionId,
217
- transport,
218
- logger: server.session?.logger ?? this.logger,
219
- session: server.session,
220
- // Pass the incoming request headers to the session store so
221
- // that we can trace the x-request-id and other headers in the
222
- // resulting logs and downstream requests.
223
- headers: req.headers,
224
- });
225
- })();
226
- this.pendingInitializations.set(sessionId, initPromise);
227
- try {
228
- await initPromise;
229
- }
230
- catch (error) {
231
- this.logger.error({
232
- id: LogId.streamableHttpTransportRequestFailure,
233
- context: "streamableHttpTransport",
234
- message: `Failed to initialize session ${sessionId}: ${error instanceof Error ? error.message : String(error)}`,
235
- attributes: { ...requestIdAttrs },
236
- });
237
- // Remove the partially initialized session on failure so that
238
- // subsequent requests don't see a broken session and can retry
239
- try {
240
- await this.sessionStore.closeSession({ sessionId, reason: "unknown" });
241
- }
242
- catch {
243
- // Session might not be in the store, that's fine
244
- }
245
- throw error;
97
+ await server.register();
98
+ return server.mcpServer;
99
+ }, { legacy: "reject" });
100
+ if (this.httpOptions.authMode !== "authenticated") {
101
+ return handler;
246
102
  }
247
- finally {
248
- this.pendingInitializations.delete(sessionId);
249
- }
250
- return sessionId;
251
- }
252
- /**
253
- * Restores the client state negotiated during the session's original
254
- * initialization onto an implicitly re-initialized server. The server on
255
- * this pod never saw the client's `initialize` request, so without this
256
- * it would treat the client as capability-less — e.g. skipping
257
- * confirmation elicitation for destructive tools. No-op when the session
258
- * store does not persist negotiated client state.
259
- */
260
- async restoreNegotiatedClientState(server, sessionId, headers) {
261
- let state;
262
- try {
263
- state = await this.sessionStore.loadNegotiatedClientState(sessionId, headers);
264
- }
265
- catch (error) {
266
- // The restored session stays usable; it just behaves as if the
267
- // client had no optional capabilities.
268
- this.logger.warning({
269
- id: LogId.streamableHttpTransportClientStateRestoreFailure,
270
- context: "streamableHttpTransport",
271
- message: `Failed to restore negotiated client state for session ${sessionId}: ${error instanceof Error ? error.message : String(error)}`,
272
- attributes: { ...requestIdAttr(headers) },
273
- });
274
- return;
275
- }
276
- if (!state) {
277
- return;
278
- }
279
- // HACK: like the transport `_initialized` flag above, the SDK offers
280
- // no supported way to seed a Server with a previously negotiated
281
- // initialization, so we write the private fields the initialize
282
- // handler would have populated.
283
- const mcpServer = server.mcpServer;
284
- const protocolServer = mcpServer.server;
285
- protocolServer._clientCapabilities = state.clientCapabilities;
286
- protocolServer._clientVersion = state.clientInfo;
287
- server.session.setMcpClient(state.clientInfo);
288
- }
289
- /**
290
- * Arranges for the client state negotiated by a real `initialize`
291
- * exchange to be persisted through the session store, so implicit
292
- * re-initializations of this session can restore it. Wraps the
293
- * `oninitialized` callback installed by `server.connect`, hence must run
294
- * after it.
295
- */
296
- captureNegotiatedClientStateOnInitialize(server, sessionId, headers) {
297
- const protocolServer = server.mcpServer.server;
298
- const originalOnInitialized = protocolServer.oninitialized;
299
- protocolServer.oninitialized = () => {
300
- originalOnInitialized?.();
301
- const state = {
302
- clientCapabilities: protocolServer.getClientCapabilities(),
303
- clientInfo: protocolServer.getClientVersion(),
304
- };
305
- this.sessionStore.saveNegotiatedClientState(sessionId, state, headers).catch((error) => {
306
- this.logger.warning({
307
- id: LogId.streamableHttpTransportClientStateSaveFailure,
308
- context: "streamableHttpTransport",
309
- message: `Failed to save negotiated client state for session ${sessionId}: ${error instanceof Error ? error.message : String(error)}`,
310
- attributes: { ...requestIdAttr(headers) },
311
- });
312
- });
103
+ // Authenticated mode, enforced at handler creation: every request must
104
+ // carry verified identity (host-supplied authInfo). Requests without it
105
+ // are rejected with 401 before the SDK sees them.
106
+ return {
107
+ ...handler,
108
+ fetch: async (request, options) => {
109
+ if (!options?.authInfo) {
110
+ return new Response(JSON.stringify({ error: "Unauthorized: authenticated request required" }), {
111
+ status: 401,
112
+ headers: {
113
+ "content-type": "application/json",
114
+ "www-authenticate": "Bearer",
115
+ },
116
+ });
117
+ }
118
+ return handler.fetch(request, options);
119
+ },
313
120
  };
314
121
  }
315
- setupMiddlewares() {
122
+ // eslint-disable-next-line @typescript-eslint/require-await -- Required for override signature
123
+ async setupRoutes() {
316
124
  this.app.use(express.json({ limit: this.httpOptions.bodyLimit ?? 1024 * 1024 }));
317
125
  const headers = this.httpOptions.headers;
318
126
  if (headers && Object.keys(headers).length > 0) {
@@ -327,83 +135,21 @@ export class MCPHttpServer extends ExpressBasedHttpServer {
327
135
  next();
328
136
  });
329
137
  }
330
- }
331
- // eslint-disable-next-line @typescript-eslint/require-await -- Required for override signature
332
- async setupRoutes() {
333
- this.setupMiddlewares();
334
- const handleSessionRequest = async (req, res) => {
335
- const sessionId = req.headers["mcp-session-id"];
336
- if (!sessionId) {
337
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_SESSION_ID_REQUIRED);
338
- }
339
- if (typeof sessionId !== "string") {
340
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_SESSION_ID_INVALID);
341
- }
342
- const requestIdAttrs = requestIdAttr(req.headers);
343
- let transport = await this.sessionStore.getSession(sessionId, req.headers);
344
- if (!transport) {
345
- if (!this.sessionOptions.externallyManagedSessions) {
346
- this.logger.debug({
347
- id: LogId.streamableHttpTransportSessionNotFound,
348
- context: "streamableHttpTransport",
349
- message: `Session with ID ${sessionId} not found`,
350
- attributes: { ...requestIdAttrs },
351
- });
352
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_SESSION_NOT_FOUND);
353
- }
354
- const resolvedSessionId = await this.ensureSessionInitialized({
355
- req,
356
- sessionId,
357
- isImplicitInitialization: true,
358
- });
359
- transport = await this.sessionStore.getSession(resolvedSessionId, req.headers);
360
- if (!transport) {
361
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_SESSION_NOT_FOUND);
362
- }
363
- }
364
- await transport.handleRequest(req, res, req.body);
365
- };
138
+ this.registerMiddlewares();
366
139
  this.app.post("/mcp", this.withErrorHandling(async (req, res) => {
367
- const sessionId = req.headers["mcp-session-id"];
368
- if (sessionId && typeof sessionId !== "string") {
369
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_SESSION_ID_INVALID);
370
- }
371
- if (isInitializeRequest(req.body)) {
372
- if (sessionId && !this.sessionOptions.externallyManagedSessions) {
373
- this.logger.debug({
374
- id: LogId.streamableHttpTransportDisallowedExternalSessionError,
375
- context: "streamableHttpTransport",
376
- message: `Client provided session ID ${sessionId}, but externallyManagedSessions is disabled`,
377
- attributes: requestIdAttr(req.headers),
378
- });
379
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_DISALLOWED_EXTERNAL_SESSION);
380
- }
381
- const resolvedSessionId = await this.ensureSessionInitialized({
382
- req,
383
- sessionId,
384
- isImplicitInitialization: false,
385
- });
386
- const transport = await this.sessionStore.getSession(resolvedSessionId, req.headers);
387
- if (!transport) {
388
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_SESSION_NOT_FOUND);
389
- }
390
- await transport.handleRequest(req, res, req.body);
391
- return;
392
- }
393
- if (sessionId) {
394
- return await handleSessionRequest(req, res);
395
- }
396
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_INVALID_REQUEST);
140
+ // 2025-era (no envelope claim) requests are served sessionfully so
141
+ // the legacy elicitation shim has a live return channel. Everything
142
+ // else (modern-enveloped) goes to the stateless modern handler.
143
+ const webRequest = await toWebRequest(req, req.body);
144
+ if (await isLegacyRequest(webRequest)) {
145
+ return await this.legacyHandler.handle(req, res);
146
+ }
147
+ return await toNodeHandler({ fetch: (request, opts) => this.modernHandler.fetch(request, opts) })(req, res, req.body);
397
148
  }));
398
- this.app.get("/mcp", this.withErrorHandling(async (req, res) => {
399
- if (this.httpOptions.responseType === "sse") {
400
- await handleSessionRequest(req, res);
401
- }
402
- else {
403
- res.status(405).set("Allow", ["POST", "DELETE"]).send("Method Not Allowed");
404
- }
405
- }));
406
- this.app.delete("/mcp", this.withErrorHandling(handleSessionRequest));
149
+ // 2025-era session operations (SSE idle stream via GET, session close via
150
+ // DELETE) only exist on the sessionful legacy path.
151
+ this.app.get("/mcp", this.withErrorHandling((req, res) => this.legacyHandler.handle(req, res)));
152
+ this.app.delete("/mcp", this.withErrorHandling((req, res) => this.legacyHandler.handle(req, res)));
407
153
  }
408
154
  withErrorHandling(fn) {
409
155
  return (req, res, next) => {
@@ -413,17 +159,8 @@ export class MCPHttpServer extends ExpressBasedHttpServer {
413
159
  id: LogId.streamableHttpTransportRequestFailure,
414
160
  context: "streamableHttpTransport",
415
161
  message: `Error handling request: ${errorMessage}`,
416
- attributes: requestIdAttr(req.headers),
162
+ attributes: { ...requestIdAttr(req.headers) },
417
163
  });
418
- if (error instanceof SessionRejectedError) {
419
- // Respond exactly as if the session doesn't exist so that
420
- // callers can't probe whether a session id is valid; the
421
- // rejection reason is only visible in the log above.
422
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_SESSION_NOT_FOUND);
423
- }
424
- if (error instanceof SessionLimitExceededError) {
425
- return this.reportSessionError(res, JSON_RPC_ERROR_CODE_SESSION_LIMIT_EXCEEDED);
426
- }
427
164
  // Only propagate error messages for user-facing errors
428
165
  const message = error instanceof UserFacingError ? error.message : `failed to handle request`;
429
166
  res.status(400).json({
@@ -1 +1 @@
1
- {"version":3,"file":"mcpHttpServer.js","sourceRoot":"","sources":["../src/mcpHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,mBAAmB,EAAgD,MAAM,oCAAoC,CAAC;AACvH,OAAO,OAAO,MAAM,SAAS,CAAC;AAa9B,OAAO,EACH,KAAK,EACL,uCAAuC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CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;iBAChD,CAAC,CAAC;gBAEH,uDAAuD;gBACvD,MAAM,OAAO,GAAG,KAAK,YAAY,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC;gBAE9F,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACjB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE;wBACH,IAAI,EAAE,6CAA6C;wBACnD,OAAO;qBACV;iBACJ,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;IACN,CAAC;CACJ"}
@@ -22,7 +22,7 @@ export class MonitoringServer extends ExpressBasedHttpServer {
22
22
  super({
23
23
  options: {
24
24
  logContext: "monitoringServer",
25
- http: { port: options.http.port, host: options.http.host },
25
+ http: { port: options.http.port, host: options.http.host, authMode: "unauthenticated" },
26
26
  },
27
27
  logger,
28
28
  });
@@ -1 +1 @@
1
- {"version":3,"file":"monitoringServer.js","sourceRoot":"","sources":["../src/monitoringServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEhE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,gBAEX,SAAQ,sBAAsB;IAK5B,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAqC;QACvE,KAAK,CAAC;YACF,OAAO,EAAE;gBACL,UAAU,EAAE,kBAAkB;gBAC9B,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;aAC7D;YACD,MAAM;SACT,CAAC,CAAC;QACH,IAAI,CAAC,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;qBAC1D,CAAC,CAAC;oBACH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAC;gBAClE,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC;QAED,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ"}
@@ -1,12 +1,12 @@
1
1
  import type { DefaultMetricDefinitions, ITransportRunner } from "@mongodb-js/mcp-types";
2
2
  import type { CompositeLogger } from "@mongodb-js/mcp-core";
3
3
  import type { MCPHttpServer } from "./mcpHttpServer.js";
4
- import type { SessionServer } from "@mongodb-js/mcp-types";
4
+ import type { BaseServer } from "@mongodb-js/mcp-types";
5
5
  import type { MonitoringServer } from "./monitoringServer.js";
6
6
  /**
7
7
  * Options for StreamableHttpRunner.
8
8
  */
9
- export type StreamableHttpRunnerOptions<TServer extends SessionServer = SessionServer, TMetrics extends DefaultMetricDefinitions = DefaultMetricDefinitions> = {
9
+ export type StreamableHttpRunnerOptions<TServer extends BaseServer = BaseServer, TMetrics extends DefaultMetricDefinitions = DefaultMetricDefinitions> = {
10
10
  /** Logger instance */
11
11
  logger: CompositeLogger;
12
12
  mcpHttpServer: MCPHttpServer<TServer, TMetrics>;
@@ -20,7 +20,7 @@ export type StreamableHttpRunnerOptions<TServer extends SessionServer = SessionS
20
20
  * To customize per-request server creation, extend `MCPHttpServer` and override
21
21
  * the `createServerForRequest()` method.
22
22
  */
23
- export declare class StreamableHttpRunner<TServer extends SessionServer = SessionServer, TMetrics extends DefaultMetricDefinitions = DefaultMetricDefinitions> implements ITransportRunner {
23
+ export declare class StreamableHttpRunner<TServer extends BaseServer = BaseServer, TMetrics extends DefaultMetricDefinitions = DefaultMetricDefinitions> implements ITransportRunner {
24
24
  protected readonly mcpHttpServer: MCPHttpServer<TServer, TMetrics>;
25
25
  protected readonly monitoringServer: MonitoringServer<TMetrics> | undefined;
26
26
  protected readonly logger: CompositeLogger;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;IAMvG,mCAAmC;IAC7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAa5B;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB1F"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB1F"}
package/dist/utils.js CHANGED
@@ -1,5 +1,9 @@
1
1
  export async function sleep(ms, { signal }) {
2
2
  return new Promise((resolve) => {
3
+ if (signal.aborted) {
4
+ resolve();
5
+ return;
6
+ }
3
7
  let listener = undefined;
4
8
  const timeout = setTimeout(() => {
5
9
  if (listener) {
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,EAAU,EAAE,EAAE,MAAM,EAA2B;IACvE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,IAAI,QAAQ,GAA6B,SAAS,CAAC;QACnD,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,IAAI,QAAQ,EAAE,CAAC;gBACX,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAClD,CAAC;YACD,OAAO,EAAE,CAAC;QACd,CAAC,EAAE,EAAE,CA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