Problem
The resolve-pnpm.js resolver only rewrites entries that use pnpm dlx (or have an existing command/args shape it recognizes). Standalone Node.js binaries installed globally via npm — such as @colbymchenry/codegraph — end up with a bare command name and no wsl.exe prefix after running the resolver.
Affected config (before fix)
"codegraph": {
"type": "stdio",
"command": "codegraph",
"args": ["serve", "--mcp"]
}
VS Code (Windows host) launches this via wsl.exe with no login shell, so codegraph is not on PATH → server exits immediately / never responds to initialize.
Manual fix applied
"codegraph": {
"type": "stdio",
"command": "wsl.exe",
"args": [
"-e",
"env",
"PATH=/home/kylebrodeur/.local/share/fnm/aliases/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"/home/kylebrodeur/.local/share/fnm/aliases/default/bin/codegraph",
"serve",
"--mcp"
]
}
Suggested fix
When the resolver encounters a stdio server whose command is a bare binary name (no path separators, not wsl.exe, not node, not pnpm) and we are in WSL writing to a Windows target:
- Run
which <command> inside WSL to resolve the absolute path.
- Wrap it with the same
wsl.exe -e env PATH=<fnm-bin>:<std-paths> <abs-path> ...args prefix used for pnpm servers.
- Preserve the original
args array unchanged (the binary's own subcommands/flags).
This would make the resolver idempotent and comprehensive for any npm-installed global binary, not just pnpm-launched packages.
Problem
The
resolve-pnpm.jsresolver only rewrites entries that usepnpm dlx(or have an existingcommand/argsshape it recognizes). Standalone Node.js binaries installed globally via npm — such as@colbymchenry/codegraph— end up with a barecommandname and nowsl.exeprefix after running the resolver.Affected config (before fix)
VS Code (Windows host) launches this via
wsl.exewith no login shell, socodegraphis not on PATH → server exits immediately / never responds toinitialize.Manual fix applied
Suggested fix
When the resolver encounters a stdio server whose
commandis a bare binary name (no path separators, notwsl.exe, notnode, notpnpm) and we are in WSL writing to a Windows target:which <command>inside WSL to resolve the absolute path.wsl.exe -e env PATH=<fnm-bin>:<std-paths> <abs-path> ...argsprefix used for pnpm servers.argsarray unchanged (the binary's own subcommands/flags).This would make the resolver idempotent and comprehensive for any npm-installed global binary, not just pnpm-launched packages.