Skip to content

installer: first-class ZCode target (MCP + skills) (#83) - #102

Merged
tzhouam merged 2 commits into
mainfrom
feat/installer-zcode-target
Aug 25, 2026
Merged

installer: first-class ZCode target (MCP + skills) (#83)#102
tzhouam merged 2 commits into
mainfrom
feat/installer-zcode-target

Conversation

@tzhouam

@tzhouam tzhouam commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

What

Adds zcode as a first-class installer target in scripts/install_mcp.py, mirroring the
existing Cursor path (config-file merge + skill copy, no CLI invocation), exactly as specced
in #83:

  • --agent zcode choice + auto-detection (zcode on PATH or ~/.zcode/ exists).
  • Non-destructive merge of mcp.servers.infermatrix-copilot (nested key) into
    ~/.zcode/cli/config.json, with a timestamped .bak. That file also holds hooks/plugin
    state: unrelated keys are preserved, and malformed JSON or a non-object mcp/mcp.servers
    refuses the merge with the original left untouched (and no .bak written for the
    malformed case).
  • Skills copied to user-scope ~/.zcode/skills/ (takes precedence over ~/.agents/skills),
    with the {{INFERMATRIX_COPILOT_ROOT}} placeholder expansion the other targets get.
  • Restart hint covers the /imreview / /imcifix / /imupdate slash form.

Contract note

The ZCode config location/key hierarchy (~/.zcode/cli/config.json under mcp.servers,
skills at ~/.zcode/skills/) follows the spec in #83 — there is no ZCode install on the dev
machine to verify against, so @hsliuustc0106 please confirm the contract on a real ZCode
setup before merge.

Tests

test/test_install_mcp_script.py (+6):

  • preserves unrelated config keys and existing servers, writes the .bak, installs skills
  • creates the config fresh when absent (no spurious .bak)
  • refuses malformed JSON: original byte-identical, no .bak, no skills copied
  • refuses non-object mcp.servers
  • detection by config dir with no CLI on PATH; no detection with neither

Full offline suite green.

Closes #83. Closes #99 (duplicate).

🤖 Generated with Claude Code

https://claude.ai/code/session_0165QsXAeLVPrKfj8Yk5zns3

tzhouam and others added 2 commits August 25, 2026 13:15
Mirror of the Cursor path, per the #83 spec: auto-detect (`zcode` on PATH
or ~/.zcode/ present) or explicit --agent zcode; non-destructive merge of
mcp.servers.infermatrix-copilot into ~/.zcode/cli/config.json with a
timestamped .bak (that file also holds hooks/plugin state, so unrelated
keys are preserved and malformed JSON refuses the merge leaving the
original untouched); skills copied to user-scope ~/.zcode/skills/; restart
hint covers the /imreview slash form.

Tests cover: unrelated-key preservation + .bak, fresh-config creation,
malformed-JSON refusal (no .bak, no skills), non-object mcp.servers
refusal, and detection by CLI or config dir.

Closes #83. Closes #99 (duplicate request).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165QsXAeLVPrKfj8Yk5zns3
@tzhouam
tzhouam merged commit 4992bfa into main Aug 25, 2026
2 checks passed
@tzhouam
tzhouam deleted the feat/installer-zcode-target branch August 25, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] MCP installation support for ZCode [Feature] Installer: first-class ZCode target (MCP + skills)

1 participant