mcp-proxy 6.5.0 → 6.5.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/jsr.json CHANGED
@@ -3,5 +3,5 @@
3
3
  "include": ["src/index.ts", "src/bin/mcp-proxy.ts"],
4
4
  "license": "MIT",
5
5
  "name": "@punkpeye/mcp-proxy",
6
- "version": "6.5.0"
6
+ "version": "6.5.1"
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-proxy",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "main": "dist/index.mjs",
5
5
  "scripts": {
6
6
  "build": "tsdown",
@@ -688,7 +688,14 @@ const handleStreamRequest = async <T extends ServerLike>({
688
688
  }
689
689
  | undefined = sessionId ? activeTransports[sessionId] : undefined;
690
690
 
691
- if (!sessionId) {
691
+ if (!sessionId) {
692
+ // Return METHOD_NOT_ALLOWED so stateless clients' transport stops reconnecting
693
+ if (stateless) {
694
+ res.writeHead(405, { Allow: "POST" }).end("Method Not Allowed");
695
+
696
+ return true;
697
+ }
698
+
692
699
  res.writeHead(400).end("No sessionId");
693
700
 
694
701
  return true;