Summary
The detect_code_duplication MCP server fails on Windows. Every call returns immediately:
{ "status": "error", "message": "spawn npx ENOENT" }
There are three Windows / cross-platform issues — the first is fatal, the other two silently produce wrong results.
Environment: Windows 11 · Node v24.16.0 · npm 11.13.0 · drywall 0.2.3
1. spawn npx ENOENT (fatal)
runJscpd in src/lib.js calls execFile("npx", fullArgs). On Windows npx is npx.cmd; execFile doesn't resolve it via PATHEXT, so it throws ENOENT. (execFile("npx.cmd", …) would also throw EINVAL on patched Node — CVE-2024-27980 — unless a shell is used.)
2. Empty report on absolute scan paths
When an absolute Windows path is passed, jscpd's fast-glob treats \ as an escape character (on every platform), so the pattern matches nothing and the server errors with ENOENT … jscpd-report.json. The default . happens to dodge this.
3. Array options keep only the last value
buildArgs expands array options (e.g. ignore: ["a", "b", "c"]) into repeated --ignore a --ignore b --ignore c. jscpd keeps only the last --ignore, so the other patterns are silently dropped (e.g. a vendored directory you tried to ignore still gets scanned).
I have a fix for all three ready as a PR.
Summary
The
detect_code_duplicationMCP server fails on Windows. Every call returns immediately:{ "status": "error", "message": "spawn npx ENOENT" }There are three Windows / cross-platform issues — the first is fatal, the other two silently produce wrong results.
Environment: Windows 11 · Node v24.16.0 · npm 11.13.0 · drywall 0.2.3
1.
spawn npx ENOENT(fatal)runJscpdinsrc/lib.jscallsexecFile("npx", fullArgs). On Windowsnpxisnpx.cmd;execFiledoesn't resolve it viaPATHEXT, so it throwsENOENT. (execFile("npx.cmd", …)would also throwEINVALon patched Node — CVE-2024-27980 — unless a shell is used.)2. Empty report on absolute scan paths
When an absolute Windows
pathis passed, jscpd's fast-glob treats\as an escape character (on every platform), so the pattern matches nothing and the server errors withENOENT … jscpd-report.json. The default.happens to dodge this.3. Array options keep only the last value
buildArgsexpands array options (e.g.ignore: ["a", "b", "c"]) into repeated--ignore a --ignore b --ignore c. jscpd keeps only the last--ignore, so the other patterns are silently dropped (e.g. a vendored directory you tried to ignore still gets scanned).I have a fix for all three ready as a PR.