AI-powered React debugging with Playwright and MCP
View the Project on GitHub Lars-Albinsson/playwright-react-debug-mcp
This guide will help you install and configure Playwright React Debug MCP for use with Claude Desktop or Claude Code.
# Install globally
npm install -g playwright-react-debug-mcp
# Install Playwright browsers
npx playwright install chromium
git clone https://github.com/Lars-Albinsson/playwright-react-debug-mcp
cd playwright-react-debug-mcp
npm install
npm run build
npx playwright install chromium
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"playwright-debug": {
"command": "npx",
"args": ["playwright-react-debug-mcp"]
}
}
}
Or if you cloned the repository:
{
"mcpServers": {
"playwright-debug": {
"command": "node",
"args": ["/absolute/path/to/playwright-react-debug-mcp/dist/index.js"]
}
}
}
Restart Claude Desktop after saving.
Add to your project’s .mcp.json:
{
"mcpServers": {
"playwright-debug": {
"command": "npx",
"args": ["playwright-react-debug-mcp"],
"transport": "stdio"
}
}
}
Or with a local installation:
{
"mcpServers": {
"playwright-debug": {
"command": "node",
"args": ["./node_modules/playwright-react-debug-mcp/dist/index.js"],
"transport": "stdio"
}
}
}
| Variable | Default | Description |
|---|---|---|
MAX_CONSOLE_ENTRIES |
100 | Maximum console log entries to retain |
MAX_NETWORK_ENTRIES |
100 | Maximum network request entries to retain |
PLAYWRIGHT_HEADLESS |
false | Run browser in headless mode |
Example:
{
"mcpServers": {
"playwright-debug": {
"command": "npx",
"args": ["playwright-react-debug-mcp"],
"env": {
"PLAYWRIGHT_HEADLESS": "true",
"MAX_CONSOLE_ENTRIES": "200"
}
}
}
}
Try these prompts to explore the capabilities:
Navigate to https://example.com and get a summary of the page
Take a screenshot of the current page
Get all console logs from the page
Show me the DOM tree
npx playwright install chromiumnode /path/to/dist/index.js directly to see error messagesGrant Terminal or Claude Desktop permissions in System Preferences → Privacy & Security → Automation.