How to load Chrome extensions when using chrome-devtools-mcp?
When I use chrome-devtools-mcp with Claude Code, the Chrome instance it launches shows the warning 'Chrome is being controlled by automated test software' and will not load or unpack extensions. Is there a flag like --allow-extensions, or another way, to debug my own extension through the MCP server?
Originally asked on GitHub: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/265
4 answers
Still open: the request for an --allow-extensions flag was closed as a duplicate and is not implemented, but two community workarounds in this thread did work.
- Use Chrome for Testing. Regular Chrome 137+ dropped --load-extension support, and Puppeteer's --disable-extensions runs before any flags you pass, so you cannot override it in normal Chrome. Install Chrome for Testing with:
npx @puppeteer/browsers install chrome@stable
Then configure the MCP server:
"chrome-devtools": { "type": "stdio", "command": "npx", "args": [ "chrome-devtools-mcp@latest", "--executablePath=/path/to/chrome/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing", "--user-data-dir=/tmp/chrome-debug-profile", "--chromeArg=--load-extension=/path/to/extension/build", "--chromeArg=--disable-extensions-except=/path/to/extension/build" ] }
On first launch, enable Developer mode in chrome://extensions; the persistent --user-data-dir keeps that setting across sessions.
- Connect to an existing Chrome instance. Start Chrome with --remote-debugging-port=9222 and --user-data-dir (close all existing Chrome windows first so Chrome actually starts with debugging enabled), verify with:
curl http://127.0.0.1:9222/json/version
Then configure the MCP server with --browserUrl=http://127.0.0.1:9222 so it attaches to that Chrome instead of launching its own. In Claude Code, this mcpServers entry goes in ~/.claude.json.
General advice: only use remote debugging and browserUrl on a machine you trust, and keep the debug profile separate from your normal profile.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Tried a dedicated profile with the extension unpacked and preloaded, tried running with --isolated, and tried manually unpacking the extension in the agent-launched instance. None of these allowed extensions to load.
Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/265 (opens external site)
Did this work for you?What @cmd8 tried on GitHub (Worked)
Installed Chrome for Testing with 'npx @puppeteer/browsers install chrome@stable', then pointed chrome-devtools-mcp at it with --executablePath, --user-data-dir, --chromeArg=--load-extension, and --chromeArg=--disable-extensions-except. This made extension loading work.
Did this work for you?What @kylespringer85 tried on GitHub (Worked)
Launched an existing Chrome with --remote-debugging-port=9222 and --user-data-dir, verified it with curl to http://127.0.0.1:9222/json/version, and configured chrome-devtools-mcp with --browserUrl=http://127.0.0.1:9222 so it connected to that Chrome instead of launching a new one.
Did this work for you?
Related questions
- Why does chrome-devtools-mcp snapshot miss table/ARIA semantics?
- Why is --load-extension ignored by chrome-devtools-mcp?
- How do I use chrome-devtools-mcp from WSL when Chrome is installed on Windows?
- chrome-devtools-mcp --autoConnect times out on every tool call with Chrome 144
- How to select which Chrome profile chrome-devtools-mcp automates when several are open?