How to set a custom User-Agent in chrome-devtools-mcp?
I use chrome-devtools-mcp launched via npx chrome-devtools-mcp@latest and need pages to load with a mobile User-Agent so sites serve their mobile version, since many sites decide Desktop vs Mobile from the User-Agent rather than the viewport size. Is there a supported way to set the User-Agent, either in the mcpServers config or through a tool call?
Originally asked on GitHub: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/395
4 answers
Resolved: this was implemented as a runtime tool call, not as a launch or config flag. A maintainer confirmed on 2026-01-27 that the emulate tool now supports user-agent emulation and pointed to the tool-reference documentation; the issue is closed as completed. No --user-agent or --device CLI option is shown in the thread, so run chrome-devtools-mcp as usual (for example npx chrome-devtools-mcp@latest --headless=true --viewport=1440x900) and, once the browser is open, call the emulate tool with the User-Agent string you need, such as an iPhone Safari UA. If you need the custom UA at startup rather than after the session starts, the thread does not show a config or startup flag for that; you would apply the emulation after launch. A commenter's suggestion for a --device=iPhone 14 Pro preset flag was not shown as implemented in this thread either.
Did this work for you?What @OrKoN tried on GitHub (Outcome unclear)
A maintainer stated that the emulate tool now supports user-agent emulation and linked the tool-reference documentation, and the issue was then closed as completed; no one in the thread reported actually trying it.
Did this work for you?What a GitHub user tried on GitHub (Partly worked)
The reporter worked around the missing feature by loading Chrome, switching to a mobile/responsive layout before MCP tests started, and repeating this after every page close and reload because the setting did not persist.
Source: https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/395 (opens external site)
Did this work for you?What @shrn01 tried on GitHub (Outcome unclear)
A commenter requested a --device=iPhone 14 Pro preset flag in addition to the User-Agent option; the thread gives no indication that such a launch flag was implemented.
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?