@lifeaitools/clauth 1.5.64 → 1.5.65
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/cli/commands/serve.js +6 -0
- package/package.json +1 -1
package/cli/commands/serve.js
CHANGED
|
@@ -3252,6 +3252,12 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
3252
3252
|
|
|
3253
3253
|
// ── MCP SSE transport — /sse and namespaced paths ────
|
|
3254
3254
|
// GET /sse|/gws|/clauth — open SSE stream, receive endpoint event
|
|
3255
|
+
// Remote clients (claude.ai) use Streamable HTTP (POST only) — return 404 on GET
|
|
3256
|
+
// so claude.ai knows to POST directly rather than trying SSE transport.
|
|
3257
|
+
if (method === "GET" && isMcpPath && req._clauthRemote) {
|
|
3258
|
+
res.writeHead(404, { "Content-Type": "application/json", ...CORS });
|
|
3259
|
+
return res.end(JSON.stringify({ error: "Use POST for Streamable HTTP transport" }));
|
|
3260
|
+
}
|
|
3255
3261
|
if (method === "GET" && (reqPath === "/sse" || isMcpPath)) {
|
|
3256
3262
|
const sessionId = `ses_${++sseCounter}_${Date.now()}`;
|
|
3257
3263
|
|