Skip to content

Add missing runtime dependencies for strict package managers#1144

Open
herakles-dev wants to merge 1 commit intomodelcontextprotocol:mainfrom
herakles-dev:fix/phantom-dependencies
Open

Add missing runtime dependencies for strict package managers#1144
herakles-dev wants to merge 1 commit intomodelcontextprotocol:mainfrom
herakles-dev:fix/phantom-dependencies

Conversation

@herakles-dev
Copy link

Summary

Adds 5 missing runtime dependencies to the root package.json. These are imported directly by the bundled workspace files but only declared in sub-packages, which breaks pnpm and yarn PnP installs.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Changes Made

Added commander, cors, express, express-rate-limit, and serve-handler to root dependencies, matching the versions already in the workspace packages.

I traced the imports in the published build output and these 5 were missing from root. ws was not — it's only pulled in transitively via @modelcontextprotocol/sdk.

Related Issues

Fixes #873

Testing

  • Manual testing performed

Traced every import/require in the bundled entry points back to source to confirm which packages need root-level declarations.

Checklist

  • Code follows the style guidelines (ran npm run prettier-fix)
  • Self-review completed
  • Code is commented where necessary — N/A, package.json only
  • Documentation updated (README, comments, etc.) — N/A

Additional Context

FYI express-rate-limit and serve-handler have known CVEs at these versions (GHSA-46wh-pxpv-q5gq, minimatch ReDoS) — both pre-exist in the workspace packages, this just mirrors them. Happy to bump those separately.

When installed with strict package managers like pnpm, the published
package fails because bundled workspace files import packages not
declared in the root package.json. Add the 5 missing runtime
dependencies that are directly imported by files in the `files` array:

- commander (cli/src/cli.ts, cli/src/index.ts)
- cors (server/src/index.ts)
- express (server/src/index.ts)
- express-rate-limit (server/src/index.ts)
- serve-handler (client/bin/client.js)

Fixes modelcontextprotocol#873
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.

Phantom dependencies in @modelcontextprotocol/inspector

1 participant