@ateam-ai/mcp 0.4.21 → 0.4.23
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/http.js +9 -1
- package/src/tools.js +33 -6
package/package.json
CHANGED
package/src/http.js
CHANGED
|
@@ -257,7 +257,15 @@ export function startHttpServer(port = 3100) {
|
|
|
257
257
|
console.log(`[HTTP] Stale session ${sessionId} — auto-reinitializing transparently (${req.body?.method || "unknown"})`);
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
// Reuse the client's existing session id instead of rotating to a fresh
|
|
261
|
+
// one. Many MCP clients (Claude Code, desktop) cache their session id and
|
|
262
|
+
// keep resending it, ignoring a rotated id we hand back. If we minted a
|
|
263
|
+
// new id here, every subsequent call would look stale again → another new
|
|
264
|
+
// id → the id set by ateam_auth is abandoned by the next call → the agent
|
|
265
|
+
// must re-auth "every few calls" (OPEN-6). Reusing the incoming id keeps
|
|
266
|
+
// it stable, so credentials set under it survive across recovery. Only
|
|
267
|
+
// mint a fresh id for a truly new client that has none yet.
|
|
268
|
+
const newSessionId = sessionId || randomUUID();
|
|
261
269
|
|
|
262
270
|
// Seed credentials from OAuth Bearer token before server starts
|
|
263
271
|
seedCredentials(req, newSessionId);
|
package/src/tools.js
CHANGED
|
@@ -2653,16 +2653,43 @@ const handlers = {
|
|
|
2653
2653
|
// Design-time capability advisor. Proxies to the Builder's /spec/advisor
|
|
2654
2654
|
// (LLM over the curated capability catalog). Public endpoint (auth-exempt),
|
|
2655
2655
|
// but we forward the session so a base override is honored.
|
|
2656
|
-
ateam_design_advisor: async ({ goal, design_state }, sid) => {
|
|
2656
|
+
ateam_design_advisor: async ({ goal, design_state, solution_id }, sid) => {
|
|
2657
2657
|
if (!goal || typeof goal !== "string") throw new Error("goal required (a string describing what you're building)");
|
|
2658
|
-
|
|
2658
|
+
// Reach the advisor through the sysSpecSearch-mcp platform connector via the
|
|
2659
|
+
// proven connector-call path (same as ateam_spec_search) — works on prod with
|
|
2660
|
+
// no bespoke /spec route. The connector's advise tool proxies the Builder's
|
|
2661
|
+
// LLM+catalog internally.
|
|
2662
|
+
const sol = solution_id || "_";
|
|
2663
|
+
const r = await post(
|
|
2664
|
+
`/deploy/solutions/${encodeURIComponent(sol)}/connectors/sysSpecSearch-mcp/call`,
|
|
2665
|
+
{ tool: "sysSpecSearch.advise", args: { goal, design_state: design_state || {} } },
|
|
2666
|
+
sid,
|
|
2667
|
+
{ timeoutMs: 90_000, retries: 1 },
|
|
2668
|
+
);
|
|
2669
|
+
const text = r?.result?.content?.[0]?.text;
|
|
2670
|
+
if (text) { try { return JSON.parse(text); } catch { return { ok: true, raw: text }; } }
|
|
2671
|
+
return r?.result ?? r;
|
|
2659
2672
|
},
|
|
2660
2673
|
|
|
2661
|
-
// Semantic search over the full /spec corpus
|
|
2662
|
-
//
|
|
2663
|
-
|
|
2674
|
+
// Semantic search over the full /spec corpus. Reaches the sysSpecSearch-mcp
|
|
2675
|
+
// PLATFORM connector through the proven connector-call path (the same route
|
|
2676
|
+
// ateam_test_connector uses) — so it works wherever the existing tools do, with
|
|
2677
|
+
// no bespoke /spec route to route on prod. Auth: the agent's api-key gates the
|
|
2678
|
+
// Builder route; the Builder calls Core with the internal secret; tenant is
|
|
2679
|
+
// forwarded from the session. solution_id is only for the route path (any).
|
|
2680
|
+
ateam_spec_search: async ({ query, top_k, solution_id }, sid) => {
|
|
2664
2681
|
if (!query || typeof query !== "string") throw new Error("query required (a string question)");
|
|
2665
|
-
|
|
2682
|
+
const sol = solution_id || "_";
|
|
2683
|
+
const r = await post(
|
|
2684
|
+
`/deploy/solutions/${encodeURIComponent(sol)}/connectors/sysSpecSearch-mcp/call`,
|
|
2685
|
+
{ tool: "sysSpecSearch.search", args: { query, ...(top_k ? { top_k } : {}) } },
|
|
2686
|
+
sid,
|
|
2687
|
+
{ timeoutMs: 30_000, retries: 1 },
|
|
2688
|
+
);
|
|
2689
|
+
// Unwrap the MCP tool result: { result: { content: [{ type:"text", text }] } }.
|
|
2690
|
+
const text = r?.result?.content?.[0]?.text;
|
|
2691
|
+
if (text) { try { return JSON.parse(text); } catch { return { ok: true, raw: text }; } }
|
|
2692
|
+
return r?.result ?? r;
|
|
2666
2693
|
},
|
|
2667
2694
|
|
|
2668
2695
|
// ─── Composite: Build & Run ────────────────────────────────────────
|