MCP Version & Skill Installation Tools
Feature Overview [edit]
Two operational MCP tools, check_version and install_skills, let agents detect stale installs and install the packaged runtime skills into a consumer tree. Both have 1:1 CLI parity (memo check-version, memo install-skills). They were added by amending the frozen tool surface; the current surface is 11 tools.
Journeys:
- Detect a stale global install or long-lived daemon: MCP
check_version/memo check-version --json. - Install the runtime skill after cloning a consumer repo:
memo install-skills --product-root /path/to/consumer --scope local --host cursor --conflictPolicy update --yes.
Business Rules & Logic [edit]
check_version:
- Input: none.
- Output (
CheckVersionResult):current(running package version frompackage.json),latest(semver string ornull),updateAvailable(true|false|"unknown"), andsource("npm"|"offline"). - Latest source is the npm registry
https://registry.npmjs.org/spec-memo/latestwith a 3000 ms timeout (AbortController). - Offline soft-fail: if the registry is unreachable, times out, returns non-OK, or omits
version, the call still succeeds withlatest: null,updateAvailable: "unknown",source: "offline". It never throws a hard tool error solely for network failure. - Comparison uses semver core only (major/minor/patch); a leading
v, prerelease, and build metadata are ignored.updateAvailableistrueifflatestis strictly newer thancurrent; equal versions yieldfalse.
install_skills:
- Write permission gate: the tool fails closed unless
confirm: trueand explicitscope,hosts, andconflictPolicyare supplied. The error code isINSTALL_SKILLS_PERMISSION_REQUIREDand names the missing fields; no files are written.hosts: ["all"]is allowed only withconfirm: true. - Defaults:
skills: ["ws-memo", "ws-session-tracking"]; localskillsRoot: ".agents/skills". - Allowed skill ids are
ws-memoandws-session-tracking; an unknown id throws (Unknown skill id). The packaged tree is read from<packageRoot>/.agents/skills/<skill>and must containSKILL.md. scope: localcopies into{productRoot}/{skillsRoot}/<skill>; when hosts are selected it also copies into each selected host's skill root (Cursor.cursor/skills, Antigravity.gemini/config/skills, Codex.codex/skills, OpenCode.opencode/skills, Claude.claude/skills).productRootorcwdis required.scope: globalselects only explicit hosts; the legacyglobal: truepath (no host list) writes$HOME/.agents/skillsand includes$HOME/.gemini/config/skillsonly when the Gemini config tree exists. With an explicit host list alone, Antigravity is not inferred.- Conflict policy:
skipleaves a differing destination and reportsskipped;updateoverwrites identical/missing and packaged (stampedmanagedBy: spec-memo) trees and refuses foreign trees withrefused;forceoverwrites with tree replacement. Without any policy, a differing destination throws unlessforce: true. - Safety: the destination must stay inside the product root and must never overlap the vault (dest equal to, inside, or a parent of the vault is denied).
.gitdestinations are rejected.skillsRootmust be a relative path with no..segments. - Idempotency: an identical destination tree reports
unchanged;dryRunreportspreviewwithout writing. - Result (
InstallSkillsResult):mode(local|global),productRoot,skillsRoot,installedrows (skill,destination,identical,bytesWritten,status,target),status(applied|preview),scope,hosts,conflictPolicy,preflight, and globalskippedTargets. dryRunis available programmatically; MCP callers that omitconfirmcannot write.
Package integrity: the packaged ws-memo/ws-session-tracking skill versions must match package.json; a test asserts this. Installing must never write vault records into the product tree — only the skill directory under {skillsRoot}.
CLI examples:
memo check-version --json
memo install-skills --product-root /path/to/consumer \
--scope local --host cursor --conflictPolicy update --yes
memo install-skills --scope global --host cursor,antigravity --conflictPolicy force --yes
memo install-skills --scope local --host codex --dry-run --json
Notes and boundaries: promote with format: skill exports ranked traps into an owner SKILL.md and is a separate path from installing the packaged ws-memo skill. Future packaged skills may be added to the allow-list without a new MCP tool; v1 allows only ws-memo and ws-session-tracking. There is no auto-upgrade/self-update: check_version only reports; installing the updated binary stays operator-driven (npm i -g spec-memo). Consumer specMemo.enabled setup remains the workflow-skills ws-spec-memo bridge, not this tool.
Technical Architecture [edit]
src/version.ts:getPackageRoot,getPackageVersion,isSemverNewer,fetchNpmLatest,checkVersion.CheckVersionOptions.fetchLatestandtimeoutMsare test hooks.src/tools.ts:check_version(no inputs) andinstall_skillsdefinitions with requiredscope,hosts,conflictPolicy,confirm.executeToolvalidates with Zod, then callscheckVersionorinstallSkillsafternormalizeInstallHosts.src/skills-install.ts:ALLOWED_SKILLS,packagedSkillDir,listRelativeFiles,treesIdentical,copyTree,removeTree,isPackagedSkillTree,assertDestDoesNotOverlapVault,resolveGlobalSkillTargets,resolveSkillInstallTargets,installSkills.src/install-wizard.ts:normalizeInstallHosts(accepts aliases, rejectsallwithout permission),getInstallPreflight,resolveMemoCommand.- CLI:
memo check-versionmaps tocheck_version;memo install-skillsmaps toinstall_skillsand adds wizard,--scope,--host,--skills,--skills-root,--conflictPolicy/--force/--skip-existing/--update,--yes/--confirm, and--dry-run. JSON without confirmation is preview-only. - Provenance:
0024-mcp-version-and-skill-install.spec.md; host/permission details evolved in0048-install-hooks-skills-interactive.spec.md.