Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA: Cannot run program "C:\Program Files\nodejs\npx": CreateProcess error=193 when using MCP server

I'm trying to integrate a Model Context Protocol (MCP) server into IntelliJ IDEA (via **Settings > Tools > AI Assistant > Model Context Protocol**) using the following JSON configuration:

```json
{
  "mcpServers": {
    "DaisyUI Docs": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://gitmcp.io/saadeghi/daisyui"
      ]
    }
  }
}

However, when I save the config, IntelliJ throws this error:

Cannot run program "C:\Program Files\nodejs\npx": CreateProcess error=193, %1 is not a valid Win32 application

What I’ve tried:

  • npx mcp-remote https://gitmcp.io/saadeghi/daisyui works perfectly when I run it from the terminal (PowerShell).
  • I confirmed that both npx and npx.cmd exist in C:\Program Files\nodejs\ and npx.cmd runs fine manually.
  • Node.js and npm are properly installed and accessible via the terminal (node -v, npm -v, npx -v all return expected values).
  • I also tried changing the "command" field to "npx.cmd" but IntelliJ still fails with the same or similar error.
  • I'm on Windows 11, using IntelliJ IDEA 2025.1.2

My question:

How can I correctly configure IntelliJ's AI Assistant to run npx mcp-remote ... without this error? Is there a workaround for the %1 is not a valid Win32 application issue when using npx as a command inside the MCP JSON configuration?

Any advice or help would be greatly appreciated!

like image 411
Sonny237 Avatar asked Oct 20 '25 21:10

Sonny237


2 Answers

I solved it by specifying “npx.cmd” and added my PATH environment variable for node C:\Program Files\nodejs. I found the solution here https://intellij-support.jetbrains.com/hc/en-us/community/posts/27123021015570-MCP-Server-cannot-run-NPX#

like image 70
romanown Avatar answered Oct 23 '25 10:10

romanown


Provide the full binary path in the command, with \ to escape correctly C:\\Program Files\\nodejs\\npx.cmd. Or the answer by @romanown will also work, but you need to add npx in the PATH environment variable.

Here is the correct json configuration for your case.

{
  "mcpServers": {
    "DaisyUI Docs": {
      "command": "C:\\Program Files\\nodejs\\npx.cmd",
      "args": [
        "mcp-remote",
        "https://gitmcp.io/saadeghi/daisyui"
      ]
    }
  }
}

showing correct configuration in intellij idea for mcp server

like image 32
kdeepak Avatar answered Oct 23 '25 12:10

kdeepak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!