fix: declare bundled runtime dependencies for strict package managers#1144
Open
herakles-dev wants to merge 1 commit into
Open
fix: declare bundled runtime dependencies for strict package managers#1144herakles-dev wants to merge 1 commit into
herakles-dev wants to merge 1 commit into
Conversation
The root package bundles cli/server/client build output via `files` and runs it through the mcp-inspector bin, but does not declare the runtime deps those bundled files import (commander, cors, express, express-rate-limit, serve-handler). They only resolve under default pnpm hoisting; strict resolvers (pnpm hoist=false, Yarn PnP) fail with ERR_MODULE_NOT_FOUND. Fixes modelcontextprotocol#873.
herakles-dev
force-pushed
the
fix/phantom-dependencies
branch
from
July 18, 2026 06:56
f6434fd to
1681a0d
Compare
Author
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.
Summary
Adds the five runtime dependencies the root package's bundled code imports but doesn't
declare, so the Inspector installs and runs under strict package managers (pnpm
hoist=false,Yarn PnP). Rebased on v1.0.0.
Type of Change
Changes Made
The root package ships the built
cli/server/clientoutput via thefilesfield and runsit through the
mcp-inspectorbin. Those bundled files importcommander,cors,express,express-rate-limit, andserve-handler, but rootpackage.jsondoesn't declare them — theyonly resolve because pnpm hoists by default. Under
hoist=falseor Yarn PnP the bin fails withERR_MODULE_NOT_FOUND(#873, also hit viapnpm dlxin #1513).This adds those five to root
dependenciesat the ranges the workspace packages already use.wsandajv/ajv-formatsare left out on purpose —wsis only reached through the SDK, andajv/ajv-formatsare bundled into the client's Vite build, not resolved at runtime. Thelockfile change is mechanical: the five edges plus commander re-homing to 13.x at the root (the
clipackage already pinned^13.1.0;lint-stagedkeeps its own 14.x nested copy).Related Issues
Fixes #873. Related: #1513.
Testing
Test Results and/or Instructions
Packed the root package and installed the tarball into a fresh project with
.npmrcset tohoist=false(strict resolution):node node_modules/@modelcontextprotocol/inspector/cli/build/cli.js --help→
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'commander'"Proxy server listening".
npm civalidates against the regenerated lockfile.Checklist
npm run prettier-fix)Breaking Changes
None.
Additional Context