Skip to content

feat: pin version on install + pin/unpin/upgrade commands - #9

Merged
jleni merged 4 commits into
mainfrom
feat/pinned-version-upgrade
Jun 22, 2026
Merged

feat: pin version on install + pin/unpin/upgrade commands#9
jleni merged 4 commits into
mainfrom
feat/pinned-version-upgrade

Conversation

@jleni

@jleni jleni commented Jun 22, 2026

Copy link
Copy Markdown
Member

What

  • Pin on install: register npx -y @kunobi/mcp@<exact-version> instead of the bare package, so client spawns run from the npm cache.
  • kunobi-mcp upgrade: a new subcommand that checks the registry and, if newer, re-pins every client config (via the installer's repin()), warms the npm cache, and tells you to restart to apply.
  • Update notice now points at kunobi-mcp upgrade.

Why

npx -y @kunobi/mcp resolves the latest dist-tag from the registry on every spawn. That round-trip is the slow / occasionally indefinite-hang part of startup — the same failure class as openai/codex#14470 (a codex exec leg sitting silent for ~20 min on MCP startup). Pinning removes the latest lookup → spawn is fast, deterministic, and can't hang on the registry. Upgrades move off the spawn critical path and become explicit (you're still informed by the existing post-connect notice; one command re-pins).

Flow

  1. install pins to the version it just fetched.
  2. Post-connect, checkForUpdate informs "vX available — run kunobi-mcp upgrade".
  3. upgrade re-pins all configs + warms cache → restart loads the new version (apply-on-next-start; an MCP server can't hot-swap its own running code, so we don't pretend to live-reconnect).

Tests

Full suite green (90 tests); typecheck + biome clean. upgrade glue is thin over the installer's repin() (unit-tested in that PR); not run in CI since it performs real registry + config writes.

⚠️ Depends on

kunobi-ninja/mcp-installer#2 (adds repin()). Merge + publish that first, then bump @kunobi/mcp-installer here so the import resolves.

jleni added 4 commits June 22, 2026 18:49
Client spawns currently run `npx -y @kunobi/mcp`, which resolves the `latest`
dist-tag from the registry on every launch — a round-trip that is the slow and
occasionally indefinite-hang part of startup (cf. openai/codex#14470, where a
codex exec leg sat silent for ~20min on MCP startup).

- install: pin to this exact version (`@kunobi/mcp@${version}`) so spawns run
  from the npm cache, fast and deterministic, with no `latest` lookup.
- upgrade: new subcommand — checkForUpdate, then repin() every client config to
  the newest version, best-effort warm the npm cache, and tell the user to
  restart to apply. Explicit, off the spawn critical path.
- The post-connect update notice now points at `kunobi-mcp upgrade` instead of a
  bare 'restart' hint.

Upgrades stay automatic-feeling (you're informed, one command re-pins) without
putting the registry on the startup path. Full suite green (90 tests).
Rounds out the pinning model so it helps existing installs, not just new ones:

- pin   — re-pin every registered config to the CURRENT version (offline,
          instant). For users who installed before pinning, or set up manually.
- unpin — revert to bare 'npx -y @kunobi/mcp' (always-latest). Symmetric escape
          hatch; re-introduces per-spawn 'latest' resolution by choice.
- Startup hint: when an unpinned config is detected (a bare '@kunobi/mcp' arg),
          suggest 'kunobi-mcp pin'. Suppressible via MCP_KUNOBI_NO_PIN_HINT=1.

pin/unpin/upgrade now share a repinAll() helper over the installer's repin().
README documents the commands, the pin/unpin tradeoff, and the new env var.
Full suite green (90 tests); typecheck + biome clean.
Pulls in repin() (published in mcp-installer v0.0.8), which pin/unpin/upgrade
depend on. Resolves from the registry now — no dev link. typecheck/build/tests
green against the published package.
@jleni jleni changed the title feat: pin version on install + explicit upgrade command feat: pin version on install + pin/unpin/upgrade commands Jun 22, 2026
@jleni jleni closed this Jun 22, 2026
@jleni jleni reopened this Jun 22, 2026
@jleni
jleni merged commit 6c3c107 into main Jun 22, 2026
4 of 6 checks passed
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.

1 participant