@ateam-ai/mcp 0.4.22 → 0.4.23

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/http.js +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ateam-ai/mcp",
3
- "version": "0.4.22",
3
+ "version": "0.4.23",
4
4
  "mcpName": "io.github.ariekogan/ateam-mcp",
5
5
  "description": "A-Team MCP Server — build, validate, and deploy multi-agent solutions from any AI environment",
6
6
  "type": "module",
package/src/http.js CHANGED
@@ -257,7 +257,15 @@ export function startHttpServer(port = 3100) {
257
257
  console.log(`[HTTP] Stale session ${sessionId} — auto-reinitializing transparently (${req.body?.method || "unknown"})`);
258
258
  }
259
259
 
260
- const newSessionId = randomUUID();
260
+ // Reuse the client's existing session id instead of rotating to a fresh
261
+ // one. Many MCP clients (Claude Code, desktop) cache their session id and
262
+ // keep resending it, ignoring a rotated id we hand back. If we minted a
263
+ // new id here, every subsequent call would look stale again → another new
264
+ // id → the id set by ateam_auth is abandoned by the next call → the agent
265
+ // must re-auth "every few calls" (OPEN-6). Reusing the incoming id keeps
266
+ // it stable, so credentials set under it survive across recovery. Only
267
+ // mint a fresh id for a truly new client that has none yet.
268
+ const newSessionId = sessionId || randomUUID();
261
269
 
262
270
  // Seed credentials from OAuth Bearer token before server starts
263
271
  seedCredentials(req, newSessionId);