• AgentArmor teamTeam2d agoNeeds helpSolved

    How to fix npx MCP servers failing to start in Cline on Windows?

    In Cline on Windows, MCP servers configured to launch with npx fail to start. This can occur when Node.js was not installed in the default location. Is there a configuration change that makes npx-based MCP servers work again?

    Originally asked on GitHub: https://github.com/cline/cline/issues/1247

    3 answers

    • Best answerAgentArmor teamTeam2d ago

      The thread is closed as completed: this is a Windows configuration workaround, not a Cline bug, and several users confirmed it works. The issue notes this can happen when Node.js was not installed in the default location.

      The reporter's fix replaces the npx command with node plus the full path to npx-cli.js, adds the APPDATA environment variable, and sets transport to stdio:

      json
      "mcp-server name": {
        "command": "node",
        "args": [
          "C:\\Users\\<username>\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npx-cli.js",
          "-y",
          "package-name"
        ],
        "env": {
          "APPDATA": "C:\\Users\\<username>\\AppData\\Roaming"
        },
        "transport": "stdio"
      }
      

      Replace <username> with your actual Windows username. If npx-cli.js is not at %APPDATA%\npm\node_modules\npm\bin\, point to its actual location.

      A commenter used an alternative that also worked: skip npx entirely and launch each installed package's entry script directly with node.exe:

      json
      "filesystem": {
        "command": "C:\\Program Files\\nodejs\\node.exe",
        "args": [
          "C:\\Users\\XXXX\\AppData\\Roaming\\npm\\node_modules\\@modelcontextprotocol\\server-filesystem\\dist\\index.js",
          "E:\\Projects\\server-setup\\"
        ]
      }
      

      The same pattern was applied to server-sequential-thinking, server-memory, and a local line-edit MCP server. The reporter explicitly notes this is only a possible fix, not a solution for every MCP problem.

      Did this work for you?
    • AgentArmor teamTeam2d ago

      What @Rakly3 tried on GitHub (Worked)

      The reporter replaced npx with node and the full path to npx-cli.js (C:\Users\<username>\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js), added the APPDATA environment variable, and set transport to stdio. Comments 2 and 3 confirmed it worked for them.

      Source: https://github.com/cline/cline/issues/1247 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam2d ago

      What @NikolaSivkov tried on GitHub (Worked)

      A commenter bypassed npx entirely, pointing C:\Program Files\nodejs\node.exe directly at each installed package's entry script (e.g. @modelcontextprotocol/server-filesystem/dist/index.js) in the MCP config.

      Source: https://github.com/cline/cline/issues/1247#issuecomment-2585400843 (opens external site)

      Did this work for you?

    Add your answer or comment