Skip to content

fix(package): restore npx @modelcontextprotocol/inspector with an inspector bin alias - #2652

Merged
cliffhall merged 3 commits into
v2/mainfrom
v2/fix/2651-npx-default-bin
Oct 8, 2026
Merged

cliffhall merged 3 commits into
v2/mainfrom
v2/fix/2651-npx-default-bin

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2651

Problem

On 2.10.0, npx @modelcontextprotocol/inspector (the documented entry point) fails with npm error could not determine executable to run. 2.10.0 added mcpdo as a second bin. When a package has more than one distinct bin, npm's npx/npm exec (libnpmexec's getBinFromManifest) runs only the bin named after the unscoped package name, inspector. No bin had that name.

Changes

  • package.json: adds an inspector bin pointing at the launcher. mcp-inspector and mcpdo are unchanged, and mcpdo is still reachable with npx -p @modelcontextprotocol/inspector mcpdo.
  • scripts/lib/npx-default-bin.mjs + test: copies npm's bin-choice rule and asserts the root manifest's npx default bin is the launcher. It runs offline in test:scripts, which is part of validate:guards and therefore CI. Verified to fail on the 2.10.0 manifest.
  • pack:verify: new step 4a′ runs the installed tarball through npm exec --no -- @modelcontextprotocol/inspector --help. Every existing check calls node_modules/.bin/mcp-inspector by name, so none of them asks npm to pick a bin, and that is why 2.10.0 shipped green. I checked the step against a throwaway two-bin package. Without the alias it fails with the same error; with the alias it runs the launcher.
  • clients/launcher/README.md: documents why the alias exists.

Verification

  • npm run pack:verify: green, including the new step.
  • npm run local:gate: green through every stage up to smoke:web:firefox. That stage fails on this macOS 27 machine because Playwright's Firefox cannot launch here (smoke:web:firefox cannot launch Playwright's Firefox on macOS 27 #2625). I then ran smoke:web:firefox in the mcr.microsoft.com/playwright:v1.62.1-noble container from a clean git archive of this commit, and it was green. local:storybook, which the && chain skipped, was run separately: 529/529 passed.

Release follow-up

  • Cut 2.10.1 once this merges.
  • In the meantime, latest is being moved back to 2.9.0 and 2.10.0 deprecated with a workaround message.

🤖 Generated with Claude Code

…inspector` bin alias (#2651)

2.10.0 added `mcpdo` as a second bin. With more than one distinct bin,
npm's npx/exec runs only the bin named after the unscoped package name
(`inspector`), which didn't exist, so the documented entry point failed
with "could not determine executable to run".

Add `inspector` -> the launcher, and guard it twice: an offline
test:scripts check that the root manifest's npx default bin is the
launcher (mirrors libnpmexec's getBinFromManifest), and a pack:verify
step that runs the installed tarball via `npm exec` instead of by bin
name, which is why every existing check stayed green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall cliffhall added the v2 Issues and PRs for v2 label Oct 8, 2026
@cliffhall
cliffhall requested a balanced review from Copilot October 8, 2026 03:30

Copilot AI 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.

🟡 Changes recommended

package-lock.json remains inconsistent with the updated root bin metadata.

1 open finding
What changed in this PR

Restores the documented bare npx entry point by adding an inspector binary alias and regression checks.

Changes:

  • Adds the launcher alias.
  • Mirrors and tests npm’s default-bin selection.
  • Verifies the installed tarball through npm exec.
File Description
package.json Adds the inspector alias.
scripts/​lib/​npx-default-bin.mjs Implements npm’s bin-selection rule.
scripts/​lib/​npx-default-bin.test.mjs Tests selection behavior and root manifest.
scripts/​pack-and-verify.mjs Exercises default-bin resolution on the tarball.
clients/​launcher/​README.md Documents the alias requirement.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread package.json
…2651)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>
@cliffhall

Copy link
Copy Markdown
Member Author

Copilot round 1: 1 finding (lockfile root bin snapshot stale), fixed in 7759adb. Re-ran validate:guards (install-fresh, dep-lockstep, test:scripts): green. Requesting round 2.

Copilot AI 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.

🟢 Approval recommended

The alias, lockfile, offline guard, packaged-install verification, and documentation consistently address the regression.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>

Copilot AI 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.

🟢 Approval recommended

The alias, lockfile, documentation, and complementary regression checks correctly address the reported packaging failure.

0 open findings

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 3 (at c92978e, including the README mcpdo entry) was clean — 0 inline comments, nothing in the headline or a suppressed block. Round 2 was also clean but predated the README commit, hence round 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npx @modelcontextprotocol/inspector fails on 2.10.0: "could not determine executable to run"

2 participants