Skip to content

plugin: pin the npx version to the release; ship a usage skill - #10

Merged
ekechinwokah merged 4 commits into
mainfrom
plugin-pin-mcp-version
Aug 5, 2026
Merged

plugin: pin the npx version to the release; ship a usage skill#10
ekechinwokah merged 4 commits into
mainfrom
plugin-pin-mcp-version

Conversation

@ekechinwokah

Copy link
Copy Markdown
Contributor

Problem

The Claude Code plugin launches the MCP server with an unpinned spec:

"args": ["-y", "@infino-ai/code-context", "mcp"]

npx prefers an already-installed copy over the registry, so any machine
with a stale global install silently runs that old server regardless of
what the plugin ships. Observed in practice: a box with a global 0.1.0
kept returning the strict "no index yet — call the reindex tool once"
error even though 0.1.4 (auto-index on first query, src/mcp/ensure.ts)
had been out for days. The first-use experience the release shipped never
reached the user, with no visible signal that anything was stale.

Change

  • Pin the exact published version in .mcp.json
    (@infino-ai/code-context@0.1.4) so the plugin release decides what
    runs. An exact pin also resolves from the npx cache, unlike @latest
    which re-checks the registry on every server start.
  • Add test/plugin.test.ts: keeps package.json, the plugin manifest
    (.claude-plugin/plugin.json), and the .mcp.json pin in lockstep, so
    a release can't forget to move the pin.
  • Update the release steps in CONTRIBUTING.md to name all three files.

Left as-is deliberately: the unpinned npx command in the README /
context7 install docs — manual claude mcp add users manage their own
version; the plugin is the surface we version.

Also: ship a skill with the plugin

Until c712051 (0.1.1), cx install wrote a usage skill into the user's
.claude/skills/; dropping the installer in favor of the plugin also
dropped that guidance — the plugin registers only the MCP server. This
restores it, updated for 0.1.4 behavior.

Claude Code sessions increasingly defer MCP tool schemas and load them on
demand. The server's instructions only reach the model once its tools are
loaded, and they don't teach tool choice. New
skills/code-context/SKILL.md (auto-discovered — no manifest registration
needed) covers: loading the tools when deferred, search-vs-sql-vs-grep
choice, index SQL against the search table functions, the zero-touch index
lifecycle (auto-index on first query, auto-sync, per-root worktree
indexes), multi-repo path targeting, and cost awareness around
first-index/backfill.

Testing

npm run build clean; npm test 92/92 passing (12 files), including the
two new lockstep guards.

Ekechi Nwokah added 3 commits August 5, 2026 10:31
The plugin launched the MCP server with an unpinned spec
(npx -y @infino-ai/code-context mcp). npx prefers an already-installed
copy over the registry, so any machine with a stale global install
silently ran the old server - plugin users never received auto-index
on first query or anything shipped since their global was installed.

Pin the exact published version so the plugin release decides what
runs. A new test keeps package.json, the plugin manifest, and the
.mcp.json pin in lockstep, and the release steps in CONTRIBUTING.md
now name all three files.

The unpinned npx command in README/context7 install docs is left
as-is: manual 'claude mcp add' users manage their own version.
Claude Code sessions increasingly defer MCP tool schemas and load them
on demand (ToolSearch). The server's instructions cover the tools once
loaded, but nothing teaches the model when to reach for code-context
over grep, how to write index SQL against the search table functions,
or that a first query auto-builds the index - and nothing at all loads
when the tools are still deferred.

Ship skills/code-context/SKILL.md with the plugin (auto-discovered, no
manifest registration). The description is written for model-triggered
invocation on repo-spanning questions; the body covers tool choice,
search/sql usage with the canonical rank-and-aggregate query, the
zero-touch index lifecycle (auto-index on first query, auto-sync,
per-root indexes for git worktrees), multi-repo targeting, and cost
awareness around first-index/backfill work.
Until c712051 (0.1.1) the npm package's cx install wrote a usage skill
into the user's .claude/skills/; dropping the installer in favor of the
plugin also dropped that guidance. The skill added on this branch
independently re-covered most of it - fold in what it had that this one
lacked: answer from returned chunk content before opening files, and
put identifiers plus intent into one search rather than several narrow
ones.
Audited the skill against the server's actual tool registrations and
closed the gaps: the partial-index marker (missing match != absent
code), the usage receipt contract (surface the line verbatim), path is
an absolute repo root, and k's max of 50.
@ekechinwokah
ekechinwokah merged commit add9fe4 into main Aug 5, 2026
5 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.

2 participants