@ateam-ai/mcp 0.4.60 → 0.4.62

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/tools.js +35 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ateam-ai/mcp",
3
- "version": "0.4.60",
3
+ "version": "0.4.62",
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/tools.js CHANGED
@@ -3167,13 +3167,30 @@ const handlers = {
3167
3167
  const base = getBaseUrl(sessionId) || "";
3168
3168
  const wellFormedKey = parseApiKey(api_key).isValid;
3169
3169
  const triedProd = /(?:^|\/\/)api\.ateam-ai\.com/.test(base);
3170
- const hint = wellFormedKey && triedProd
3171
- ? ` This is a well-formed tenant key ("adas_${resolvedTenant}_…") but ${base} rejected it if it's a DEV key, retry: ateam_auth(api_key, url:"https://dev-api.ateam-ai.com").`
3172
- : ` (tried ${base || "the default base"})`;
3170
+ // THE HEADLINE MUST NOT CONTRADICT THE HINT. The upstream message is
3171
+ // "Invalid or unconfigured API key" — which for a well-formed key tried
3172
+ // against the WRONG ENVIRONMENT is false: the key is fine, the target is
3173
+ // wrong. Leading with it sent the reader to get a replacement key they
3174
+ // did not need. The hint below already said the right thing and rescued a
3175
+ // session on 2026-08-21, but only because someone read past the first
3176
+ // line. Lead with the likely cause; keep the upstream text as detail.
3177
+ if (wellFormedKey && triedProd) {
3178
+ return {
3179
+ ok: false,
3180
+ tenant: resolvedTenant,
3181
+ env_mismatch_suspected: true,
3182
+ message:
3183
+ `WRONG ENVIRONMENT, most likely — not a bad key. "adas_${resolvedTenant}_…" is a well-formed tenant key, ` +
3184
+ `and it was tried against PROD (${base}), which is the default. A DEV tenant's key is rejected there. ` +
3185
+ `Retry as: ateam_auth(api_key, url:"https://dev-api.ateam-ai.com"). ` +
3186
+ `Only if that also fails is the key itself the problem (get one at https://mcp.ateam-ai.com/get-api-key). ` +
3187
+ `Upstream said: ${err.message}`,
3188
+ };
3189
+ }
3173
3190
  return {
3174
3191
  ok: false,
3175
3192
  tenant: resolvedTenant,
3176
- message: `Authentication failed: ${err.message}.${hint} The user can get a valid API key at https://mcp.ateam-ai.com/get-api-key`,
3193
+ message: `Authentication failed: ${err.message} (tried ${base || "the default base"}). The user can get a valid API key at https://mcp.ateam-ai.com/get-api-key`,
3177
3194
  };
3178
3195
  }
3179
3196
  },
@@ -5527,7 +5544,20 @@ export async function handleToolCall(name, args, sessionId) {
5527
5544
  "",
5528
5545
  hasEnvVars
5529
5546
  ? "Environment variables (ADAS_API_KEY) were detected, but they are not sufficient for tenant-aware operations. You must call ateam_auth explicitly to confirm which tenant you intend to use."
5530
- : "No authentication found.",
5547
+ // "No authentication found." was TRUE and pointed at the WRONG CAUSE.
5548
+ // Auth is held in this process's memory and does NOT survive a
5549
+ // restart, so a container rebuild silently logs out every connected
5550
+ // session — and the message read like a first-time setup problem,
5551
+ // sending the reader to go get an API key they already had.
5552
+ // 2026-08-21: a Builder deploy logged out a live session mid-work
5553
+ // and cost a human round-trip to diagnose. State both causes; the
5554
+ // second is the likelier one for a session that was working a
5555
+ // moment ago.
5556
+ : "No authentication found in this process. TWO CAUSES, and the second is easy to miss:\n" +
5557
+ " (a) this session never authenticated, or\n" +
5558
+ " (b) THE MCP SERVER RESTARTED. Auth lives in memory and does not survive a restart, so a\n" +
5559
+ " container rebuild or redeploy logs out every connected session with no warning.\n" +
5560
+ "If your tools were working minutes ago, it is (b) — nothing is misconfigured, just re-run ateam_auth.",
5531
5561
  "",
5532
5562
  "Please ask the user to:",
5533
5563
  "1. Get their API key at: https://mcp.ateam-ai.com/get-api-key",