Run MCP servers in WSL

It seems the workaround for us Win11 + WSL users is to install Node on our Windows devices and prepend a cmd /c or /k to run it there.

I really don’t want to add anything to my Windows install, as everything else is nicely contained within the WSL instance.

Please can I request that, if the user is connected to WSL, that the MCP servers also run there!

5 Likes

@mwtj42 are you saying that if you insert:

Name: Browser tools
Type: Command
Command: cmd /c npx @agentdeskai/browser-tools-mcp or cmd /k npx @agentdeskai/browser-tools-mcp

You get a successful connection? I cannot, I am running WSL and Win11, I’d be happy with that result.

cmd /c npx -y @agentdeskai/browser-tools-mcp@1.0.11

is hit or miss, sometimes it works, and sometimes it doesn’t

I ran the required additional(?) server in my WSL instance
npx @agentdeskai/browser-tools-server

which suggested it had connected, but Agent died everytime it polled getNetwork - possibly due to the borked 0.46.4 update though…

Hopefully the UX will be ironed out soon for a smooth experience using MCP!

2 Likes

Whoa, that worked for me! Thanks! You have my vote.

The workaround is particularly inappropriate for the mcp-package-docs server, which will try to run python etc locally to look up docs, meaning that users will have to maintain having the same packages on both wsl and windows

1 Like

yeah, agree.

I want everything in WSL, please!

FINALLY figured this out:

wsl bash -c 'npx -y @agentdeskai/browser-tools-mcp@1.2.0

or

{
“mcpServers”: {
“browser-tools”: {
“command”: “wsl”,
“args”: [
“bash”,
“-c”,
“‘npx -y @agentdeskai/browser-tools-mcp@1.2.0’”
],
“enabled”: true
}
}
}

will launch the MCP server using WSL!

Thanks to the new Browsertools docs:

My terminal opens and stay open after this last command and if I close them I get failed to create client

yeah, the open blank terminal is a known thing on Windows - I don’t think there’s a workaround yet.

so those working with wsl cannot use mcp?

WSL works ok with MCP - you can either run the server on your Win install using cmd /c , or directly in WSL setting that as your command in .json

However, either way will launch a blank terminal that has to remain open for each MCP server


any help on the command? I have been trying different ones proposed here in the forum but none seems to be working

You’ve used both approaches simultaneously!

wsl bash (server on WSL)

OR

cmd /c (server on Windows)

I am having difficulty working with MCP servers. For example, when analyzing web applications, I encounter an issue while taking screenshots and reading Word files. I receive the message:

“Your conversation is too long. Please try creating a new conversation or shortening your messages. Start new thread with Summary.”

In such cases, what should I do? Maybe my MCP server settings are incorrect. If anyone understands MCP server configurations, please help.

My JSON configuration is as follows:

{
  "mcpServers": {
    "puppeteer": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@smithery/cli@latest",
        "run",
        "@smithery-ai/puppeteer"
      ]
    },
    "filesystem": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "C:"
      ]
    },
    "sequential-thinking": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@modelcontextprotocol/server-sequential-thinking"
      ]
    },
    "brave-search": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@smithery/cli@latest",
        "run",
        "@smithery-ai/brave-search",
        "--config",
        "{\"braveApiKey\":\"c4be44bf-957e-4706-aa50-808bbdb6cb23\"}" 
      ]
    }
  }
}

If anyone knows how to fix this issue, please let me know.

Hello mikececco,
Switching my default Node.js version from 14 to 18 fixed the issue, but it was still buggy. I had to restart the app multiple times and refresh the MCP server connection.
“nvm alias default 18”