Skip to content

Avoid shell=True when launching mcp dev inspector on Windows#2371

Open
raashish1601 wants to merge 1 commit intomodelcontextprotocol:mainfrom
raashish1601:contributor-54/python-sdk-1257
Open

Avoid shell=True when launching mcp dev inspector on Windows#2371
raashish1601 wants to merge 1 commit intomodelcontextprotocol:mainfrom
raashish1601:contributor-54/python-sdk-1257

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • resolve npx to a concrete executable on Windows instead of probing with shell=True
  • keep mcp dev launching the inspector with a direct argv call and copied environment
  • add focused CLI tests for the Windows resolution path and the shell-free inspector launch

Fixes #1257.

Validation

  • PYTHONPATH=src python -m pytest tests/cli/test_utils.py -q
  • python -m ruff check src/mcp/cli/cli.py tests/cli/test_utils.py
  • git diff --check

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.

Don’t use shell=True in mcp dev subprocess on Windows (command injection risk)

1 participant