diff --git a/bin/ccam.js b/bin/ccam.js index 0d68c01..c368976 100755 --- a/bin/ccam.js +++ b/bin/ccam.js @@ -2174,6 +2174,24 @@ async function cmdLanesAgentsInstall(args) { console.log(`${c.green("✔")} installed: ${result.installed.join(", ")}`); } +/** `ccam lanes mcp sync [] [--cwd path]` — relocate the source repo's + * already-configured MCP servers into /.mcp.json and seed Chromium + * profiles. Never run automatically; a session calls it explicitly. */ +async function cmdLanesMcpSync(args) { + const resolved = await resolveLaneArg(args); + if (!resolved) return; + const result = await post(`/api/lanes/${resolved.laneId}/mcp/sync`, {}, { allowError: true }); + if (result.status) { + console.error(`✖ mcp sync → ${result.data?.error?.message || result.status}`); + process.exitCode = 1; + return; + } + console.log(`${c.green("✔")} synced: ${result.servers.join(", ")}`); + if (result.profilesSeeded.length) { + console.log(` seeded profiles: ${result.profilesSeeded.join(", ")}`); + } +} + async function cmdFeatureShow(args) { const slug = args.find((arg) => !arg.startsWith("--")); if (!slug) { @@ -2365,6 +2383,11 @@ const COMMAND_GROUPS = [ "[]", "Write the ship-feature-lane agent templates (qc-local, senior-gate-reviewer) into /.claude/agents/, git-excluded", ], + [ + "lanes mcp sync", + "[]", + "Relocate the source repo's MCP servers into /.mcp.json and seed Chromium profiles", + ], [ "lock status|acquire|release", "[] [--holder X] [--timeout N]", @@ -3186,6 +3209,9 @@ async function runCommand(argv) { if (rest[0] === "agents" && rest[1] === "install") { return cmdLanesAgentsInstall(rest.slice(2)); } + if (rest[0] === "mcp" && rest[1] === "sync") { + return cmdLanesMcpSync(rest.slice(2)); + } return cmdLanes(); case "lock": { const sub = rest[0];