DesktopCommanderMCP icon indicating copy to clipboard operation
DesktopCommanderMCP copied to clipboard

WSL MCP Configuration

Open mdiener87 opened this issue 9 months ago • 7 comments

Hello! I saw your YouTube video on this project, and thought it was super cool! My personal dev system is Windows 11 running WSL, which has unique challenges for this type of application. I run Claude in Windows Desktop, but Node I run in WSL terminal. The provided/example MCP server configuration did not work for this scenario. After some troubleshooting, I've come up with this configuration instead:

~\AppData\Roaming\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "desktop-commander": {
      "command": "wsl",
      "args": [
        "bash",
        "-ic",
        "npx -y @wonderwhy-er/desktop-commander"
      ]
    }
  }
}

This allows Claude to connect to WSL, load bash in interactive mode, and execute the MCP server. With this configuration, everything else worked out of the box! I'm excited to play with this further, thanks! I hope this configuration helps other people use this project on a split Windows/WSL setup like I'm running.

mdiener87 avatar Mar 20 '25 01:03 mdiener87

Which command have you used to install? I wonder if this could be suggested to Smithery

wonderwhy-er avatar Mar 20 '25 08:03 wonderwhy-er

I performed a manual installation. I'm new to interacting with MCP, so maybe Smithery install method already solves for this problem. It would be interesting to try again and see if that's the case.

mdiener87 avatar Mar 20 '25 16:03 mdiener87

@mdiener87 I tried to install on WSL as follows and got an error: npx @wonderwhy-er/desktop-commander setup {"type":"info","timestamp":"2025-03-22T12:54:23.121Z","message":"Claude config file not found at: /home/saro/Library/Application Support/Claude/claude_desktop_config.json"} {"type":"info","timestamp":"2025-03-22T12:54:23.123Z","message":"Creating default config file..."} {"type":"error","timestamp":"2025-03-22T12:54:23.124Z","message":"Failed to start server: ENOENT: no such file or directory, open '/home/saro/Library/Application Support/Claude/claude_desktop_config.json'"}

I would appreciate it if you could let me know how you installed manually. Thanks!

saro-saravanan avatar Mar 22 '25 12:03 saro-saravanan

@mdiener87 your command worked like a charm. Thanks for sharing!

mugoosse avatar Mar 22 '25 21:03 mugoosse

@mdiener87 I tried to install on WSL as follows and got an error: npx @wonderwhy-er/desktop-commander setup {"type":"info","timestamp":"2025-03-22T12:54:23.121Z","message":"Claude config file not found at: /home/saro/Library/Application Support/Claude/claude_desktop_config.json"} {"type":"info","timestamp":"2025-03-22T12:54:23.123Z","message":"Creating default config file..."} {"type":"error","timestamp":"2025-03-22T12:54:23.124Z","message":"Failed to start server: ENOENT: no such file or directory, open '/home/saro/Library/Application Support/Claude/claude_desktop_config.json'"}

I would appreciate it if you could let me know how you installed manually. Thanks!

IIRC, I used npm install -g @wonderwhy-er/desktop-commander to install the repo.

mdiener87 avatar Mar 23 '25 03:03 mdiener87

Just wanted to add that in case you're not using bash as your default shell, you can replace it with other shells in the config. In my case, I'm using zsh as my default shell and that's where node is installed, so I this is my config:

{
  "mcpServers": {
    "desktop-commander": {
      "command": "wsl",
      "args": [
        "zsh",
        "-ic",
        "npx -y @wonderwhy-er/desktop-commander"
      ]
    }
  }
}

I'm also using asdf, so I had to create a .tool-versions file in my home folder within Windows (/mnt/c/Users/<username>/.tool-versions). This is required for the npx command to run.

terenceponce avatar May 12 '25 10:05 terenceponce

Hello! I saw your YouTube video on this project, and thought it was super cool! My personal dev system is Windows 11 running WSL, which has unique challenges for this type of application. I run Claude in Windows Desktop, but Node I run in WSL terminal. The provided/example MCP server configuration did not work for this scenario. After some troubleshooting, I've come up with this configuration instead:

~\AppData\Roaming\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "desktop-commander": {
      "command": "wsl",
      "args": [
        "bash",
        "-ic",
        "npx -y @wonderwhy-er/desktop-commander"
      ]
    }
  }
}

This allows Claude to connect to WSL, load bash in interactive mode, and execute the MCP server. With this configuration, everything else worked out of the box! I'm excited to play with this further, thanks! I hope this configuration helps other people use this project on a split Windows/WSL setup like I'm running.

legend. thank you

jonathanlal avatar Jun 28 '25 03:06 jonathanlal