Khalil Hebachi
Email meGitHubLinkedIn
Writing

Connect Claude Code to Chrome in WSL

Let Claude Code inspect pages in WSL. Install Chrome for Testing, connect the Chrome DevTools MCP server, and check that it works.

This setup lets Claude inspect pages, check console errors and test browser interactions in WSL.

How the pieces connect
  1. Claude CodeVS Code extension
  2. stdio
  3. chrome-devtools-mcpMCP server, started with npx
  4. DevTools protocol
  5. Chrome for TestingLinux build, temporary profile
  6. opens
  7. Your local appPages, console, interactions

Claude can then Inspect pagesCheck console errorsTest interactions

Dated examples

These examples date from November 2025. Check the linked documentation for current options and requirements.

What you need

  • WSL 2
  • Node.js
  • npm
  • VS Code
  • Claude Code extension

Setup

  1. 01Install Chrome for Testing
  2. 02Configure the MCP server
  3. 03Set permissions
  4. 04Reload VS Code
  5. 05Check the connection

1. Install Chrome for Testing

WSL terminal

npx -y @puppeteer/browsers install chrome@stable --path ~/.local/share/chrome-for-testing

Save the executable path printed by the installer. Step 2 needs it.

2. Configure MCP Server

Add this server entry under your project:

~/.claude.json

{
  "projects": {
    "/path/to/your/project": {
      "mcpServers": {
        "chrome-devtools": {
          "type": "stdio",
          "command": "npx",
          "args": [
            "-y",
            "chrome-devtools-mcp@latest",
            "-e",
            "/home/username/.local/share/chrome-for-testing/chrome/linux-VERSION/chrome-linux64/chrome",
            "--isolated"
          ],
          "env": {}
        }
      }
    }
  }
}

What to change, and what the flags do

  • /path/to/your/projectReplace with your project path
  • /home/username/…/chromeReplace with the Chrome path from step 1
  • -eSelects the executable
  • --isolatedUses a temporary browser profile

3. Set permissions

To allow these tools without individual prompts, add the wildcard. It covers all Chrome DevTools tools.

~/.claude/settings.json

{
  "permissions": {
    "allow": [
      "mcp__chrome-devtools__*"
    ]
  }
}

4. Reload VS Code

Press Ctrl Shift P, then run Developer: Reload Window.

5. Check the connection

WSL terminal

claude mcp list

chrome-devtools: ... - ✓ ConnectedWhat you should see

If it does not connect

Symptom, then what to check

  • Chrome not foundCheck the installed version folder and update the -e path.
  • Target closedCheck whether Chrome starts. If you are launching Windows Chrome, try the Linux installation above.
  • Server missingCheck the JSON syntax, reload VS Code and inspect the extension logs.
  • Permission deniedCheck the allow list in your global or project settings.

Try it

Ask Claude

Open my local app, report console errors and take a screenshot.

Once that works, try a complete workflow such as signing in or submitting a test form.

Documentation

Chrome DevTools MCPgithub.com/ChromeDevTools/chrome-devtools-mcpClaude Codedocs.claude.com/en/docs/claude-codeChrome for Testingdeveloper.chrome.com/blog/chrome-for-testing

Ask about my work

AI answers from my CV and case studies. It can make mistakes.

Ask anything about my projects, results, or how I work.