Repository navigation
Description
Inspector Version
- 0.17.1
Describe the bug
When using a stricter package installer, such as pnpm, all dependencies that are directly imported by a package must be in their package.json. Packages which are not listed, but are imported are called "phantom dependencies". These work with npm because it hoists everything to the top level of node_modules, but with strict package managers like pnpm, we only get symlinks for things that are actually declared.
There's probably a couple of these, but right off the bat, I get an error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'commander' imported from node_modules/.pnpm/@modelcontextprotocol+inspector@0.17.1_@types+node@24.7.2_typescript@5.9.3/node_modules/@modelcontextprotocol/inspector/cli/build/cli.js
Fix:
Option 1)
Add commander (and all dependencies used by repo) to top-level package.json
"commander": "^13.1.0"
Option 2)
Alternately, consider publishing @modelcontextprotocol/mcp-inspector from a different package, that takes dependencies on cli, server, etc. Rather than publishing copies of their code in this package (and also taking dependencies on them).
Option 3)
I think the actual root of the issue is the bin:
"bin": {
"mcp-inspector": "cli/build/cli.js"
},
This reaches into the cli folder, when it probably should instead utilize the bin that gets installed as part of the cli. e.g. something like:
"bin": {
"mcp-inspector": "node_modules/bin/mcp-inspector-cli"
},
To Reproduce
Steps to reproduce the behavior:
pnpm install @modelcontextprotocol/mcp-inspectormcp-inspector
Expected behavior
mcp-inspector should resolve all dependencies.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
Additional context
Add any other context about the problem here.
Activity
herakles-dev commentedon Mar 13, 2026
I'd like to take this. The root
package.jsonis missing 5 runtime dependencies that are directly imported by bundled workspace files (cli/build,server/build,client/bin):commander,cors,express,express-rate-limit, andserve-handler. Will have a PR up shortly.Add missing runtime dependencies for strict package managers
shane-js commentedon May 28, 2026
Hi team - just wanted to add this also causes issues in hoisted monorepos with other older
commanderdependencies that are incompatible.antony commentedon Jun 3, 2026
This breaks if you upgrade from pnpm@10 to pnpm@11 as I believe that things have been made stricter..
HunterLarco commentedon Jul 13, 2026
+1 I'd like to make the case that this should be prioritized higher than P2 as it fundamentally breaks the inspector for all pnpm projects which as of 2024 accounted for 35% of usage (see survey). Is there a timeline for V1 release or to include a fix for this as a patch in V0?
betsy commentedon Jul 13, 2026
+1 would be great if this can be looked at soon
fix: declare bundled runtime dependencies for strict package managers
cliffhall commentedon Aug 1, 2026
Closing: v1 is deprecated.
Thank you for reporting this, and apologies for the long wait for a response.
v1 will receive security fixes only — this issue describes a functionality, compatibility, or usability problem rather than a vulnerability, so it is being closed against v1. This is not a judgment on whether the problem is real — it's a consequence of the v1 line being frozen. This is happening as part of #1872.
If this still happens in v2, we'd genuinely like to know. v2 is a complete rewrite — three clients over a shared core — so many v1 behaviours no longer exist in the same form. Please open a fresh issue against v2 with steps to reproduce, and we'll look at it. Note that we accept external contributions as issues rather than pull requests; maintainers handle design and implementation through a prompt-driven workflow. See
CONTRIBUTING.md.Thanks for taking the time to report it.