@ateam-ai/mcp 0.4.61 → 0.4.63
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/package.json +1 -1
- package/src/tools.js +31 -4
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -2248,6 +2248,16 @@ const EXAMPLE_PATHS = {
|
|
|
2248
2248
|
// baked into MCP config (e.g., ADAS_TENANT + ADAS_API_KEY in ~/.claude.json).
|
|
2249
2249
|
// Any tool that touches tenant-specific data (solutions, skills, logs, tests) is here.
|
|
2250
2250
|
const TENANT_TOOLS = new Set([
|
|
2251
|
+
// Lessons are tenant-specific data — a solution's own failure history. They
|
|
2252
|
+
// were MISSING from this set when the tools shipped (2026-08-21), which is a
|
|
2253
|
+
// bug on two counts: they ran without the explicit-auth requirement every
|
|
2254
|
+
// other tenant-scoped tool has, and in master mode `switchTenant` never fired
|
|
2255
|
+
// for them, so a caller passing `tenant` could read or write ANOTHER
|
|
2256
|
+
// tenant's lessons. Tenant isolation is the one boundary this platform
|
|
2257
|
+
// treats as absolute.
|
|
2258
|
+
"ateam_log_lesson",
|
|
2259
|
+
"ateam_get_lessons",
|
|
2260
|
+
|
|
2251
2261
|
// Write operations
|
|
2252
2262
|
"ateam_build_and_run",
|
|
2253
2263
|
"ateam_patch",
|
|
@@ -3167,13 +3177,30 @@ const handlers = {
|
|
|
3167
3177
|
const base = getBaseUrl(sessionId) || "";
|
|
3168
3178
|
const wellFormedKey = parseApiKey(api_key).isValid;
|
|
3169
3179
|
const triedProd = /(?:^|\/\/)api\.ateam-ai\.com/.test(base);
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3180
|
+
// THE HEADLINE MUST NOT CONTRADICT THE HINT. The upstream message is
|
|
3181
|
+
// "Invalid or unconfigured API key" — which for a well-formed key tried
|
|
3182
|
+
// against the WRONG ENVIRONMENT is false: the key is fine, the target is
|
|
3183
|
+
// wrong. Leading with it sent the reader to get a replacement key they
|
|
3184
|
+
// did not need. The hint below already said the right thing and rescued a
|
|
3185
|
+
// session on 2026-08-21, but only because someone read past the first
|
|
3186
|
+
// line. Lead with the likely cause; keep the upstream text as detail.
|
|
3187
|
+
if (wellFormedKey && triedProd) {
|
|
3188
|
+
return {
|
|
3189
|
+
ok: false,
|
|
3190
|
+
tenant: resolvedTenant,
|
|
3191
|
+
env_mismatch_suspected: true,
|
|
3192
|
+
message:
|
|
3193
|
+
`WRONG ENVIRONMENT, most likely — not a bad key. "adas_${resolvedTenant}_…" is a well-formed tenant key, ` +
|
|
3194
|
+
`and it was tried against PROD (${base}), which is the default. A DEV tenant's key is rejected there. ` +
|
|
3195
|
+
`Retry as: ateam_auth(api_key, url:"https://dev-api.ateam-ai.com"). ` +
|
|
3196
|
+
`Only if that also fails is the key itself the problem (get one at https://mcp.ateam-ai.com/get-api-key). ` +
|
|
3197
|
+
`Upstream said: ${err.message}`,
|
|
3198
|
+
};
|
|
3199
|
+
}
|
|
3173
3200
|
return {
|
|
3174
3201
|
ok: false,
|
|
3175
3202
|
tenant: resolvedTenant,
|
|
3176
|
-
message: `Authentication failed: ${err.message}
|
|
3203
|
+
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
3204
|
};
|
|
3178
3205
|
}
|
|
3179
3206
|
},
|