Skip to content

No way to use an env variable with an empty string as a meaningful value #629

@vanyauhalin

Description

@vanyauhalin

Describe the bug

Not always empty string the same as undefined. Sometimes a variable can have three states instead of two: a string value, an empty string, and an undefined value.

To Reproduce

npm exec -- mcp-inspector -e MY_ENV= -- node main.js

Expected behavior

Treat an empty string as an actual value.

Logs

Invalid parameter format: MY_ENV=. Use key=value format.

Additional context

https://github.com/modelcontextprotocol/inspector/blob/0.16.1/cli/src/cli.ts#L147-L151
https://github.com/modelcontextprotocol/inspector/blob/0.16.1/cli/src/index.ts#L171-L175

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions