playwright-mcp-wsl
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@playwright-mcp-wslGo to playwright.dev and take a screenshot"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
playwright-mcp-wsl
Drop-in WSL-safe wrapper for @playwright/mcp. Prevents Chromium GPU crashes on Windows Subsystem for Linux.
The Problem
Running Claude Code (or any Playwright-based browser automation) on WSL2 with parallel browser sessions causes cascading crashes:
Chromium tries to allocate GPU memory through WSL's
dxgbridgeMultiple browser instances exhaust GPU memory allocations
Chrome processes SEGFAULT (signal 11)
Crash cascade takes down the entire WSL instance
This is invisible to users — WSL just "crashes" or "freezes" with no clear error.
Related MCP server: mcp-playwright
The Fix
This package wraps @playwright/mcp and automatically injects GPU-safe flags when running on WSL:
--disable-gpu
--disable-software-rasterizer
--disable-dev-shm-usageOn non-WSL systems, it passes through to @playwright/mcp unchanged. No performance impact — GPU acceleration is meaningless for headless browser automation.
Installation
Claude Code (recommended)
Add to your Claude Code settings (.claude/settings.json or global settings):
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["playwright-mcp-wsl@latest"]
}
}
}This replaces the default @playwright/mcp entry.
Manual / Other MCP Hosts
npx playwright-mcp-wsl@latestAll @playwright/mcp CLI flags are supported:
npx playwright-mcp-wsl@latest --headless --viewport-size 1440x900Programmatic
const { createConnection } = require('playwright-mcp-wsl');
// Same API as @playwright/mcp, with WSL-safe defaultsHow It Works
Detects WSL by reading
/proc/versionfor Microsoft/WSL kernel stringsIf WSL: sets
PLAYWRIGHT_MCP_CONFIGto a bundled config that adds--disable-gpuand related flags to Chromium launch argsIf not WSL: passes through to
@playwright/mcpwith zero modificationsIf user has custom config: merges WSL-safe args into existing config (no overwrite)
What It Disables
Flag | Why |
| Prevents GPU memory allocation through the dxg bridge |
| Prevents fallback software GPU that still uses dxg |
| Uses |
What It Doesn't Affect
Page rendering quality (identical for headless automation)
JavaScript execution
Network requests
Screenshot quality
DOM interaction
Any Playwright MCP functionality
Compatibility
WSL1 and WSL2
Windows 10 and Windows 11
Node.js 18+
All
@playwright/mcpversions >= 0.0.60Claude Code, Cursor, Windsurf, or any MCP-compatible host
Verifying It Works
When running on WSL, you'll see in stderr:
[playwright-mcp-wsl] Detected WSL2 + dxg bridge. Injecting GPU-safe config.When running on non-WSL:
[playwright-mcp-wsl] Not running in WSL. Passing through to @playwright/mcp.Background
This package was created after diagnosing cascading WSL crashes during parallel browser automation with Claude Code's PAI system. The root cause was Chromium's GPU memory allocation through WSL2's dxg (DirectX Graphics) bridge — a kernel-level GPU passthrough layer not designed for concurrent headless browser load.
Crash signature in dmesg:
misc dxg: dxgk: dxgvmb_send_create_allocation: send_create_allocation failed ffffffb5
misc dxg: dxgk: dxgkio_create_allocation: Ioctl failed: -75
chrome: potentially unexpected fatal signal 11
WSL (CaptureCrash): Capturing crash for pid: ..., executable: chrome, signal: 11License
Apache-2.0 — same as Playwright.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NorthwoodsSentinel/playwright-mcp-wsl'
If you have feedback or need assistance with the MCP directory API, please join our Discord server