@ateam-ai/mcp 0.4.61 → 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 +21 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ateam-ai/mcp",
3
- "version": "0.4.61",
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
  },