mcp-proxy 6.4.0 → 6.4.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/bin/mcp-proxy.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{stdio-CyOk7u4Q.mjs → stdio-vt8L9uwX.mjs} +3 -3
- package/dist/{stdio-CyOk7u4Q.mjs.map → stdio-vt8L9uwX.mjs.map} +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/startHTTPServer.test.ts +1 -1
- package/src/startHTTPServer.ts +7 -4
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -2047,7 +2047,7 @@ it("uses default CORS settings when cors: true", async () => {
|
|
|
2047
2047
|
expect(response.status).toBe(204);
|
|
2048
2048
|
expect(response.headers.get("Access-Control-Allow-Origin")).toBe("*");
|
|
2049
2049
|
expect(response.headers.get("Access-Control-Allow-Headers")).toBe(
|
|
2050
|
-
"Content-Type, Authorization, Accept, Mcp-Session-Id, Last-Event-Id",
|
|
2050
|
+
"Content-Type, Authorization, Accept, Mcp-Session-Id, Mcp-Protocol-Version, Last-Event-Id",
|
|
2051
2051
|
);
|
|
2052
2052
|
expect(response.headers.get("Access-Control-Allow-Credentials")).toBe("true");
|
|
2053
2053
|
|
package/src/startHTTPServer.ts
CHANGED
|
@@ -219,7 +219,7 @@ const applyCorsHeaders = (
|
|
|
219
219
|
// Default CORS configuration for backward compatibility
|
|
220
220
|
const defaultCorsOptions: CorsOptions = {
|
|
221
221
|
allowedHeaders:
|
|
222
|
-
"Content-Type, Authorization, Accept, Mcp-Session-Id, Last-Event-Id",
|
|
222
|
+
"Content-Type, Authorization, Accept, Mcp-Session-Id, Mcp-Protocol-Version, Last-Event-Id",
|
|
223
223
|
credentials: true,
|
|
224
224
|
exposedHeaders: ["Mcp-Session-Id"],
|
|
225
225
|
methods: ["GET", "POST", "OPTIONS"],
|
|
@@ -348,9 +348,12 @@ const handleStreamRequest = async <T extends ServerLike>({
|
|
|
348
348
|
) {
|
|
349
349
|
let body: unknown;
|
|
350
350
|
try {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
// In stateless mode, ignore session ID header entirely (like Python MCP SDK)
|
|
352
|
+
const sessionId = stateless
|
|
353
|
+
? undefined
|
|
354
|
+
: (Array.isArray(req.headers["mcp-session-id"])
|
|
355
|
+
? req.headers["mcp-session-id"][0]
|
|
356
|
+
: req.headers["mcp-session-id"]);
|
|
354
357
|
|
|
355
358
|
let transport: StreamableHTTPServerTransport;
|
|
356
359
|
|