@ateam-ai/mcp 0.3.4 → 0.3.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools.js +74 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ateam-ai/mcp",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
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/tools.js CHANGED
@@ -120,7 +120,7 @@ export const tools = [
120
120
  name: "ateam_build_and_run",
121
121
  core: true,
122
122
  description:
123
- "Build and deploy a governed AI Team solution in one step. ⚠️ HEAVIEST OPERATION (60-180s): validates solution+skills → deploys all connectors+skills to A-Team Core (regenerates MCP servers) → health-checks → optionally runs a warm test → auto-pushes to GitHub. Use this instead of calling validate, deploy, and health separately. For small changes to an already-deployed solution, prefer ateam_patch (faster, incremental). Requires authentication.",
123
+ "Build and deploy a governed AI Team solution in one step. ⚠️ HEAVIEST OPERATION (60-180s): validates solution+skills → deploys all connectors+skills to A-Team Core (regenerates MCP servers) → health-checks → optionally runs a warm test → auto-pushes to GitHub. AUTO-DETECTS GitHub repo: if you omit mcp_store and a repo exists, connector code is pulled from GitHub automatically. First deploy requires mcp_store. After that, write files via ateam_github_write, then just call build_and_run without mcp_store. For small changes to an already-deployed solution, prefer ateam_patch (faster, incremental). Requires authentication.",
124
124
  inputSchema: {
125
125
  type: "object",
126
126
  properties: {
@@ -144,7 +144,7 @@ export const tools = [
144
144
  },
145
145
  github: {
146
146
  type: "boolean",
147
- description: "Optional: if true, pull connector source code from the solution's GitHub repo instead of requiring mcp_store. Use this after the first deploy (which creates the repo). Cannot be used on first deploy.",
147
+ description: "Optional: if true, pull connector source code from the solution's GitHub repo. AUTO-DETECTED: if you omit both mcp_store and github, the system checks if a repo exists and pulls from it automatically. You rarely need to set this explicitly.",
148
148
  },
149
149
  test_message: {
150
150
  type: "string",
@@ -850,6 +850,36 @@ export const tools = [
850
850
  required: ["solution_id", "path"],
851
851
  },
852
852
  },
853
+ {
854
+ name: "ateam_github_write",
855
+ core: true,
856
+ description:
857
+ "Write a file to the solution's GitHub repo. Use this to create new connector files or replace existing ones — one file per call. " +
858
+ "This is the PRIMARY way to write connector code after first deploy. " +
859
+ "Write each file individually (server.js, package.json, UI assets), then call ateam_build_and_run() to deploy.",
860
+ inputSchema: {
861
+ type: "object",
862
+ properties: {
863
+ solution_id: {
864
+ type: "string",
865
+ description: "The solution ID",
866
+ },
867
+ path: {
868
+ type: "string",
869
+ description: "File path to write (e.g. 'connectors/my-mcp/server.js', 'connectors/my-mcp/package.json')",
870
+ },
871
+ content: {
872
+ type: "string",
873
+ description: "The full file content",
874
+ },
875
+ message: {
876
+ type: "string",
877
+ description: "Optional commit message (default: 'Write <path>')",
878
+ },
879
+ },
880
+ required: ["solution_id", "path", "content"],
881
+ },
882
+ },
853
883
  {
854
884
  name: "ateam_github_log",
855
885
  core: true,
@@ -1084,7 +1114,7 @@ const handlers = {
1084
1114
  { step: 1, action: "Learn", description: "Get the spec and study examples", tools: ["ateam_get_spec", "ateam_get_examples"] },
1085
1115
  { step: 2, action: "Build & Run", description: "Define your solution + skills + connector code, then validate, deploy, and health-check in one call. Include mcp_store with connector source code on the first deploy.", tools: ["ateam_build_and_run"] },
1086
1116
  { step: 3, action: "Version", description: "Every deploy auto-pushes to main on GitHub. The repo (tenant--solution-id) is the source of truth for connector code.", tools: ["ateam_github_status", "ateam_github_log"] },
1087
- { step: 4, action: "Iterate", description: "Edit connector code via ateam_github_patch (commits to main), then redeploy with ateam_build_and_run(github:true). For skill definition changes, use ateam_patch (also pushes to main).", tools: ["ateam_github_patch", "ateam_build_and_run", "ateam_patch"] },
1117
+ { step: 4, action: "Iterate", description: "Edit connector code ONE FILE AT A TIME via ateam_github_patch, then redeploy with ateam_build_and_run (auto-pulls from GitHub). NEVER re-pass all connector code inline after first deploy. For skill definitions, use ateam_patch.", tools: ["ateam_github_patch", "ateam_build_and_run", "ateam_patch"] },
1088
1118
  { step: 5, action: "Test & Debug", description: "Test the decision pipeline or full execution, then diagnose with logs and metrics. For voice-enabled solutions, use ateam_test_voice to simulate phone conversations.", tools: ["ateam_test_pipeline", "ateam_test_skill", "ateam_test_voice", "ateam_get_execution_logs", "ateam_get_metrics"] },
1089
1119
  { step: 6, action: "Checkpoint", description: "When solution is in a good state, create a checkpoint (safe point). You can rollback to any checkpoint if something breaks.", tools: ["ateam_github_promote", "ateam_github_list_versions"] },
1090
1120
  ],
@@ -1114,16 +1144,18 @@ const handlers = {
1114
1144
  branch: "main — the only branch. All changes land here directly.",
1115
1145
  checkpoints: "safe-YYYY-MM-DD-NNN tags mark safe rollback points. Create with ateam_github_promote().",
1116
1146
  iteration_workflow: {
1117
- code_changes: "ateam_github_patch (commits to main) → ateam_build_and_run(github:true) (pulls from main, redeploys)",
1147
+ code_changes: "ateam_github_patch (one file at a time, commits to main) → ateam_build_and_run() (auto-pulls from GitHub, redeploys)",
1118
1148
  definition_changes: "ateam_patch (updates + redeploys + auto-pushes to main)",
1119
1149
  first_deploy: "Must include mcp_store — this creates the GitHub repo",
1150
+ after_first_deploy: "NEVER pass mcp_store again. Write files via ateam_github_patch, then ateam_build_and_run() auto-detects the repo.",
1120
1151
  checkpoint: "ateam_github_promote(solution_id) — tag current state as a safe rollback point",
1121
1152
  },
1122
1153
  when_to_use_what: {
1123
- ateam_github_patch: "Edit connector source code on main (server.js, utils, package.json, UI assets)",
1154
+ ateam_github_write: "Write/create connector files on main — ONE FILE PER CALL (server.js, package.json, UI assets). Use this after first deploy.",
1155
+ ateam_github_patch: "Edit existing files with search/replace (surgical edits to large files)",
1124
1156
  ateam_patch: "Edit skill definitions (intents, tools, policy) — auto-pushes to main",
1125
- "ateam_build_and_run(github:true)": "Redeploy solution pulling latest connector code from main",
1126
- "ateam_build_and_run(mcp_store)": "First deploy or when you want to pass connector code inline",
1157
+ "ateam_build_and_run()": "Redeploy auto-pulls from GitHub if repo exists. No need to pass mcp_store or github flag.",
1158
+ "ateam_build_and_run(mcp_store)": "FIRST DEPLOY ONLY creates the GitHub repo. Never use mcp_store again after first deploy.",
1127
1159
  ateam_github_promote: "Create a checkpoint (safe-* tag) — use before risky changes",
1128
1160
  ateam_github_rollback: "Revert main to a previous checkpoint",
1129
1161
  },
@@ -1179,6 +1211,8 @@ const handlers = {
1179
1211
  "Dump raw spec unless requested",
1180
1212
  "Write connector code that starts a web server — connectors MUST use stdio transport",
1181
1213
  "Mention dev branch — there is no dev branch, everything is on main",
1214
+ "Pass large connector code via mcp_store after the first deploy — use ateam_github_write/ateam_github_patch one file at a time instead",
1215
+ "Try to pass ALL connector files at once in a single tool call — write them individually to GitHub",
1182
1216
  ],
1183
1217
  },
1184
1218
  }),
@@ -1260,8 +1294,37 @@ const handlers = {
1260
1294
  ateam_build_and_run: async ({ solution, skills, connectors, mcp_store, github, test_message, test_skill_id }, sid) => {
1261
1295
  const phases = [];
1262
1296
 
1263
- // Phase 0: GitHub pull (if github:true pull connector source from repo)
1297
+ // Guard: reject large mcp_storeagent should use github_patch instead
1298
+ if (mcp_store) {
1299
+ const totalSize = Object.values(mcp_store).reduce((sum, files) => {
1300
+ return sum + (Array.isArray(files) ? files.reduce((s, f) => s + (f.content?.length || 0), 0) : 0);
1301
+ }, 0);
1302
+ if (totalSize > 200_000) {
1303
+ return {
1304
+ ok: false,
1305
+ phase: "pre_check",
1306
+ error: `mcp_store is too large (${Math.round(totalSize / 1024)}KB). Max ~200KB inline.`,
1307
+ message: "Connector code is too large to pass inline. Write files individually to GitHub, then deploy from there.",
1308
+ _fix: [
1309
+ "1. Write each file: ateam_github_patch(solution_id, path: 'connectors/<id>/server.js', content: '...')",
1310
+ "2. Repeat for package.json, UI assets, etc.",
1311
+ "3. Deploy: ateam_build_and_run(solution, skills) — will auto-pull from GitHub",
1312
+ ],
1313
+ };
1314
+ }
1315
+ }
1316
+
1317
+ // Phase 0: Auto-detect GitHub repo — if no mcp_store passed and repo exists, pull from GitHub automatically
1264
1318
  let effectiveMcpStore = mcp_store;
1319
+ if (!mcp_store) {
1320
+ try {
1321
+ const ghStatus = await get(`/deploy/solutions/${solution.id}/github/status`, sid);
1322
+ if (ghStatus?.repo_url) {
1323
+ // Repo exists — auto-pull from GitHub
1324
+ github = true;
1325
+ }
1326
+ } catch { /* no repo — first deploy, mcp_store expected */ }
1327
+ }
1265
1328
  if (github && !mcp_store) {
1266
1329
  try {
1267
1330
  const pullResult = await post(
@@ -1648,6 +1711,9 @@ const handlers = {
1648
1711
  ateam_github_patch: async ({ solution_id, path: filePath, content, search, replace, message }, sid) =>
1649
1712
  post(`/deploy/solutions/${solution_id}/github/patch`, { path: filePath, content, search, replace, message }, sid),
1650
1713
 
1714
+ ateam_github_write: async ({ solution_id, path: filePath, content, message }, sid) =>
1715
+ post(`/deploy/solutions/${solution_id}/github/patch`, { path: filePath, content, message }, sid),
1716
+
1651
1717
  ateam_github_log: async ({ solution_id, limit }, sid) => {
1652
1718
  const qs = limit ? `?limit=${limit}` : "";
1653
1719
  return get(`/deploy/solutions/${solution_id}/github/log${qs}`, sid);