Describe the bug
Running the @modelcontextprotocol/inspector in CLI mode causes a crash due to an ambiguous --env argument, even though --env is not explicitly passed.
To Reproduce
Steps to reproduce the behavior:
- Run the following command:
npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list
Expected behavior
The inspector should run successfully and list the tools, without requiring or referencing the --env argument unless explicitly provided.
Logs
> npx @modelcontextprotocol/inspector --cli node build/index.js --method tools/list
Starting MCP inspector...
node:internal/util/parse_args/parse_args:87
throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(errorMessage);
^
TypeError [ERR_PARSE_ARGS_INVALID_OPTION_VALUE]: Option '--env' argument is ambiguous.
Did you forget to specify the option argument for '--env'?
To specify an option argument starting with a dash use '--env=-XYZ'.
at checkOptionLikeValue (node:internal/util/parse_args/parse_args:87:11)
at node:internal/util/parse_args/parse_args:382:9
at Array.forEach (<anonymous>)
at parseArgs (node:internal/util/parse_args/parse_args:378:3)
at file:///workspace/node_modules/@modelcontextprotocol/inspector/server/build/index.js:16:20 {
code: 'ERR_PARSE_ARGS_INVALID_OPTION_VALUE'
}
Node.js v22.14.0
Additional context
- No
--env option was manually specified in the CLI.
- Environment: Node.js v22.14.0
- This may be related to internal
parseArgs() behavior incorrectly detecting an argument that wasn't passed.
Describe the bug
Running the
@modelcontextprotocol/inspectorin CLI mode causes a crash due to an ambiguous--envargument, even though--envis not explicitly passed.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The inspector should run successfully and list the tools, without requiring or referencing the
--envargument unless explicitly provided.Logs
Additional context
--envoption was manually specified in the CLI.parseArgs()behavior incorrectly detecting an argument that wasn't passed.