Repository navigation
Conversation
…esses The plugin launched the MCP server through npx, which kept 2-3 wrapper processes (cmd.exe/sh and an npm-exec node) alive per session and checked the registry at every start. plugin.json now runs scripts/plugin-mcp.cjs, which finds an installed clawdcursor of the exact pinned version (global install, node prefix, or npx cache) and loads its CLI in the same process. When none is on disk it runs `npx -y clawdcursor@<pin>` as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Claude Code plugin starts its MCP server through
scripts/plugin-mcp.cjsinstead ofnpx -y clawdcursor@<pin>. When the pinned version is already on disk, the launcher loads it in its own process, so there are no wrapper processes. Either a global install or an npx cache entry counts. Otherwise it runs npx exactly as before.Why
npx stays alive above the server for the whole session:
cmd.exe → npx node → cmd.exe → server.npm execnode above the server.Measured on one Windows PC with 11 open Claude sessions: 33 wrapper processes, 323 MB. The npx node alone grows to ~95 MB after use. On the Mac: one
npm execwrapper per session. npx also checks the registry at every session start.How
"command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/plugin-mcp.cjs", "clawdcursor@2.3.0", "mcp", "--compact"]. Theclawdcursor@X.Y.Zliteral is unchanged, sosync-versionstill bumps it;--checkpasses.clawdcursorlauncher on PATH (on macOS/Linux via realpath, which covers Homebrew), then%APPDATA%\npm\node_modules, then the two layouts next to the node binary, then<npm cache>/_npx/*/node_modules.bin.clawdcursor.process.argv = [execPath, cli, ...args], thenrequire(cli). The CLI reads its args by script path (userArgs), so it seesmcp --compact.npx -y clawdcursor@<pin> ...with inherited stdio, forwards SIGINT/SIGTERM, and passes through the exit code../).Tests
tests/plugin-mcp.test.ts: the resolver against temp layouts (npx cache, Windows global next to the PATH shim, next to node, wrong version or name, nothing found).tests/plugin-mcp.system.test.ts: spawns the launcher against a fake pinned package in a temp npx cache. It asserts the CLI ran in the SAME pid with argv['mcp','--compact'], and it fails if the launcher spawns a child.npm run test:ci: 4303 passed, 80 skipped, 0 failed.claude --plugin-dir <this branch> mcp list→plugin:clawdcursor:clawdcursor: node …/scripts/plugin-mcp.cjs clawdcursor@2.3.0 mcp --compact - ✔ Connected. That loaded the published 2.3.0 global install in-process, and Claude Code expands${CLAUDE_PLUGIN_ROOT}.initialize: run through the launcher against this branch's build, it answers with 6 tools.Check before release
The claude.ai account plugin is also run by the Claude app itself, outside Claude Code: chat on Windows and macOS. Confirm the server still starts there, i.e. that
${CLAUDE_PLUGIN_ROOT}is expanded. I haven't tested that host.The npx fallback on Windows uses
shell: true(Node 20+ refuses to spawn.cmdfiles without a shell). Arguments with spaces or cmd metacharacters are quoted, and the plugin's own args contain neither. That path isn't covered by a test.No release: for the 2.4 train.
🤖 Generated with Claude Code