@ateam-ai/mcp 0.3.51 → 0.3.52
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 +15 -13
package/package.json
CHANGED
package/src/tools.js
CHANGED
|
@@ -280,12 +280,13 @@ export const tools = [
|
|
|
280
280
|
"Use for:\n" +
|
|
281
281
|
" • Channel fan-out smoke (does telegram/push/app actually receive it?)\n" +
|
|
282
282
|
" • Delivery-result verification (per-channel ok/failed in the response).\n\n" +
|
|
283
|
-
"
|
|
283
|
+
"Auth: forwards your authed api_key to Core (no master-secret involvement). Tenant is pinned by the key itself — cross-tenant targeting is structurally impossible.\n\n" +
|
|
284
|
+
"⚠️ SAFETY:\n" +
|
|
284
285
|
" • The text is prefixed with [TEST] in the actual notification — visible to the user, anti-phishing.\n" +
|
|
285
286
|
" • Rate-limited: 10 calls/min per session.\n" +
|
|
286
287
|
" • Every call is audited (caller, tenant, actor, content hash) regardless of outcome.\n" +
|
|
287
|
-
" • actor_id is scoped to your tenant — cross-tenant targeting is rejected by Core.\n" +
|
|
288
|
-
" • reply_handler is
|
|
288
|
+
" • actor_id is scoped to your tenant — cross-tenant targeting is rejected by Core's per-tenant Mongo isolation.\n" +
|
|
289
|
+
" • reply_handler is NOT supported via api-key auth (Core ignores it). Routing the user's next reply to an arbitrary skill is a privilege-escalation surface. For routing/engagement tests, use ateam_test_skill.",
|
|
289
290
|
inputSchema: {
|
|
290
291
|
type: "object",
|
|
291
292
|
properties: {
|
|
@@ -2836,18 +2837,19 @@ const handlers = {
|
|
|
2836
2837
|
entry.times.push(now);
|
|
2837
2838
|
bucket.set(sid, entry);
|
|
2838
2839
|
|
|
2839
|
-
//
|
|
2840
|
-
//
|
|
2841
|
-
//
|
|
2840
|
+
// Forward the caller's authed api_key to Core. Tenant scoping is
|
|
2841
|
+
// enforced by the key itself (Core's attachActor parses the tenant out
|
|
2842
|
+
// of adas_<tenant>_<hex> and pins req.tenant). This removes the need
|
|
2843
|
+
// for the MCP server to hold CORE_MCP_SECRET for this tool — the
|
|
2844
|
+
// caller's own credential is what authorizes the action.
|
|
2842
2845
|
const creds = getCredentials(sid);
|
|
2843
2846
|
const tenant = creds?.tenant;
|
|
2844
|
-
|
|
2847
|
+
const apiKey = creds?.apiKey;
|
|
2848
|
+
if (!tenant || !apiKey) {
|
|
2849
|
+
throw new Error("No api_key in session — call ateam_auth(api_key: \"adas_<tenant>_<hex>\") first. ateam_test_notification requires a tenant API key (master_key auth is not supported for this tool).");
|
|
2850
|
+
}
|
|
2845
2851
|
|
|
2846
2852
|
const coreUrl = process.env.ADAS_CORE_URL || "http://adas-backend:4000";
|
|
2847
|
-
const coreSecret = process.env.CORE_MCP_SECRET;
|
|
2848
|
-
if (!coreSecret) {
|
|
2849
|
-
throw new Error("Server config error: CORE_MCP_SECRET not set. ateam_test_notification requires the platform shared secret (sibling-service auth). Contact platform admin.");
|
|
2850
|
-
}
|
|
2851
2853
|
|
|
2852
2854
|
// Force [TEST] prefix on the user-visible content. Anti-phishing rail:
|
|
2853
2855
|
// even if a tenant admin api key were misused, the recipient sees
|
|
@@ -2880,8 +2882,8 @@ const handlers = {
|
|
|
2880
2882
|
method: "POST",
|
|
2881
2883
|
headers: {
|
|
2882
2884
|
"Content-Type": "application/json",
|
|
2883
|
-
|
|
2884
|
-
"
|
|
2885
|
+
// api-key auth — tenant pinned by Core's attachActor from the key itself.
|
|
2886
|
+
"x-api-key": apiKey,
|
|
2885
2887
|
"X-ADAS-SERVICE": "ateam-mcp.test_notification",
|
|
2886
2888
|
},
|
|
2887
2889
|
body: JSON.stringify(body),
|