@ateam-ai/mcp 0.4.2 → 0.4.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ateam-ai/mcp",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
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/api.js CHANGED
@@ -364,6 +364,30 @@ function formatError(method, path, status, body) {
364
364
  503: "A-Team API is temporarily unavailable. Try again in a minute.",
365
365
  };
366
366
 
367
+ // Special-case: GitHub App not connected for this tenant. This is the wall a
368
+ // user hits the first time they iterate on CONNECTOR CODE (github_patch /
369
+ // github_write / github_push / build_and_run auto-pull). The raw
370
+ // "github_not_connected" code + a generic 409 hint tells them nothing — so
371
+ // guide them explicitly to the one-time connect step and note the repo-less
372
+ // escape hatch for definition edits.
373
+ const bodyStr = typeof body === "string" ? body : (body ? JSON.stringify(body) : "");
374
+ if (/github_not_connected/i.test(bodyStr)) {
375
+ return [
376
+ `A-Team API error: ${method} ${path} — GitHub isn't connected for this tenant.`,
377
+ "",
378
+ "Versioned connector-code changes (edit, push, promote, deploy-from-repo) need a",
379
+ "GitHub repo, and this tenant hasn't connected one yet.",
380
+ "",
381
+ "→ Open this guide and follow the 3 steps: https://mcp.ateam-ai.com/connect-github",
382
+ "",
383
+ "In short: Tenant Admin → GitHub → \"Connect GitHub\", approve the App, then retry.",
384
+ "The repo is auto-created on the next deploy.",
385
+ "",
386
+ "No GitHub yet? Skill/solution DEFINITION edits still work without a repo via",
387
+ "ateam_patch(..., source:\"local\"). Only connector CODE iteration needs GitHub.",
388
+ ].join("\n");
389
+ }
390
+
367
391
  const hint = hints[status] || "";
368
392
  const detail = typeof body === "string" && body.length > 0 && body.length < 2000 ? body : "";
369
393
 
package/src/http.js CHANGED
@@ -29,6 +29,7 @@ import {
29
29
  bindSessionBearer, getAuthOverride,
30
30
  } from "./api.js";
31
31
  import { mountOAuth } from "./oauth.js";
32
+ import { connectGithubPage } from "./pages.js";
32
33
 
33
34
  // Active sessions
34
35
  const transports = {};
@@ -226,6 +227,12 @@ export function startHttpServer(port = 3100) {
226
227
  res.redirect("https://app.ateam-ai.com/builder/?show=api-key");
227
228
  });
228
229
 
230
+ // ─── Connect GitHub — user-facing guide an agent links to on
231
+ // github_not_connected (see formatError in api.js). ──
232
+ app.get("/connect-github", (_req, res) => {
233
+ res.type("html").send(connectGithubPage());
234
+ });
235
+
229
236
  // ─── MCP POST — handle tool calls + initialize ───────────────
230
237
  // Mounted at both "/" and "/mcp" for Claude.ai compatibility
231
238
  const mcpPost = async (req, res) => {
package/src/pages.js ADDED
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Static help pages served by the ateam-mcp HTTP server.
3
+ *
4
+ * These are user-facing landing pages an agent can link to from a tool result
5
+ * (e.g. the github_not_connected guide). Self-contained HTML, no external
6
+ * assets — matches the dark card style of the OAuth authorize page.
7
+ */
8
+
9
+ const APP_URL = process.env.ATEAM_APP_URL || "https://app.ateam-ai.com";
10
+
11
+ function shell(title, body) {
12
+ return `<!DOCTYPE html>
13
+ <html lang="en">
14
+ <head>
15
+ <meta charset="utf-8">
16
+ <meta name="viewport" content="width=device-width, initial-scale=1">
17
+ <title>${title} — A-Team</title>
18
+ <style>
19
+ * { box-sizing: border-box; margin: 0; padding: 0; }
20
+ body {
21
+ font-family: system-ui, -apple-system, sans-serif;
22
+ background: #0a0a0a; color: #e5e5e5;
23
+ display: flex; align-items: center; justify-content: center;
24
+ min-height: 100vh; padding: 20px; line-height: 1.55;
25
+ }
26
+ .card {
27
+ background: #171717; border: 1px solid #262626;
28
+ border-radius: 14px; padding: 34px; max-width: 560px; width: 100%;
29
+ }
30
+ .logo { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
31
+ h1 { font-size: 21px; font-weight: 650; margin: 14px 0 6px; }
32
+ .lead { color: #a3a3a3; font-size: 15px; margin-bottom: 22px; }
33
+ ol { margin: 0 0 22px; padding-left: 0; list-style: none; counter-reset: step; }
34
+ li { position: relative; padding: 12px 0 12px 44px; border-top: 1px solid #222; counter-increment: step; }
35
+ li:first-child { border-top: none; }
36
+ li::before {
37
+ content: counter(step); position: absolute; left: 0; top: 12px;
38
+ width: 28px; height: 28px; border-radius: 50%;
39
+ background: #1e3a5f; color: #93c5fd; font-weight: 700; font-size: 14px;
40
+ display: flex; align-items: center; justify-content: center;
41
+ }
42
+ li b { color: #fff; font-weight: 600; }
43
+ code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
44
+ background: #0a0a0a; border: 1px solid #333; border-radius: 5px;
45
+ padding: 1px 6px; font-size: 13px; color: #c4b5fd; }
46
+ .btn {
47
+ display: inline-block; background: #2563eb; color: #fff;
48
+ padding: 11px 20px; border-radius: 9px; font-size: 15px; font-weight: 600;
49
+ text-decoration: none;
50
+ }
51
+ .btn:hover { background: #1d4ed8; }
52
+ .note { margin-top: 20px; font-size: 13px; color: #737373; }
53
+ .note code { color: #9ca3af; }
54
+ a { color: #60a5fa; }
55
+ </style>
56
+ </head>
57
+ <body><div class="card">${body}</div></body>
58
+ </html>`;
59
+ }
60
+
61
+ export function connectGithubPage() {
62
+ return shell("Connect GitHub", `
63
+ <div class="logo">A-Team</div>
64
+ <h1>Connect GitHub to keep iterating</h1>
65
+ <div class="lead">
66
+ Editing, versioning, or promoting <b>connector code</b> needs a Git repo.
67
+ Connect your GitHub once — A-Team creates and manages the repo for you, and
68
+ every deploy is versioned from then on.
69
+ </div>
70
+ <ol>
71
+ <li>Open <b>Tenant Admin → GitHub</b> in the A-Team app (pick your tenant, then the GitHub tab).</li>
72
+ <li>Click <b>Connect GitHub</b> and approve the A-Team GitHub App for your account.</li>
73
+ <li>Go back to your agent and <b>retry</b> — the repo is auto-created on the next deploy.</li>
74
+ </ol>
75
+ <a class="btn" href="${APP_URL}" target="_blank" rel="noopener">Open the A-Team app →</a>
76
+ <div class="note">
77
+ Not ready for GitHub? Skill and solution <b>definition</b> edits still work
78
+ without a repo via <code>ateam_patch(..., source:"local")</code>. Only
79
+ connector <b>code</b> iteration needs GitHub.
80
+ </div>
81
+ `);
82
+ }