Repository navigation
fix(#1265): plugin MCP launcher starts through a symlinked path; upgrade test handles an unpublished pin - #1280
Merged
Merged
Conversation
…ymlink
plugin/.mcp.json now runs node ${CLAUDE_PLUGIN_ROOT}/mcp-launch.mjs (#1265). The launcher's direct-invocation guard compared process.argv[1] with fileURLToPath(import.meta.url) as strings; import.meta.url is always resolved, so a symlinked plugin path (a symlinked ~/.claude, macOS /var -> /private/var) skipped main(), exited 0 and Claude Code reported CONNECTION_CLOSED. Compare realpathSync of both. Inline copies regenerated.
Entire-Checkpoint: e5f3f352cc83
…en the MCP pin isn't on npm yet On a release PR the plugin pins the version about to be published, so npx -y sequant@<pin> can't start and the MCP connection check fails (seen on #1255). The check is about the launcher file and the connection, so point the cloned config at the latest published version in that case. Entire-Checkpoint: 4f6fc532f472
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.
Follow-up to #1265 (PR #1275). Found while getting release PR #1255 green.
Problem
#1265 switched
plugin/.mcp.jsontonode ${CLAUDE_PLUGIN_ROOT}/mcp-launch.mjs sequant@<version>. The launcher's direct-invocation guard comparedprocess.argv[1]withfileURLToPath(import.meta.url)as strings.import.meta.urlis always the resolved path, so when the plugin path goes through a symlink,main()is skipped: the launcher exits 0 having started nothing, and Claude Code reportsCONNECTION_CLOSED. Examples of symlinked paths: a symlinked~/.claude(dotfiles setups), or a config dir under macOS/var(→/private/var).node /var/folders/…/mcp-launch.mjsprints nothing and exits 0. The same file via itsrealpathreachesmain()./tmphas no symlink.node -eform strips this guard, so it never mattered before.A second, separate failure showed up on #1255: on a release PR the plugin pins the version about to be published, so
npx -y [email protected]can't start beforenpm publish, and the upgrade job's MCP check fails.Changes
scripts/mcp-launch.mjs: the guard comparesrealpathSyncof both paths (try/catch → false). The generator'sIMPORT_BLOCK/REQUIRE_BLOCK/MAIN_GUARD_BLOCKare updated to match. The inline copies (.mcp.json,templates/mcp.json,src/lib/mcp-launch-inline.generated.ts) andplugin/mcp-launch.mjsare regenerated withnpm run mcp-launch:inline.scripts/mcp-launch.integration.test.ts: a new case starts the launcher through a symlinked directory and expectsmain()to run ("missing package spec argument", exit 1). The test makes its own symlink, so it covers Linux CI too.plugin-install-test.ymlupgrade job: if the cloned config's MCP pin isn't on npm, it points the config at the latest publishedsequantfor the connection check.Verification
mcp-launch,.mcp.jsonorplugin/pass: 1,244 tests./var→/private/var, andplugin:sequant:sequant … mcp-launch.mjs [email protected] - ✔ Connected. Before the fix it was✘ Failed to connect — CONNECTION_CLOSED.Mutation-verified: AC-1 — restored the string compare
process.argv[1] === fileURLToPath(import.meta.url)in scripts/mcp-launch.mjs; scripts/mcp-launch.integration.test.ts > mcp-launch.mjs starts when invoked through a symlinked path > runs main() (rejects the missing spec) instead of exiting silently failed; restored.After merge
Merge main into #1255 (v2.19.0). Otherwise the release ships the symlink bug to every plugin user with a symlinked config dir.
🤖 Generated with Claude Code