@ateam-ai/mcp 0.4.51 → 0.4.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/server.js +6 -2
- package/src/tools.js +82 -2
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
CallToolRequestSchema,
|
|
11
11
|
ListToolsRequestSchema,
|
|
12
12
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
13
|
-
import { tools, coreTools, handleToolCall } from "./tools.js";
|
|
13
|
+
import { tools, coreTools, handleToolCall, MCP_VERSION } from "./tools.js";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @param {string} sessionId — identifier for credential isolation.
|
|
@@ -18,7 +18,11 @@ import { tools, coreTools, handleToolCall } from "./tools.js";
|
|
|
18
18
|
*/
|
|
19
19
|
export function createServer(sessionId = "stdio") {
|
|
20
20
|
const server = new Server(
|
|
21
|
-
|
|
21
|
+
// Read the REAL version from package.json. This was hardcoded "0.3.0" while
|
|
22
|
+
// the package shipped 0.4.x — so the MCP handshake advertised a version that
|
|
23
|
+
// had been wrong for dozens of releases, and "which build am I talking to?"
|
|
24
|
+
// could not be answered from the protocol at all.
|
|
25
|
+
{ name: "ateam-mcp", version: MCP_VERSION },
|
|
22
26
|
{
|
|
23
27
|
capabilities: { tools: {} },
|
|
24
28
|
instructions: [
|
package/src/tools.js
CHANGED
|
@@ -31,6 +31,18 @@ const STAMP_WHERE_TOOLS = new Set([
|
|
|
31
31
|
import { renderAgentDocHeader, mergeAgentDoc, AGENT_DOC_SENTINEL } from "./agentDoc.js";
|
|
32
32
|
import { deriveErrorCode, isLogicalFailure } from "./mcpFailure.js";
|
|
33
33
|
|
|
34
|
+
// The RUNNING version, read from package.json — never hardcoded. "Deployed" means
|
|
35
|
+
// three different things here (the mac1 container, npm, and each developer's local
|
|
36
|
+
// checkout+process), and a stale local PROCESS is indistinguishable from a broken
|
|
37
|
+
// fix without this. Surfaced in the MCP handshake and in ateam_bootstrap so
|
|
38
|
+
// "which build am I talking to?" is a five-second check, not a three-message
|
|
39
|
+
// round-trip (2026-08-16).
|
|
40
|
+
import { createRequire as _createRequire } from "node:module";
|
|
41
|
+
export const MCP_VERSION = (() => {
|
|
42
|
+
try { return _createRequire(import.meta.url)("../package.json").version; }
|
|
43
|
+
catch { return "unknown"; }
|
|
44
|
+
})();
|
|
45
|
+
|
|
34
46
|
// ─── Async deploy helper ────────────────────────────────────────────
|
|
35
47
|
//
|
|
36
48
|
// All long-running deploy endpoints (build_and_run, redeploy, github_pull)
|
|
@@ -450,9 +462,9 @@ export const tools = [
|
|
|
450
462
|
properties: {
|
|
451
463
|
topic: {
|
|
452
464
|
type: "string",
|
|
453
|
-
enum: ["overview", "skill", "solution", "enums", "connector-multi-user", "python_helpers", "widgets", "ui-plugins", "actor-storage", "voice", "voice-native", "triggers", "sub-agent", "consumer-roles", "mobile-connector"],
|
|
465
|
+
enum: ["overview", "skill", "solution", "enums", "connector-multi-user", "python_helpers", "widgets", "ui-plugins", "actor-storage", "voice", "voice-native", "triggers", "sub-agent", "consumer-roles", "mobile-connector", "monitoring"],
|
|
454
466
|
description:
|
|
455
|
-
"What to fetch: 'overview' = API overview + endpoints, 'skill' = full skill spec, 'solution' = full solution spec, 'enums' = all enum values, 'connector-multi-user' = multi-user connector guide, 'python_helpers' = adas.* helper namespace for run_python_script orchestration (read this when designing personas that read state → call tools → checkpoint → status; without it, scripts hand-roll JSON parsing and tool delegation = 5-10x larger and brittler), 'widgets' = widget (UI plugin) spec: catalog model, how_to_use block shape (solution.json snippet + opener_call + persona_phrasing + binding_notes), and rules for declaring ui_plugins. Pair with ateam_get_widget_catalog for the live per-tenant inventory. 'ui-plugins' = the DEEP React Native (mobile) plugin build guide: author in rn-src/, compile with a build:rn esbuild script (format=cjs, target=es2015, external react/react-native/@adas/plugin-sdk) to rn-bundle/index.bundle.js, plain-object export — read this before authoring any MOBILE widget.",
|
|
467
|
+
"What to fetch: 'overview' = API overview + endpoints, 'skill' = full skill spec, 'solution' = full solution spec, 'enums' = all enum values, 'connector-multi-user' = multi-user connector guide, 'python_helpers' = adas.* helper namespace for run_python_script orchestration (read this when designing personas that read state → call tools → checkpoint → status; without it, scripts hand-roll JSON parsing and tool delegation = 5-10x larger and brittler), 'widgets' = widget (UI plugin) spec: catalog model, how_to_use block shape (solution.json snippet + opener_call + persona_phrasing + binding_notes), and rules for declaring ui_plugins. Pair with ateam_get_widget_catalog for the live per-tenant inventory. 'ui-plugins' = the DEEP React Native (mobile) plugin build guide: author in rn-src/, compile with a build:rn esbuild script (format=cjs, target=es2015, external react/react-native/@adas/plugin-sdk) to rn-bundle/index.bundle.js, plain-object export — read this before authoring any MOBILE widget. 'monitoring' = THE MONITORING CONTRACT: which tools are safe to call in a poll loop (with cost / poll interval / whether output stays bounded as the run grows), which are not and what to use instead, plus the running ateam-mcp version. Read this BEFORE writing any loop that watches a build — the safe poll is ateam_chain_status, never ateam_get_chain.",
|
|
456
468
|
},
|
|
457
469
|
section: {
|
|
458
470
|
type: "string",
|
|
@@ -1356,6 +1368,10 @@ export const tools = [
|
|
|
1356
1368
|
{
|
|
1357
1369
|
name: "ateam_test_status",
|
|
1358
1370
|
core: true,
|
|
1371
|
+
// Monitoring-safe for ONE test job (bounded), but include_chain:true pulls the
|
|
1372
|
+
// full tree — that call is NOT safe to loop.
|
|
1373
|
+
monitoring: { safe: true, cost: "cheap", latency_ms_p95: 500, output: "bounded", poll_interval_s: 2,
|
|
1374
|
+
note: "safe:false when include_chain:true (that fetches the full tree)." },
|
|
1359
1375
|
description:
|
|
1360
1376
|
"Poll the progress of an async skill test. Returns iteration count, tool call steps, status (running/completed/failed), and result when done.\n\n" +
|
|
1361
1377
|
"Set include_chain:true to ALSO include the full chain tree (every job in the chain, rooted at this job_id, with parent/child linkage). Use when this job dispatched askAnySkill subcalls and you want a single snapshot of the whole multi-skill state instead of polling each child job_id separately.",
|
|
@@ -1386,6 +1402,10 @@ export const tools = [
|
|
|
1386
1402
|
{
|
|
1387
1403
|
name: "ateam_get_chain",
|
|
1388
1404
|
core: true,
|
|
1405
|
+
// NOT monitoring-safe: returns the FULL job tree — output grows with the run
|
|
1406
|
+
// (a 200-step job returns 200 steps), which is the property that silently
|
|
1407
|
+
// degrades. Use once at the end; poll ateam_chain_status instead.
|
|
1408
|
+
monitoring: { safe: false, cost: "heavy", output: "grows_with_run", use_instead: "ateam_chain_status" },
|
|
1389
1409
|
description:
|
|
1390
1410
|
"Inspect the full chain tree for any job — rooted at the given job_id, walking down through every handoff and askAnySkill subcall.\n\n" +
|
|
1391
1411
|
"Use when a chain has already run and you want to analyze the structure: which skill called which, how deep the call tree went, which tool inside which job invoked which sub-tool. The two main shapes:\n" +
|
|
@@ -1411,6 +1431,17 @@ export const tools = [
|
|
|
1411
1431
|
{
|
|
1412
1432
|
name: "ateam_chain_status",
|
|
1413
1433
|
core: true,
|
|
1434
|
+
// MONITORING-SAFE — the one tool built for a poll loop. See MONITORING_CONTRACT.
|
|
1435
|
+
// cheap: one status read, no tree walk, no LLM. bounded: the response does NOT
|
|
1436
|
+
// grow with the run (a 200-step job returns the same shape as a 2-step one).
|
|
1437
|
+
monitoring: {
|
|
1438
|
+
safe: true,
|
|
1439
|
+
cost: "cheap",
|
|
1440
|
+
latency_ms_p95: 500,
|
|
1441
|
+
output: "bounded",
|
|
1442
|
+
poll_interval_s: 2,
|
|
1443
|
+
note: "Returns last_activity_at / idle_seconds / activity_source. A LARGE idle_seconds does NOT mean dead — on this platform a healthy build sits minutes inside a single provider call. Read activity_source (what it was doing) with it; never apply an 'idle > N ⇒ dead' rule.",
|
|
1444
|
+
},
|
|
1414
1445
|
description:
|
|
1415
1446
|
"SLIM chain status — the chip-quick poll. Given a chain_id (from ateam_conversation), returns the WHOLE-CHAIN aggregate status cheaply: chain_status + chain_done (true only when the ENTIRE chain — root job + every handoff + askAnySkill subcall — is terminal), plus pending_question, result, and a short progress line.\n\n" +
|
|
1416
1447
|
"This is what you poll on a loop after ateam_conversation — NOT ateam_get_chain (that returns the full tree; too heavy for periodic polling). A single job can finish while the chain is still running, so poll chain_done, not a job's status.\n\n" +
|
|
@@ -1543,6 +1574,7 @@ export const tools = [
|
|
|
1543
1574
|
},
|
|
1544
1575
|
{
|
|
1545
1576
|
name: "ateam_get_metrics",
|
|
1577
|
+
monitoring: { safe: true, cost: "cheap", latency_ms_p95: 1000, output: "bounded", poll_interval_s: 30 },
|
|
1546
1578
|
// Advertised (was core:false): these are the RUNTIME DIAGNOSTICS a caller needs
|
|
1547
1579
|
// mid-run, but a connector-wildcard grant expands over ADVERTISED tools only, so
|
|
1548
1580
|
// hiding them made them ungrantable — invisible to every agent that needed them.
|
|
@@ -1571,6 +1603,9 @@ export const tools = [
|
|
|
1571
1603
|
{
|
|
1572
1604
|
name: "ateam_verify",
|
|
1573
1605
|
core: true,
|
|
1606
|
+
// Real end-state check — probes connectors/widgets/skills. Correct but SLOW;
|
|
1607
|
+
// for a run in flight poll ateam_chain_status and call this once at the end.
|
|
1608
|
+
monitoring: { safe: false, cost: "heavy", output: "bounded", use_instead: "ateam_chain_status" },
|
|
1574
1609
|
description:
|
|
1575
1610
|
"ONE call that returns the REAL runtime end-state of a solution — connectors connected + tools discovered, every declared widget actually rendering, skills deployed — with the EXACT failing gaps. Use this instead of guess-and-check after a deploy/patch: it tells you the truth (what's actually live) and names precisely what's broken, not a generic warning. Reliable from any connection (routes through the Builder, not a direct Core call).",
|
|
1576
1611
|
inputSchema: {
|
|
@@ -1976,6 +2011,8 @@ export const tools = [
|
|
|
1976
2011
|
{
|
|
1977
2012
|
name: "ateam_connector_logs",
|
|
1978
2013
|
core: true,
|
|
2014
|
+
// Bounded by the caller's line limit, but it reads container logs — poll slowly.
|
|
2015
|
+
monitoring: { safe: true, cost: "moderate", latency_ms_p95: 3000, output: "bounded", poll_interval_s: 30 },
|
|
1979
2016
|
description:
|
|
1980
2017
|
"Read what a connector process actually PRINTED to stderr. This is the only place a connector's " +
|
|
1981
2018
|
"internal failure is visible: a tool that catches its own error still returns ok:true, and the widget " +
|
|
@@ -2027,6 +2064,8 @@ export const tools = [
|
|
|
2027
2064
|
{
|
|
2028
2065
|
name: "ateam_status_all",
|
|
2029
2066
|
core: true,
|
|
2067
|
+
// Safe but not cheap-per-second: health across ALL solutions. Poll sparingly.
|
|
2068
|
+
monitoring: { safe: true, cost: "moderate", latency_ms_p95: 3000, output: "bounded", poll_interval_s: 30 },
|
|
2030
2069
|
description:
|
|
2031
2070
|
"Show GitHub sync status for ALL tenants and solutions in one call. Requires master key authentication. Returns a summary table of every tenant's solutions with their GitHub sync state.",
|
|
2032
2071
|
inputSchema: {
|
|
@@ -2061,6 +2100,23 @@ export const tools = [
|
|
|
2061
2100
|
*/
|
|
2062
2101
|
export const coreTools = tools.filter(t => t.core !== false);
|
|
2063
2102
|
|
|
2103
|
+
// MONITORING CONTRACT — machine-filterable answer to "what may I poll on a loop?"
|
|
2104
|
+
// The knowledge used to exist only as prose, scattered and contradictory across
|
|
2105
|
+
// tool descriptions ("too heavy to loop on" in one, "poll every ~2s" in another,
|
|
2106
|
+
// different words, different tools), so a caller had to read paragraphs carefully
|
|
2107
|
+
// to learn which call was safe in a loop. Now it is a field.
|
|
2108
|
+
// safe — may be called repeatedly in a poll loop
|
|
2109
|
+
// cost — cheap | moderate | heavy
|
|
2110
|
+
// output — "bounded" means bounded IN THE RUN'S SIZE, not merely small
|
|
2111
|
+
// today. The silent-degradation failure is a tool that is
|
|
2112
|
+
// concise on a 5-step job and returns 200 steps on a 200-step
|
|
2113
|
+
// job; that is output:"grows_with_run", never safe.
|
|
2114
|
+
// poll_interval_s — the interval the tool is designed for
|
|
2115
|
+
// A tool with NO monitoring field is UNCLASSIFIED — treat as unsafe to poll.
|
|
2116
|
+
export const monitoringTools = tools
|
|
2117
|
+
.filter(t => t.monitoring?.safe === true)
|
|
2118
|
+
.map(t => ({ name: t.name, ...t.monitoring }));
|
|
2119
|
+
|
|
2064
2120
|
// ─── Tool handlers ──────────────────────────────────────────────────
|
|
2065
2121
|
|
|
2066
2122
|
const SPEC_PATHS = {
|
|
@@ -2612,6 +2668,11 @@ module.exports.default = plugin;
|
|
|
2612
2668
|
|
|
2613
2669
|
const handlers = {
|
|
2614
2670
|
ateam_bootstrap: async () => ({
|
|
2671
|
+
runtime: {
|
|
2672
|
+
ateam_mcp_version: MCP_VERSION,
|
|
2673
|
+
base_url: getBaseUrl(),
|
|
2674
|
+
_note: "The version of the ateam-mcp process actually serving this call, and the API it talks to. If a fix looks missing, check this FIRST — a local MCP process keeps running the code it loaded at session start, so a pushed/published fix is not live until the process restarts.",
|
|
2675
|
+
},
|
|
2615
2676
|
platform_positioning: {
|
|
2616
2677
|
name: "A-Team",
|
|
2617
2678
|
category: "AI Team Solution Platform",
|
|
@@ -2977,6 +3038,25 @@ const handlers = {
|
|
|
2977
3038
|
},
|
|
2978
3039
|
|
|
2979
3040
|
ateam_get_spec: async ({ topic, section, search }, sid) => {
|
|
3041
|
+
// Served LOCALLY (no round-trip): the monitoring contract is a property of
|
|
3042
|
+
// THIS ateam-mcp build, so it must answer even when the API is unreachable —
|
|
3043
|
+
// that is exactly when a caller is asking "what can I poll to find out?".
|
|
3044
|
+
if (topic === "monitoring") {
|
|
3045
|
+
return {
|
|
3046
|
+
ateam_mcp_version: MCP_VERSION,
|
|
3047
|
+
safe_to_poll: monitoringTools,
|
|
3048
|
+
not_safe_to_poll: tools
|
|
3049
|
+
.filter(t => t.monitoring?.safe === false)
|
|
3050
|
+
.map(t => ({ name: t.name, cost: t.monitoring.cost, output: t.monitoring.output, use_instead: t.monitoring.use_instead })),
|
|
3051
|
+
unclassified_are_unsafe: true,
|
|
3052
|
+
rules: [
|
|
3053
|
+
"output:'bounded' means bounded IN THE RUN'S SIZE — not merely small today. A tool that returns 200 steps for a 200-step job is grows_with_run and is never poll-safe.",
|
|
3054
|
+
"A tool with no monitoring field is UNCLASSIFIED — treat it as unsafe to poll.",
|
|
3055
|
+
"NEVER apply an 'idle_seconds > N ⇒ dead' rule. On this platform a healthy build regularly sits minutes inside a single provider call; read activity_source alongside it.",
|
|
3056
|
+
],
|
|
3057
|
+
watching_a_run: "Poll ateam_chain_status (every ~2s, or ~30s for a long build) and read chain_done + last_activity_at/idle_seconds/activity_source. Call ateam_get_chain ONCE at the end for the full tree.",
|
|
3058
|
+
};
|
|
3059
|
+
}
|
|
2980
3060
|
let path = SPEC_PATHS[topic];
|
|
2981
3061
|
const params = new URLSearchParams();
|
|
2982
3062
|
if (section) params.set('section', section);
|