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.
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.
- MCP Server W/ Browser Extension (running in Windows browser)
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:
Wrong:
{
"mcpServers": {
"toolname": {
"command": "wsl",
"args": ["npx", "-y", "@tool/package"]
}
}
}
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
Testing Your Setup
Let me know if this helps or if you run into specific issues!