From 51d28cd7b4701d715bf3957239682cae2ac9a945 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Mon, 15 Sep 2025 18:09:44 -0400 Subject: [PATCH] When the client sends a request, do not pass on the mcp-session-id header for the Client <-> Proxy connection. This causes a problem for stateless SSE or StreamableHttp connections. --- server/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/index.ts b/server/src/index.ts index af3ea9284..7e966d34a 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -53,8 +53,8 @@ const getHttpHeaders = (req: express.Request): Record => { lowerKey === "authorization" || lowerKey === "last-event-id" ) { - // Exclude the proxy's own authentication header - if (lowerKey !== "x-mcp-proxy-auth") { + // Exclude the proxy's own authentication header and the Client <-> Proxy session ID header + if (lowerKey !== "x-mcp-proxy-auth" && lowerKey !== "mcp-session-id") { const value = req.headers[key]; if (typeof value === "string") {