๐Ÿ› ๏ธ Complete Guide: Setting Up MCP Tools with Browser Extensions in WSL2

Are you trying to use MCP tools with browser extensions in WSL2? This guide covers the networking challenges and solutions for getting tools like Browser MCP, web automation tools, and any MCP that needs to communicate between WSL2 and Windows browsers.

:bullseye: The Problem

Many MCP (Model Context Protocol) tools require communication between:

  • MCP Server (running in WSL2)
    • MCP Server W/ Browser Extension (running in Windows browser)
      WSL2 creates a virtual network that isolates these components, causing connection failures.

:high_voltage: Quick Fix for Most Users

1. Remove wsl from your MCP config

If youโ€™re getting spawn wsl EACCES errors, youโ€™re likely running WSL inside WSL:

:cross_mark: Wrong:

{
  "mcpServers": {
    "toolname": {
      "command": "wsl",
      "args": ["npx", "-y", "@tool/package"]
    }
  }
}

:white_check_mark: Correct:

{
  "mcpServers": {
    "toolname": {
      "command": "npx", 
      "args": ["-y", "@tool/package"]
    }
  }
}

2. Enable WSL2 Network Mirroring (Windows 11 22H2+)

Create/Edit: %USERPROFILE%\.wslconfig

[wsl2]
networkingMode=mirrored

Restart WSL:

wsl --shutdown
# Wait 10 seconds, then restart

:white_check_mark: Testing Your Setup


Let me know if this helps or if you run into specific issues! :rocket: