Skip to content

fix: allow empty CLI env values#1315

Open
pragnyanramtha wants to merge 1 commit into
modelcontextprotocol:mainfrom
pragnyanramtha:codex/allow-empty-env-values
Open

fix: allow empty CLI env values#1315
pragnyanramtha wants to merge 1 commit into
modelcontextprotocol:mainfrom
pragnyanramtha:codex/allow-empty-env-values

Conversation

@pragnyanramtha
Copy link
Copy Markdown

Summary

  • allow -e KEY= in the Inspector launcher instead of rejecting empty environment variable values
  • keep rejecting malformed values without an = and empty keys
  • add CLI regression coverage for passing an empty env var through to a stdio MCP server

Validation

  • npm install
  • npm run build-cli
  • npx prettier --check cli/src/cli.ts cli/__tests__/cli.test.ts
  • export PATH=/home/ubuntu/gh-pr/inspector-main/node_modules/.bin:$PATH; cd cli && npm run test:cli -- -t "empty environment variable values"
  • export PATH=/home/ubuntu/gh-pr/inspector-main/node_modules/.bin:$PATH; timeout 30s node cli/build/cli.js tsx /home/ubuntu/gh-pr/inspector-main/cli/__tests__/helpers/test-server-stdio.ts -e EMPTY_ENV= --cli --method resources/read --uri test://env
  • git diff --check

Note: running the full CLI suite without adding the repo-local node_modules/.bin to PATH timed out in this local checkout because the test MCP server command could not resolve tsx; the targeted regression passes when tsx is resolvable.

Copilot AI review requested due to automatic review settings May 17, 2026 04:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants