Skip to content

feat(cli): migrate existing MCP registrations to npx on update - #100

Merged
abruption merged 7 commits into
mainfrom
feat/99-npx-launcher
Nov 24, 2026
Merged

abruption merged 7 commits into
mainfrom
feat/99-npx-launcher

Conversation

@abruption

@abruption abruption commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Issue

Closes #99

Problem and result

A Node upgrade can remove the Node binary and globally installed Rebut script used in an existing MCP registration. A successful rebut update now migrates supported Codex and Claude Code registrations to rebut-mcp@latest via npx, including when the installed CLI is already current. Both registration writers preserve existing host settings.

Codex uses a dedicated npm working directory. Claude Code uses npx's explicit --prefix and retains its working directory. Both modes disable npm install scripts. Registrations remain intact if the package update fails or their visible PATH lacks npx or selects a different Node installation. The updater also accepts npm 12's one-element latest-version response and avoids migrating to a tag older than the installed CLI.

Older versions use the first rebut update to install the migration-capable CLI. Run the same command again to migrate. Installation guides cover restart behavior, PATH and rollback in all four languages.

Validation

  • npm run typecheck, npm run build, npm test (307 passed), npm run test:package
  • Independent pre-push review with Claude Opus 5.5 and Gemini 4 Neon Medium
  • Installed the candidate globally in isolated prefixes. One plain rebut update migrated both existing entries on all four devices. Repeat execution preserved both files byte for byte.
  • A failed package update preserved both files. On macOS and Windows, a Codex entry with a PATH missing Node and npx kept its direct launcher, the same run still migrated Claude Code, and the update returned a nonzero status.

Device validation

Environment Codex App Server Claude Code CLI
macOS arm64 Connected Connected
Linux arm64 (KR) CLI unavailable Connected
Linux arm64 (US) CLI unavailable Direct MCP handshake with the same arguments
Windows x64 Connected Connected, including a prefix path with spaces, ampersand and percent characters

A direct stdio probe listed all three tools on all four devices. Host tests used isolated npm caches and settings; no production Worker or provider was called.

Windows runtime validation

The updater also checks the Node executable next to npm's npx.cmd. When that runtime differs from the verified Node, or another Windows launcher makes lookup ambiguous, it keeps the existing registration.

On a physical Windows host, the previous check accepted a mixed PATH. The corrected check rejected it and passed the normal adjacent-Node and PATH-fallback cases. The Windows smoke job now covers those cases, an invalid sibling, and competing Node and npx launchers.

@abruption abruption changed the title feat(cli): opt in to npx for existing Codex registrations feat(cli): migrate existing MCP registrations to npx on update Nov 24, 2026
@abruption
abruption marked this pull request as ready for review November 24, 2026 01:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T01:56:18.298178Z 35ed21a New commits
🔒 Security Review ✅ Completed 2026-11-24T02:03:58.903413Z 35ed21a New commits

Security findings

Advisory findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fd5517e5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/client/npx-launcher.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d26d6d712d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/client/claude.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 09358cb286

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/client/claude.ts Resolved
@abruption
abruption merged commit 394d951 into main Nov 24, 2026
8 checks passed
@abruption
abruption deleted the feat/99-npx-launcher branch November 24, 2026 02:04
@abruption abruption mentioned this pull request Nov 24, 2026
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.

Migrate existing Codex and Claude Code MCP registrations to npx on update

1 participant