Hi guys! do you have any idea how to make it work the “npx -y” command in MCP server because I tried all of the method and I search all of it and it’s not working in my end. Some of the users said that it’s working on them and I don’t know why we encountering this issues.
I think this is a mistake on the part of the developers.
My statement.
How NPX, Shell, and Child Processes Work on Windows:
NPX is a tool for running Node.js packages without installing them globally.
When you run npx some-command, NPX starts as a process and creates a child process for your app.
On Windows, this child process needs a shell environment to properly handle input/output and termination.
Using cmd /k npx some-command ensures the shell stays open, preventing unexpected process termination.
Unix systems handle this differently due to their built-in process management.
npx needs an interpreter
use “cmd /k npx @agentdeskai/browser-tools-mcp” as command
I have taken a closer look again.
On Windows, npx and npm are actually invoked as npx.cmd and npm.cmd, since they are batch scripts. Batch scripts require an interpreter— in this case, cmd.exe— to execute them. Therefore, you need to run the command like:
cmd /c npx @agentdeskai/browser-tools-mcp
or
cmd /k npx @agentdeskai/browser-tools-mcp
Both work. Just make sure that no other Node.js tasks are running in the background except for the mcp server; you can check this in the Task Manager.
The /c or /k flag passes “npx @agentdeskai/browser-tools-mcp” as an argument to cmd.exe. For example, if I enter “note” as a command in mcp, it works because node (node.exe) is an executable file, and Windows can execute it directly.
EXE files: Can be executed directly by the OS because they are already in machine language.
Shell scripts: Require an interpreter (e.g. cmd.exe) to execute the commands they contain.
For stdio servers, the command should be a valid shell command that can be run from the terminal. If you require environment variables to be set, we recommend you write a small wrapper script that sets the environment variables and then runs the server.