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.

This commit is contained in:
cliffhall 2025-09-15 18:09:44 -04:00
commit 51d28cd7b4

View file

@ -53,8 +53,8 @@ const getHttpHeaders = (req: express.Request): Record<string, string> => {
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") {