Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Nov 11, 2025

This PR attempts to address Issue #9167. Feedback and guidance are welcome.

Problem

The chrome-devtools-mcp server was not being detected when configured with npx chrome-devtools-mcp@latest on Windows systems. This was due to how the command was being wrapped with cmd.exe for Windows compatibility.

Solution

Added special handling for npx commands that include @ in the package name (e.g., chrome-devtools-mcp@latest):

  • On Windows, when npx is used with a package containing @, we now combine npx and the package name into a single command string
  • This ensures proper package resolution when wrapped with cmd.exe
  • The fix maintains backward compatibility with other command types

Changes

  • Modified McpHub.ts to detect and handle npx with versioned packages
  • Added comprehensive test coverage for the new behavior
  • Tests verify correct handling of:
    • npx package@version syntax
    • npx package@version with additional arguments
    • Non-Windows platforms (no change in behavior)
    • Already wrapped commands (no double-wrapping)

Testing

  • All existing tests pass
  • Added new tests specifically for this scenario
  • Verified the fix handles various package@version formats

Fixes #9167


Important

Fixes handling of npx with package@version syntax on Windows in McpHub.ts, ensuring proper command execution with cmd.exe.

  • Behavior:
    • Fixes handling of npx commands with package@version syntax on Windows in McpHub.ts.
    • Combines npx and package name into a single command string for Windows compatibility.
    • Ensures proper command execution when wrapped with cmd.exe.
  • Testing:
    • Adds tests in McpHub.spec.ts for npx package@version syntax handling on Windows.
    • Tests include scenarios with additional arguments and non-Windows platforms.
    • Verifies no double-wrapping of commands already using cmd.exe.

This description was created by Ellipsis for 14a8021. You can customize this summary. It will automatically update as commits are pushed.

- Special handling for npx commands with @ in package names (e.g., chrome-devtools-mcp@latest)
- On Windows, combine npx and package@version into a single command string before wrapping with cmd.exe
- This ensures proper package resolution when using npx with versioned packages
- Added comprehensive tests for the new behavior

Fixes #9167
@roomote roomote bot requested review from cte, jr and mrubens as code owners November 11, 2025 07:00
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Nov 11, 2025
@roomote
Copy link
Author

roomote bot commented Nov 11, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found.

This PR successfully addresses Issue #9167 by adding special handling for npx commands with package@version syntax on Windows. The implementation is clean, well-tested, and maintains backward compatibility.

Key improvements:

  • Properly handles npx package@version syntax on Windows by combining them into a single command string
  • Comprehensive test coverage for various scenarios
  • No breaking changes to existing functionality

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] chrome-devtools-mcp server not working or not detecting as MCP server

3 participants