Chrome DevTools MCP: Handing the Plumber Your House Keys
Chrome DevTools MCP opens the browser console, network requests and performance traces to your coding agent. On a local PHP cart page, default settings also sent the session cookie and Authorization header to the model, and LCP went green on the heading, not the cart.
This post is also available in Turkish →
The kitchen tap is leaking, so you call a plumber. When he shows up, you don't hand him a wrench. You hand him the whole key ring. He can get into the kitchen, and he can also open the drawer in the bedroom. He doesn't have to be a crook for that to matter; the keys simply let him in.
Chrome DevTools MCP is that key ring. Built for AI agent browser debugging, it gives your coding agent a browser's eyes: it reads the console, opens network requests, records performance traces and clicks around the page. It comes from Google's Chrome DevTools team, has 54.7k stars on GitHub, and version 1.13.0 shipped on November 11, 2026. I ran it against a small local PHP cart page to see what the agent actually gets to see. With default settings, that included the session cookie and the Authorization header.
What is Chrome DevTools MCP?#
In one sentence: a server that lets an agent drive a real Chrome through Puppeteer and read DevTools data as MCP tools. The launch post (Mathias Bynens and Michael Hablich, Sep 23, 2025) states the problem plainly: agents can't see what the code they generate actually does once it runs in the browser.
Setup is one line in most clients. The commands come from the client configuration guide; the flags at the end are my additions, explained below:
# Claude Code
claude mcp add chrome-devtools --scope user npx chrome-devtools-mcp@latest --isolated --redactNetworkHeaders --no-performance-crux --no-usage-statistics
# OpenAI Codex
codex mcp add chrome-devtools -- npx chrome-devtools-mcp@latest --isolated --redactNetworkHeaders --no-performance-crux --no-usage-statistics
# Gemini CLI
gemini mcp add chrome-devtools npx chrome-devtools-mcp@latest --isolated --redactNetworkHeaders --no-performance-crux --no-usage-statistics
Cursor adds it from the MCP screen in settings, Antigravity through a JSON config; the Antigravity guide points the server at the editor's built-in browser with --browser-url. Node.js needs to be ^20.19, ^22.12 or 23+.
What the test bench looked like#
I installed 1.13.0 in a cloud sandbox and talked to the MCP server directly over JSON-RPC, not through an agent. The browser was Playwright's Chromium 153 (--executablePath). Note up front that the project officially supports only Chrome and Chrome for Testing. The page ran on PHP 8.3.6's built-in server: a cart page that sets a session cookie with session_start(), a fetch that loads the table with an Authorization: Bearer ... header, and a small api.php that waits 800 ms before returning JSON.
From the agent's side:
tools/listreturned 33 tools, and their JSON definitions weigh 32,302 bytes. With--slimyou get 3 tools (navigate,evaluate,screenshot) and 1,201 bytes. Those definitions land in context every session; in the context-mode review we argued about what reaches the agent's desk, and here the first thing on the desk is the toolbox catalogue.wait_forwaited for the text "Defter" (Turkish for notebook, one of the cart rows) and found it in 697 ms. With Moli we got an empty table back with exit code 0; here the wait really does wait for the data.list_console_messagescaught the favicon 404 and nothing else. "Is the console clean?" stops being a guess.
What's on the key ring?#
The drawer: headers and cookies#
The problem: I opened the api.php request with get_network_request. With default settings it returned authorization:Bearer gizli-anahtar-123 and cookie:PHPSESSID=... verbatim, and the page request carried set-cookie too. All of it in the text that goes to the model.
The fix, partly: with --redactNetworkHeaders the same lines came back as <redacted>. The flag defaults to false.
The catch: redaction covers headers only. The same call returns the page's response body, and the Bearer gizli-anahtar-123 sitting in the inline JavaScript showed up untouched. Then I had evaluate_script read document.cookie, and the session ID came back. Hiding the header doesn't lock the drawer.
The cookie part is fixed in PHP:
<?php
declare(strict_types=1);
// Oturum çerezini JavaScript'in (ve sayfada script çalıştıran ajanın) gözünden sakla
session_start([
'cookie_httponly' => true,
'cookie_samesite' => 'Lax',
'cookie_secure' => ($_SERVER['HTTPS'] ?? '') === 'on',
'use_strict_mode' => true,
]);
(The comment says: keep the session cookie out of sight of JavaScript, and of any agent running scripts on the page.) With this, Set-Cookie gained HttpOnly; SameSite=Lax and the same evaluate_script call returned an empty string. To switch script execution off entirely, --no-javascript-evaluation drops the tool count from 33 to 31 (evaluate_script and set_logpoints go away). No flag helps with a key baked into the front end, though; that key is already in every visitor's browser. Vibe Coder #5.3 covered the password-in-code mine; this is the same mine, browser edition.
The front door: where can it go?#
Started with --allowedUrlPattern 'http://127.0.0.1:8099/*', the local page opened and a request for https://halityesil.com/ failed with "blocked by blocklist/allowlist rules". The flag needs Chrome 149 or later. It's the cheapest lock there is for keeping a staging agent out of the production admin.
What goes next door: CrUX and usage statistics#
Detail: the README says two things clearly. Performance tools may send trace URLs to Google's CrUX API for real-user data (turn off with --no-performance-crux). Usage statistics collection is on by default (turn off with --no-usage-statistics; it switches off automatically when the CI environment variable is set). If your staging URL shouldn't leave the building, keep both flags in the config.
The landlord's keys: profile and --autoConnect#
The default profile lives under $HOME/.cache/chrome-devtools-mcp/chrome-profile and persists, so an admin login from one session carries into the next. --isolated creates a temporary profile and deletes it on close. --autoConnect attaches to your own Chrome (144+) once remote debugging is enabled. I didn't test that one, but per the docs the agent then sees whatever sessions you have open. Connecting your daily Chrome isn't handing the plumber the house keys. It's handing him your wallet.
What did the performance trace measure?#
I reloaded the page under performance_start_trace (with --no-performance-crux). Two runs gave an LCP of 89 and 93 ms, and performance_analyze_insight reported the LCP element as the H1 heading. The cart rows arrive only after the 800 ms API call. So the trace is green while the customer is looking at an empty table. The measurement is right; the question was incomplete. The tap runs, but you have to ask separately whether the hot water arrived. If an agent's report only quotes LCP, add a wait_for step on the real content and check the API timing in the network list.
A side note: on the first try PHP's built-in server ran a single worker, the previous page's 800 ms request was still in line, and TTFB showed 593 ms. With PHP_CLI_SERVER_WORKERS=4 it dropped to 3 ms. The agent doesn't interpret that for you; if you read the trace, account for the test server too.
Who it's for, and who it isn't#
Good fit: verifying an agent's front-end fix in a real browser, reading console and network errors instead of guessing, running Lighthouse and performance traces on staging automatically. Seeing a request's headers and body saves real time when chasing CORS problems and 401s.
Poor fit: a browser with a production session open, a front end carrying secrets, and an agent that decides "LCP is fine, so the page is ready". You also don't need a 33-tool catalogue for everything; --slim covers plain navigation and screenshots.
Quick comparison#
| Tool | What it gives you | License / version (Nov 17, 2026) | When |
|---|---|---|---|
| Chrome DevTools MCP | Console, network, performance traces, Lighthouse, automation | Apache-2.0, 1.13.0 (Nov 11, 2026) | Letting an agent read front-end errors and performance |
| Playwright MCP (Microsoft) | Browser automation over the accessibility tree | Apache-2.0, 0.0.85 (Nov 9, 2026) | Flow testing, multiple browser engines |
| Moli | Lightweight page reading without Chromium | Apache-2.0 / MIT | Text extraction, low resources |
| Lighthouse CLI | Audit reports without an agent | Apache-2.0, 13.6.0 | Fixed-threshold checks in CI |
Maintenance and credit#
The repository, ChromeDevTools/chrome-devtools-mcp, belongs to Google's Chrome DevTools team. The npm package's maintainers include Mathias Bynens and Alex Rudenko. The first npm release was May 13, 2025; between June 8 and November 11, 2026, thirteen releases went out, from 1.2.0 to 1.13.0. As of November 17, 2026 the repo has 54.7k stars, 83 open issues and 49 open pull requests. The server prints its own warning at every start: browser content is exposed to the MCP client, so don't put anything there you wouldn't share with it.
Handing over the keys#
Calling the plumber isn't the mistake; it beats hunting for the leak by guesswork. The mistake is handing over the whole key ring at the door. My suggested config: --isolated, --redactNetworkHeaders, --no-performance-crux, --no-usage-statistics, --allowedUrlPattern for staging, and HttpOnly on the session cookie. None of those are defaults.
Give the agent the eyes. Keep the drawer key in your pocket.
Comments
0 comments
Leave a comment