@ateam-ai/mcp 0.3.3 → 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 +110 -47
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ateam-ai/mcp",
3
- "version": "0.3.3",
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,
@@ -872,14 +902,14 @@ export const tools = [
872
902
  },
873
903
 
874
904
  // ═══════════════════════════════════════════════════════════════════
875
- // RELEASE MANAGEMENT — promote, rollback, version listing
905
+ // RELEASE MANAGEMENT — checkpoint, rollback, version listing
876
906
  // ═══════════════════════════════════════════════════════════════════
877
907
 
878
908
  {
879
909
  name: "ateam_github_promote",
880
910
  core: true,
881
911
  description:
882
- "Promote a dev version to main (production). By default promotes the latest dev tag. Optionally specify a specific dev tag to promote. Creates a prod-YYYY-MM-DD-NNN tag on main.",
912
+ "Create a checkpoint (safe point) on the current main branch. Tags the current state with safe-YYYY-MM-DD-NNN so you can rollback to it later. Use this before risky changes or when the solution is in a known-good state.",
883
913
  inputSchema: {
884
914
  type: "object",
885
915
  properties: {
@@ -887,9 +917,9 @@ export const tools = [
887
917
  type: "string",
888
918
  description: "The solution ID",
889
919
  },
890
- tag: {
920
+ label: {
891
921
  type: "string",
892
- description: "Optional: specific dev tag to promote (e.g., 'dev-2026-03-11-005'). If omitted, promotes the latest dev tag.",
922
+ description: "Optional: human-readable label for this checkpoint (e.g., 'before refactor', 'v2 stable')",
893
923
  },
894
924
  },
895
925
  required: ["solution_id"],
@@ -899,7 +929,7 @@ export const tools = [
899
929
  name: "ateam_github_rollback",
900
930
  core: true,
901
931
  description:
902
- "Rollback main (production) to a previous production tag. Resets main branch to the specified prod tag commit. ⚠️ DESTRUCTIVE — use with caution. Use ateam_github_list_versions to find available production tags first.",
932
+ "Rollback main branch to a previous checkpoint (safe-* tag). Resets main to the specified checkpoint commit. ⚠️ DESTRUCTIVE — use with caution. Use ateam_github_list_versions to find available checkpoints first.",
903
933
  inputSchema: {
904
934
  type: "object",
905
935
  properties: {
@@ -909,7 +939,7 @@ export const tools = [
909
939
  },
910
940
  tag: {
911
941
  type: "string",
912
- description: "Required: production tag to rollback to (e.g., 'prod-2026-03-10-001')",
942
+ description: "Required: checkpoint tag to rollback to (e.g., 'safe-2026-03-11-001')",
913
943
  },
914
944
  },
915
945
  required: ["solution_id", "tag"],
@@ -919,7 +949,7 @@ export const tools = [
919
949
  name: "ateam_github_list_versions",
920
950
  core: true,
921
951
  description:
922
- "List all available dev version tags for a solution. Shows tag name, date, counter, and commit SHA. Use before promoting to see what's available.",
952
+ "List all available checkpoints (safe-* tags) for a solution. Shows tag name, date, counter, and commit SHA. Use before rollback to see available safe points.",
923
953
  inputSchema: {
924
954
  type: "object",
925
955
  properties: {
@@ -1083,19 +1113,18 @@ const handlers = {
1083
1113
  steps: [
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
- { step: 3, action: "Version", description: "Every deploy auto-pushes to the 'dev' branch 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 dev), then redeploy with ateam_build_and_run(github:true). For skill definition changes, use ateam_patch (also pushes to dev).", tools: ["ateam_github_patch", "ateam_build_and_run", "ateam_patch"] },
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"] },
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
- { step: 6, action: "Promote", description: "When stable, promote the dev branch to main (production). This creates a production tag and merges dev → main.", tools: ["ateam_github_promote"] },
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
  ],
1091
1121
  },
1092
1122
  branching: {
1093
- _important: "ALL changes go to the 'dev' branch. The 'main' branch is production only updated via explicit promote.",
1094
- dev: "Staging branch. Every build_and_run, patch, and github_patch commits here automatically.",
1095
- main: "Production branch. Updated ONLY via ateam_github_promote(). First deploy also pushes to main as baseline.",
1096
- workflow: "Build iterate on dev test promote to main when stable.",
1097
- promote: "ateam_github_promote(solution_id) merges latest dev tag to main, creates prod tag.",
1098
- rollback: "ateam_github_rollback(solution_id) — reverts main to previous production tag.",
1123
+ _important: "Single-branch model: ALL changes go directly to 'main'. Use checkpoints (safe-* tags) as safe rollback points.",
1124
+ main: "The only branch. All deploys, patches, and github_patches commit here automatically. This IS the live running system.",
1125
+ checkpoints: "ateam_github_promote(solution_id) creates a safe-YYYY-MM-DD-NNN tag on current main HEAD. Use before risky changes.",
1126
+ rollback: "ateam_github_rollback(solution_id, tag) reverts main to a previous checkpoint tag.",
1127
+ workflow: "Build iterate on main test checkpoint when stable → continue iterating.",
1099
1128
  },
1100
1129
  first_questions: [
1101
1130
  { id: "goal", question: "What do you want your Team to accomplish?", type: "text" },
@@ -1104,31 +1133,31 @@ const handlers = {
1104
1133
  { id: "security", question: "What environment constraints?", type: "enum", options: ["sandbox", "controlled", "regulated"] },
1105
1134
  ],
1106
1135
  github_tools: {
1107
- _note: "Version control for solutions. ALL operations target the 'dev' branch. Promote to 'main' (production) explicitly.",
1108
- tools: ["ateam_github_push", "ateam_github_pull", "ateam_github_status", "ateam_github_read", "ateam_github_patch", "ateam_github_log", "ateam_github_promote", "ateam_github_rollback"],
1136
+ _note: "Version control for solutions. Single-branch model everything on 'main'. Use checkpoints as safe rollback points.",
1137
+ tools: ["ateam_github_push", "ateam_github_pull", "ateam_github_status", "ateam_github_read", "ateam_github_patch", "ateam_github_log", "ateam_github_promote", "ateam_github_rollback", "ateam_github_list_versions"],
1109
1138
  repo_structure: {
1110
1139
  "solution.json": "Full solution definition",
1111
1140
  "skills/{skill-id}/skill.json": "Individual skill definitions",
1112
1141
  "connectors/{connector-id}/server.js": "Connector MCP server code",
1113
1142
  "connectors/{connector-id}/package.json": "Connector dependencies",
1114
1143
  },
1115
- branches: {
1116
- dev: "All changes land here (auto-push on build/patch). This is the working branch.",
1117
- main: "Production snapshot. Only updated via ateam_github_promote(). Safe rollback target.",
1118
- },
1144
+ branch: "main — the only branch. All changes land here directly.",
1145
+ checkpoints: "safe-YYYY-MM-DD-NNN tags mark safe rollback points. Create with ateam_github_promote().",
1119
1146
  iteration_workflow: {
1120
- code_changes: "ateam_github_patch (commits to dev) → ateam_build_and_run(github:true) (pulls from dev, redeploys)",
1121
- definition_changes: "ateam_patch (updates + redeploys + auto-pushes to dev)",
1122
- first_deploy: "Must include mcp_store — this creates the GitHub repo with both dev and main branches",
1123
- promote: "ateam_github_promote(solution_id) when solution is stable, merge dev main",
1147
+ code_changes: "ateam_github_patch (one file at a time, commits to main) → ateam_build_and_run() (auto-pulls from GitHub, redeploys)",
1148
+ definition_changes: "ateam_patch (updates + redeploys + auto-pushes to main)",
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.",
1151
+ checkpoint: "ateam_github_promote(solution_id) — tag current state as a safe rollback point",
1124
1152
  },
1125
1153
  when_to_use_what: {
1126
- ateam_github_patch: "Edit connector source code on dev branch (server.js, utils, package.json, UI assets)",
1127
- ateam_patch: "Edit skill definitions (intents, tools, policy) auto-pushes to dev",
1128
- "ateam_build_and_run(github:true)": "Redeploy solution pulling latest connector code from dev branch",
1129
- "ateam_build_and_run(mcp_store)": "First deploy or when you want to pass connector code inline",
1130
- ateam_github_promote: "Promote dev main when stable (creates production tag)",
1131
- ateam_github_rollback: "Revert main to previous production tag",
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)",
1156
+ ateam_patch: "Edit skill definitions (intents, tools, policy) auto-pushes to main",
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.",
1159
+ ateam_github_promote: "Create a checkpoint (safe-* tag) — use before risky changes",
1160
+ ateam_github_rollback: "Revert main to a previous checkpoint",
1132
1161
  },
1133
1162
  },
1134
1163
  advanced_tools: {
@@ -1173,15 +1202,17 @@ const handlers = {
1173
1202
  "Use ateam_github_patch + ateam_build_and_run(github:true) for connector code changes after first deploy",
1174
1203
  "Study the connector example (ateam_get_examples type='connector') before writing connector code",
1175
1204
  "Ask discovery questions if goal unclear",
1176
- "ALL changes go to the dev branch remind user to ateam_github_promote() when ready for production",
1177
- "After every build/patch, tell the user: 'Deployed to Core ✅ | Pushed to dev branch | Promote to main: ateam_github_promote()'",
1205
+ "ALL changes go directly to mainsuggest ateam_github_promote() to create a checkpoint before risky changes",
1206
+ "After every build/patch, tell the user: 'Deployed to Core ✅ | Pushed to main | Create checkpoint: ateam_github_promote(solution_id)'",
1178
1207
  ],
1179
1208
  never: [
1180
1209
  "Call validate + deploy + health separately when ateam_build_and_run does it in one step",
1181
1210
  "Call update + redeploy separately when ateam_patch does it in one step",
1182
1211
  "Dump raw spec unless requested",
1183
1212
  "Write connector code that starts a web server — connectors MUST use stdio transport",
1184
- "Assume changes are on main they are always on dev until explicitly promoted",
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",
1185
1216
  ],
1186
1217
  },
1187
1218
  }),
@@ -1263,8 +1294,37 @@ const handlers = {
1263
1294
  ateam_build_and_run: async ({ solution, skills, connectors, mcp_store, github, test_message, test_skill_id }, sid) => {
1264
1295
  const phases = [];
1265
1296
 
1266
- // 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
1267
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
+ }
1268
1328
  if (github && !mcp_store) {
1269
1329
  try {
1270
1330
  const pullResult = await post(
@@ -1405,7 +1465,7 @@ const handlers = {
1405
1465
  return {
1406
1466
  ok: true,
1407
1467
  solution_id: solution.id,
1408
- branch: 'dev',
1468
+ branch: 'main',
1409
1469
  phases,
1410
1470
  deploy: {
1411
1471
  skills_deployed: deploy.import?.skills || [],
@@ -1417,8 +1477,8 @@ const handlers = {
1417
1477
  ...(test_result && { test_result }),
1418
1478
  ...(github_result && !github_result.error && !github_result.skipped && { github: github_result }),
1419
1479
  ...(validation.warnings?.length > 0 && { validation_warnings: validation.warnings }),
1420
- _status: '✅ Deployed to Core + pushed to dev branch.',
1421
- _next: 'To promote to production (main branch): ateam_github_promote(solution_id)',
1480
+ _status: '✅ Deployed to Core + pushed to main.',
1481
+ _next: 'Create a checkpoint before making more changes: ateam_github_promote(solution_id)',
1422
1482
  };
1423
1483
  },
1424
1484
 
@@ -1485,7 +1545,7 @@ const handlers = {
1485
1545
  }
1486
1546
  }
1487
1547
 
1488
- // Phase 4: Auto-push to dev branch (non-blocking)
1548
+ // Phase 4: Auto-push to main branch (non-blocking)
1489
1549
  let github_result;
1490
1550
  try {
1491
1551
  github_result = await post(
@@ -1503,14 +1563,14 @@ const handlers = {
1503
1563
  return {
1504
1564
  ok: true,
1505
1565
  solution_id,
1506
- branch: 'dev',
1566
+ branch: 'main',
1507
1567
  phases,
1508
1568
  patch: patchResult,
1509
1569
  redeploy: redeployResult,
1510
1570
  ...(test_result && { test_result }),
1511
1571
  ...(github_result && !github_result.error && !github_result.skipped && { github: github_result }),
1512
- _status: '✅ Patched + redeployed + pushed to dev branch.',
1513
- _next: 'To promote to production (main branch): ateam_github_promote(solution_id)',
1572
+ _status: '✅ Patched + redeployed + pushed to main.',
1573
+ _next: 'Create a checkpoint before making more changes: ateam_github_promote(solution_id)',
1514
1574
  };
1515
1575
  },
1516
1576
 
@@ -1651,13 +1711,16 @@ const handlers = {
1651
1711
  ateam_github_patch: async ({ solution_id, path: filePath, content, search, replace, message }, sid) =>
1652
1712
  post(`/deploy/solutions/${solution_id}/github/patch`, { path: filePath, content, search, replace, message }, sid),
1653
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
+
1654
1717
  ateam_github_log: async ({ solution_id, limit }, sid) => {
1655
1718
  const qs = limit ? `?limit=${limit}` : "";
1656
1719
  return get(`/deploy/solutions/${solution_id}/github/log${qs}`, sid);
1657
1720
  },
1658
1721
 
1659
- ateam_github_promote: async ({ solution_id, tag }, sid) =>
1660
- post(`/deploy/solutions/${solution_id}/promote`, tag ? { tag } : {}, sid),
1722
+ ateam_github_promote: async ({ solution_id, label }, sid) =>
1723
+ post(`/deploy/solutions/${solution_id}/promote`, label ? { label } : {}, sid),
1661
1724
 
1662
1725
  ateam_github_rollback: async ({ solution_id, tag }, sid) =>
1663
1726
  post(`/deploy/solutions/${solution_id}/rollback`, { tag }, sid),