Skip to content

Commit c800166

Browse files
authored
Fix README WSL guidance to prevent ENOENT errors (#193)
- Replace ambiguous WSL note with clear guidance for two scenarios: * Windows host VS Code: Use "command": "wsl" * Remote-WSL (VS Code inside WSL): Use direct binary or bash wrapper - Add troubleshooting section for ENOENT errors - Prevent confusion that leads to spawn failures in Remote-WSL Fixes #190
1 parent 7561003 commit c800166

File tree

1 file changed

+41
-9
lines changed

1 file changed

+41
-9
lines changed

README.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -323,20 +323,52 @@ Once started, the MCP server will appear in the **Copilot Chat: Configure Tools*
323323

324324
Try a prompt like *"List all my AKS clusters"*, which will start using tools from the AKS-MCP server.
325325

326-
Note:
327-
For VS Code that is runing inside of WSL environment, starting AKS MCP server could fail with error "Connection state: Error spawn /home/path/.vs-kubernetes/tools/aks-mcp/v0.0.3/aks-mcp ENOENT", it means VS code cannot find this file. The resolution is modifying the mcp.json file as following to make it running with wsl.
326+
#### WSL Configuration
327+
328+
The MCP configuration differs depending on whether VS Code is running on Windows or inside WSL:
329+
330+
**🪟 Windows Host (VS Code on Windows)**: Use `"command": "wsl"` to invoke the WSL binary from Windows:
328331

329332
```json
330-
"AKS MCP": {
331-
"command": "wsl",
332-
"args": [
333-
"<aks-mcp path>",
334-
"--transport",
335-
"stdio"
336-
]
333+
{
334+
"servers": {
335+
"aks-mcp": {
336+
"type": "stdio",
337+
"command": "wsl",
338+
"args": [
339+
"--",
340+
"/home/you/.vs-kubernetes/tools/aks-mcp/aks-mcp",
341+
"--transport",
342+
"stdio"
343+
]
344+
}
345+
}
337346
}
338347
```
339348

349+
**🐧 Remote-WSL (VS Code running inside WSL)**: Call the binary directly or use a shell wrapper:
350+
351+
```json
352+
{
353+
"servers": {
354+
"aks-mcp": {
355+
"type": "stdio",
356+
"command": "bash",
357+
"args": [
358+
"-c",
359+
"/home/you/.vs-kubernetes/tools/aks-mcp/aks-mcp --transport stdio"
360+
]
361+
}
362+
}
363+
}
364+
```
365+
366+
**🔧 Troubleshooting ENOENT Errors**
367+
368+
If you see "spawn ENOENT" errors, verify your VS Code environment:
369+
- **Windows host**: Check if the WSL binary path is correct and accessible via `wsl -- ls /path/to/aks-mcp`
370+
- **Remote-WSL**: Do NOT use `"command": "wsl"` - use direct paths or bash wrapper as shown above
371+
340372

341373
> **💡 Benefits**: The AKS extension handles binary downloads, updates, and configuration automatically, ensuring you always have the latest version with optimal settings.
342374

0 commit comments

Comments
 (0)