fix(init): retain MCP server environment and client settings

Merged
RU
2mo ago
+49-4
  • Keep existing e2e MCP server environment variables and client settings when rerunning init.
  • Leave a current registration byte-for-byte unchanged. Repair a stale launch command as before while retaining extra settings.
  • Add native CLI and planner regressions, docs/setup guidance and a patch changeset.

Verified

Ran it locally: yes

Built all seven packages and invoked the actual built e2e init --yes on a standalone temporary project with an existing .mcp.json.

mainbranch
Existing env and timeout settings disappear from the e2e registrationSettings and the current file's exact bytes remain unchanged
All three new regressions failAll 21 focused planner/CLI tests pass

Other servers and top-level client settings stay intact. The existing stale-command repair control still passes, and the new stale-command test checks that extras survive that repair. No dependencies were installed by init --yes, and no external MCP server was invoked.

  • Full core unit suite: 172 files passed, 2452 tests passed, one skipped. Core typecheck and all seven package builds pass.
  • Full built-CLI testbed: 14 files, 71 tests passed, one skipped. The server port was temporarily changed to 4295 to avoid the other checkout, then restored.
  • Lint and docs build validation/broken links pass. Separate fresh-context source/caller/proof review found no important or critical findings.
  • pnpm check stops at the filtered installation's unused mobile Expo dependency finding, also observed on the same main installation. Full native mobile benchmark and root-wide typecheck require those excluded dependencies. No performance claim or runner/engine/model change.
  • Fork Actions currently require an upstream maintainer to authorize workflows; hosted CI is not claimed green.

AI assistance: implemented and independently reviewed with Codex, with local before/after verification.