Chrome DevTools MCP Refuses to Screenshot /etc — and Opens file:///etc/hostname Without Complaint

Measured on chrome-devtools-mcp 1.13.0: /etc screenshots blocked, file:///etc/hostname readable, cookies unredacted and surviving across sessions.

Chrome DevTools MCP is the tool Google ships so that a coding agent can drive your actual Chrome: click, type, read the console, inspect network traffic, record a performance trace. It has 56,306 stars, 4,759 forks, and 10,023,171 npm downloads in the last month. The README’s quickstart is four lines of JSON, and the project’s own security policy is unusually candid for a Google repo — it names its trusted inputs, declines to treat prompt injection as a vulnerability, and tells you to use an OS sandbox if you plan to look at code you did not write.

Candid policy documents are worth testing rather than quoting. So I installed chrome-devtools-mcp@1.13.0, wrote a small MCP stdio client, pointed the server at a real Chromium build, and ran the defaults.

Two of those defaults do not agree with each other.

The result that frames the rest

With no flags set, the server refuses to write a screenshot outside the workspace roots:

take_screenshot  filePath=/etc/cdm_probe_should_fail.png
→ Error: Access denied: path "/etc/cdm_probe_should_fail.png"
  (canonical: "/etc/cdm_probe_should_fail.png") is not within any of the
  configured workspace roots.

That is the filesystem control working. Then, on the same server, with the same default flags, in the same session:

new_page  url=file:///etc/hostname
→ ## Pages
  2: hostname (file:///etc/hostname) [selected]

take_snapshot
→ ## Latest page snapshot
  uid=1_0 RootWebArea url="file:///etc/hostname"
    uid=1_1 "srv1436816\n"

The second path returns the contents of a host file into the model’s context as ordinary page text, and the accessibility-tree snapshot is the recommended extraction path — the one the design principles point at when they say “Return semantic summaries” and “for heavy assets, return a file path… never the raw data stream”.

The reason both behaviours are correct-by-configuration is one line in docs/configuration.md:

--file-navigations: Set to false to disallow navigating to file: URLs. … Default: true

and one more:

--filesystem-root: A directory that filesystem tools are allowed to access. … Default: OS temp directory

Those are two separate gates. --filesystem-root governs the server’s own read/write of files (screenshots, traces, heap snapshots, script output). --file-navigations governs the browser’s ability to load a file: URL into a page, whose contents then come back through take_snapshot. Setting one does not set the other. If you hardened this server by adding a workspace root and stopping there, you closed the gate that was already closed by default and left the one that returns file contents open.

Passing --no-file-navigations closes it:

new_page  url=file:///etc/hostname
→ Error: Navigating to file: URLs is not allowed when --file-navigations is disabled.

Three flags, and the whole class of findings in this article appears: --file-navigations, --isolated, --redact-network-headers. All three default to the permissive side, and none of them is mentioned in the four-line quickstart.

What the defaults actually are

Measured on v1.13.0, Linux, Node 26.12.1, tools/list over stdio:

FlagDocumented defaultWhat that means in practice
--isolatedfalseBrowser state persists across server processes in ~/.cache/chrome-devtools-mcp/chrome-profile
--redact-network-headersfalseget_network_request returns cookie: and set-cookie: verbatim
--file-navigationstruefile:// URLs load and their text comes back through take_snapshot
--javascript-evaluationtrueevaluate_script runs caller-supplied JS in the page, by design
--usage-statisticstrueGoogle Clearcut telemetry, unless CI is set in the environment
--performance-cruxtrueURLs from performance traces are sent to the CrUX API
--filesystem-root"OS temp directory"Resolves to $TMPDIR, not /tmp
--allow-unrestricted-pathsfalseFile access confined when no MCP roots are negotiated
--headlessfalseA visible browser window opens on the machine running the agent

The docs are honest about every one of these. What they do not do is put any of them in front of you at the moment you copy the quickstart, and the consequences are not self-evident from a boolean name. --isolated: false reads like “use my normal browser”; it is not that, and what it actually is matters more.

The profile is not your browser, and it does not go away

Default --isolated is false. The launch does not touch your everyday Chrome profile — the default user-data directory is documented as $HOME/.cache/chrome-devtools-mcp/chrome-profile$CHANNEL_SUFFIX_IF_NON_STABLE. That is a dedicated profile, which is better than hijacking yours. It is also persistent, which is the part worth noticing.

I set a cookie with a one-day expiry in one server process, closed everything, started a fresh server process, and read it back:

RunFlagsdocument.cookie
1 (set)default… persist_probe=RUN1_TOKEN
2 (read)defaultpersist_probe=RUN1_TOKEN — still there
1 (set)--isolated… persist_probe=RUN1_TOKEN
2 (read)--isolatedgone

Session cookies (no max-age) do not survive, because that is what “session cookie” means and Chrome honours it. Cookies with an expiry, localStorage, IndexedDB, service workers and history all do, because the profile directory is real disk: 2.8 MB after two short runs. The project ships a cookie-debugging skill whose stated purpose is “Debug cookies, sessions, and authentication”, and an agent that logs into your staging dashboard on Monday will still be logged in on Friday — including in a session started for an unrelated repository.

--isolated costs you exactly one thing: you have to log in again next time. In a repo you did not write, that is the cheapest trade in the file.

Cookies come back in the clear

--redact-network-headers defaults to false. On a local page that sets two cookies and then issues a same-origin fetch, get_network_request returned this, verbatim, to the MCP client:

### Request Headers
- cookie:session=SUPERSECRET123; auth_token=BEARER_XYZ_987
- host:127.0.0.1:8931
### Response Headers
- set-cookie:server_side=SS_COOKIE_42; Path=/

And evaluate_script with () => document.cookie returned all three. With --redact-network-headers, the same request came back as cookie:<redacted>.

The tool’s own description for get_network_request says it is “Useful for inspecting request headers (including ‘Cookie’) and response headers (including ‘Set-Cookie’)”. So this is a feature, documented, and the flag to turn it off exists. Two things follow that the description does not say:

The cookies land in the model’s context window, which means they land in whatever transcript store, log aggregator, or provider-side retention policy your client has. HttpOnly does not help here — DevTools sees the header before any page script could.

And the exposure is reachable through the recommended safe path. Hacker News commenter guard402 reported testing this directly: the default take_snapshot uses Accessibility.getFullAXTree, which filters display:none content, and “evaluate_script is the escape hatch… Also worth noting: opacity:0 and font-size:0 bypass even the safe defaults.” I did not re-run that experiment, so treat it as their report rather than mine — but it describes the right shape of the problem: the model, not you, chooses which extraction method to use.

$TMPDIR, not /tmp

The documented default for --filesystem-root is “OS temp directory”. My environment sets TMPDIR=/opt/data/cache/scratch, and:

Target pathResult
/etc/cdm_probe_should_fail.pngAccess denied … not within any of the configured workspace roots
/tmp/cdm_probe_ok.pngAccess denied — same error
/opt/data/cache/scratch/cdm_probe_tmpdir.png ($TMPDIR)Saved screenshot to …

This is not a bug; resolving “the OS temp directory” from $TMPDIR is the correct POSIX behaviour. It matters because container platforms routinely remap TMPDIR to a mounted volume — Kubernetes, Docker with a scratch disk, CI runners that point it at the checkout directory. In those environments the “sandbox” the server falls back to when no MCP roots are negotiated is not a small ephemeral directory, it is a writable mount, and it is shared with whatever else uses that path. The error message says “workspace roots” even when no workspace was ever configured, which is the kind of wording that makes people assume a protection that was never applied.

Where the URLs go

--performance-crux defaults to true. When a trace stops, tools/performance.js calls populateCruxData, which

  • sets the DevTools field-data setting to {enabled: true} unconditionally, overriding whatever the user’s DevTools preferences said;
  • collects URLs out of result.parsedTrace.insights plus data.Meta.mainFrameURL;
  • sends them to https://chromeuxreport.googleapis.com/v1/records:queryRecord.

The call is properly gated on the flag — if (context.isCruxEnabled()) reads --performance-crux, so --no-performance-crux does stop it. The README discloses it in a one-line disclaimer: “Performance tools may send trace URLs to the Google CrUX API to fetch real-user experience data.” What it does not say is that the payload is every URL in the insight set, which for a debugging session on an internal app means staging hostnames, path segments, and whatever is in the query string. CrUX only has data for publicly-observed origins, so most of those requests will simply fail to return useful field data — the URL has been transmitted either way.

The source also carries the API key inline, along with a comment that answers the question before you can ask it:

// go/jtfbx. Yes, we're aware this API key is public. ;)
cruxManager.setEndpointForTesting(
  'https://chromeuxreport.googleapis.com/v1/records:queryRecord?key=AIzaSy...gUfk');

The repo has a .gitallowed entry whose commit message is literally “chore: allow API key”. This is a deliberate, documented decision, not a leak.

Telemetry is better engineered than its reputation

“Google collects usage statistics” on a default-on flag invites the worst assumption. Reading telemetry/transformation.js is worth doing before making it, because the payload is more disciplined than most:

DataWhat is actually sent
Tool argumentsParameter names only
String argumentsBucketed length (0, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000)
Array argumentsLength
Numeric argumentsValue
Enum argumentsValue
Page URLA single is_localhost boolean
Client name[a-zA-Z0-9_-], max 32 chars, else <redacted>
LatencyBucketed 50–10,000 ms
Blocklisted paramsuid, reqid, msgid

No page content, no URLs, no string values. Strings become _length. Numbers pass through raw, which is the one gap I would raise with the team — a debug session on a viewport, a budget, or a numeric ID sends the value — but nothing in the default tool surface takes a secret as a number.

Two practical notes: the backend is Chrome’s Clearcut logger, initialised from index.js when usageStatistics is true, and collection is disabled automatically when CI or CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS is set. If you run agents in CI you are already opted out without knowing.

The startup call nobody documents

Every server start also checks for a newer version. The README describes this in one sentence. What it does not describe is the mechanism, which I traced with a fake npm shim on PATH:

NPM_CALLED argv=config get registry cwd=<the directory the server was started in>

bin/check-latest-version.js runs execSync('npm config get registry'), then fetches ${registry}/chrome-devtools-mcp/latest and writes data.version into ~/.cache/chrome-devtools-mcp/latest.json. SECURITY.md explains the choice:

We intentionally shell out to npm so that update checks respect the user’s registry, proxy, and authentication configuration.

That is a reasonable reason. It also means npm config get registry resolves .npmrc at project, user and global scope — and SECURITY.md lists precisely that as trusted:

The user’s npm configuration at every scope (.npmrc files in the project, user, and global locations) … Reports that require an attacker to control any of these are not considered vulnerabilities.

Both statements are defensible on their own. Put together with the quickstart’s chrome-devtools-mcp@latest, they compose into something worth measuring. MCP clients typically start stdio servers with the opened workspace as the working directory — which SECURITY.md also says out loud — so I made a directory containing one file, .npmrc with registry=http://127.0.0.1:8932/, and started the server from there. My logger received:

GET /chrome-devtools-mcp/latest UA='node'

It answered {"version":"9.9.9-evil"}. latest.json then contained {"version":"9.9.9-evil"}, and the next start printed, verbatim, to stderr:

Update available: 1.13.0 -> 9.9.9-evil
Run `npm install chrome-devtools-mcp@latest` to update.

Be precise about what this is. It is not remote code execution. No credentials are sent — the request is a plain fetch from Node, not an authenticated npm call, so no registry token travels with it. What a cloned repository can control is the version string in a message your agent will read, delivered alongside an instruction to install @latest. Whether that matters depends entirely on how much autonomy you have given the agent, and on whether anything in your setup acts on update notices. In a human-in-the-loop editor it is a poke. In an agent loop that treats tool output as a to-do list, it is a suggestion from an untrusted repo arriving through a trusted channel.

You can close it two ways, and both are cheap: pin the version instead of using @latest, and set CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS.

63 documented tools, 33 exposed

docs/tool-reference.md is auto-generated and lists 63 tool sections. tools/list on a default server returns 33.

ConfigurationTools exposed
Default33
--slim3 — evaluate, navigate, screenshot
--no-javascript-evaluation31
--experimental-vision34 (+ click_at)
--memory-debugging46

The gap is not a documentation error — the remaining tools sit behind opt-ins such as --memory-debugging, --experimental-vision, --categoryNetworkMocks, --categoryExtensions, --experimentalDevtools, --categoryWebmcp, --categoryPwa and --categoryWebauthn. But the reference page presents all 63 without marking which ones a default install actually has, and the practical consequence is that people believe their agent has a smaller surface than the flag list suggests, or a bigger one than it does.

--slim deserves a sentence of its own. It is described as “Useful for basic browser tasks” and reduces the surface by 91%. The three tools it keeps are navigation, screenshots, and evaluate — arbitrary JavaScript in the page. If you reach for --slim as a hardening measure, you have removed 30 tools including the network inspector that shows you what the agent did, and kept the one capability that can do anything. The actual hardening flag is --no-javascript-evaluation, and even that one is honest about its limits: “This is not a JavaScript sandbox: page scripts and JavaScript triggered through other permitted browser interactions (e.g. clicks or typing) still run.”

The security policy is the best document in the repo

SECURITY.md is 64 lines and would be a useful read even if you never install this. It declines several things clearly rather than vaguely:

In general, it is the expectation that the AI agent or client using this MCP server validates any input (including tool calls and parameters) before sending it.

MCP clients typically use the opened workspace as the working directory for stdio servers; if you need to inspect untrusted repositories, run the server in an OS-level sandbox or a dedicated VM.

The server always retains access to the OS-provided tmp directory. We treat security issues in the MCP roots implementation as low-severity issues because it is an optional configuration.

The web content is returned as-is to facilitate debugging and we do not consider changes in the output text/Markdown structure based on the web content to be vulnerabilities. … Prefer using this server with trusted web content or make sure your client takes precautions against prompt injections.

That last paragraph is the one to sit with. The server’s central function is to bring untrusted web content into a model’s context, and the project’s position is that content shaping the model’s output is out of scope by design. Given that, the honest reading of the threat model is not “this tool is unsafe” — it is “this tool is a load-bearing part of your trust boundary, and the boundary is on your side of it”.

The Hacker News thread on the project (604 points, 234 comments) reached the same place from the outside. The clearest formulation is from commenter vinmay:

For something like Chrome DevTools MCP with authenticated browser sessions, the specific risk is credentials in the browser context + any SEND capability reachable from the same entry points. If a page can inject a prompt that triggers a tool call, and that call path can also reach outbound network I/O, you have an exfiltration vector without needing shell access at all.

Etheryte, higher in the same thread: “You’re literally one prompt injection away from someone having unlimited access to all of your everything.” And mh- gave the mitigation that this article’s testing independently supports: “I just use a separate, dedicated Chrome profile that isn’t logged into anything except what I’m working on.”

The thread also contains the strongest argument against the MCP shape itself. cheema33:

MCPs once configured cost you tokens even when they are not used. Unlike MCPs, skills use progressive disclosure. … MCPs will die off mostly for this reason alone.

flash_us0101 put a number on it: a five-server setup “consumes ~55K tokens in definitions before Claude does any work. Tool selection accuracy also degrades past 30-50 tools.” 33 tool definitions on every session is not free. Notably, the maintainers agree enough to have shipped a CLI: Paul Irish (paulirish) replied in-thread that “The DevTools MCP project just recently landed a standalone CLI… Great news to all of us keenly aware of MCP’s wild token costs.”

Which is the more useful distinction than the tribal one. For testing a page you already have assertions for, a headless Playwright script is cheaper and more deterministic — esperent’s “About 1-2k context per interaction after a bit of tuning” is the right order of magnitude. For diagnosing why a page misbehaves in a browser you are already logged into — source-mapped console stacks, live CSS rules, a parsed trace with LCP breakdown, heap snapshots — there is no scripting equivalent that is competitive, and that is the case this tool is actually built for.

Repository health

MetricValue (2026-11-15)
Stars56,306
Forks4,759 (8.5% of stars)
Watchers (subscribers_count)252 (0.45% of stars)
Open issues127
Created2025-09-11
Last push2026-11-13
Releases65, v0.1.0 (2025-09-16) → v1.13.0 (2026-11-11) = 1.08/week
npm downloads10,023,171 last month / 2,405,354 last week
LicenseApache-2.0

A 0.45% watcher-to-star ratio is normal for an official Google project — people star announcements and subscribe to nothing. The release cadence is the number that matters operationally: 1.08 releases per week means a pinned version goes stale in about a month, which is the tension behind the @latest recommendation. Pinning costs you maintenance; not pinning costs you the guarantee that the binary you audited is the binary that runs. There is no third option, and the project chose one for you in the quickstart.

A configuration that fails closed

This is the same server with the permissive defaults inverted. Every line costs a capability.

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp@1.13.0",
        "--headless=true",
        "--isolated=true",
        "--no-file-navigations",
        "--no-javascript-evaluation",
        "--redact-network-headers=true",
        "--no-performance-crux",
        "--no-usage-statistics",
        "--filesystem-root=/tmp/cdm-artifacts"
      ],
      "env": {
        "CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS": "1"
      }
    }
  }
}

What each one gives up, honestly:

FlagCapability you lose
@1.13.0 instead of @latestAutomatic updates; you bump it yourself
--isolated=trueLogins and sessions, every run
--no-file-navigationsInspecting local HTML fixtures via file:// — serve them over localhost instead
--no-javascript-evaluationevaluate_script, set_logpoints, initScript. 33 → 31 tools. Page scripts still run
--redact-network-headersSeeing actual auth header values when debugging auth
--no-performance-cruxField data in trace reports; lab data only
--no-usage-statisticsNothing
--filesystem-rootArtifacts outside the named directory
NO_UPDATE_CHECKSVersion notices

Set --filesystem-root to somewhere real. The default resolves to $TMPDIR, which in a container is frequently a mounted volume rather than an ephemeral one, and the server “always retains access” to it regardless of MCP roots.

FAQ

Does --no-javascript-evaluation make the browser safe? No, and the docs say so: page scripts and JS triggered by clicks or typing still run, and --experimentalDevtools opens a Console path that the flag does not restrict. It removes the caller-supplied script entry points. That is worth doing; it is not a sandbox.

Is my everyday Chrome profile at risk? Not by default. The server launches its own profile at ~/.cache/chrome-devtools-mcp/chrome-profile. --autoConnect, --browserUrl and --wsEndpoint let you attach to a running Chrome instead — including your real one — and at that point everything in this article gets worse, because the persistent cookie jar is your actual browsing session.

Does it send my page content to Google? Not in telemetry — strings are bucketed to lengths and URLs reduced to is_localhost. It does send trace URLs to the CrUX API by default, which is the thing to disable if you debug internal hosts.

Why did my screenshot to /tmp fail? Because the default root is $TMPDIR. Check echo $TMPDIR before assuming /tmp.

How do I stop the file:// path without losing the network inspector? --no-file-navigations. It is independent of --no-javascript-evaluation and of the filesystem roots.

Should a team use this or Playwright? Use Playwright for assertions you can write down and run in CI. Use this when the question is “why is this slow / broken in a live browser I am already logged into”, which is the case its tool set is shaped for. Running both in one repo is fine as long as the token cost is a deliberate choice.

What to verify yourself before adopting

Everything in this article came from running the server, because most of it cannot be read off the documentation:

  • What your default surface is. tools/list against your actual configuration. 33 tools is not what the reference page implies, and your client’s token budget cares.
  • Whether $TMPDIR is ephemeral in your environment. If it is a mounted volume, the default filesystem root is not a sandbox.
  • Whether your client sends MCP roots. If it does not, the server falls back to $TMPDIR regardless of your workspace — and --allow-unrestricted-paths should stay false.
  • Whether anything in your toolchain acts on update notices. If your agent reads stderr and follows instructions, a workspace .npmrc is a channel into it.
  • What header redaction actually covers. The docs say “some of the network headers considered sensitive” without enumerating them. Test Authorization and x-api-key on your own endpoints; I confirmed cookie and set-cookie are covered by the flag, and did not test beyond that.
  • Whether you can afford the context cost. 33 tool definitions load before the model does anything.

The project’s own conclusion is the right one, and it is not a criticism of the project: this is a local developer tool that “runs with the privileges of the user who starts it and trusts the environment it is started in”. If that environment includes code you did not write, the tool is the wrong layer to fix it. Give it a separate profile, a pinned version, and the flags above — then the honest remaining risk is the one SECURITY.md already told you about, which is that a web page can talk to your agent.