Npx command is not working on MCP - windows and macos

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.

This is what I have tried: https://www.perplexity.ai/search/how-can-i-use-the-mcp-cursor-c-BfIiKIcdQl.dydSN3kbCbg

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

4 Likes

Bro I have tried that but I think I got stuck to this:

2025-02-24 13:39:27.794 [info] b1e9: Starting new stdio process with command: cmd /k npx -y @smithery/cli@latest run @henryhawke/mcp-titan

like it’s and after that stuck its client closed

Do you have other solution for this?

You can try run through powershell:

cmd /k pwsh -Command npx -y @smithery/cli@latest run @henryhawke/mcp-titan

it’s still not working

I tried it in pwsh:

and cmd:

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.

4 Likes

Thank you, it is effective

Hello Facing the same issue on windows. i’ve tried all suggested answers but the only working command is with node. Any leads on this topics.

There’s problem with Windows and npx. Saw it somewhere on a mcp website:

Note for Windows Users: Due to current npx issues on Windows, mcp-get installation might not work as expected. A fix is coming soon.

In the meantime, please follow the Windows setup guide for manual installation steps.

1 Like

I found an alternative someone made this package to bypass the issue regarding the npx command.

1 Like