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
npx mcp-remote https://gitmcp.io/saadeghi/daisyui works perfectly when I run it from the terminal (PowerShell).npx and npx.cmd exist in C:\Program Files\nodejs\ and npx.cmd runs fine manually.node -v, npm -v, npx -v all return expected values)."command" field to "npx.cmd" but IntelliJ still fails with the same or similar error.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!
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#
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"
]
}
}
}

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