Chrome DevTools Developer Training & Resource Guide
What is Chrome DevTools?
Manual panels + CDP + the chrome-devtools MCP — verify in a real browser, gate on CWV.
Three faces: the panels (F12) for hands-on debugging; CDP for automation (`Network.emulateNetworkConditions`, `Emulation.setCPUThrottlingRate`); and `chrome-devtools-mcp` 1.11.0 (Google's "DevTools for agents", Apache-2.0) so Claude Code drives a real Chrome — snapshot the a11y tree, read console/network, record traces with `performance_start_trace`, and run `lighthouse_audit` for a11y/SEO (it does not score performance). The scoreboard is Core Web Vitals at the 75th percentile: LCP ≤2.5s, INP ≤200ms (replaced FID in 2024), CLS ≤0.1. For codeAmani, test with Slow 4G + 4× CPU + Disable-cache by default (add 3G for Kenya-targeted projects) and gate PRs on LCP/CLS via Lighthouse CI.
Six core surfaces
The panels you live in plus the agent surface that drives them. Tap a card for the shortcuts + gotchas.
Will it survive 3G? — Core Web Vitals playground
Pick a connection, then drag page weight, server time, and render-blocking resources. Watch TTFB / FCP / LCP shift against the official budgets and the request waterfall stretch. This is the test codeAmani runs before shipping: Slow 4G by default, and 3G for Kenya-targeted projects. If it’s slow on the link your users have, it’s slow for them.
The green content transfer bar is what page weight inflates. On a slow link, a heavy bundle pushes LCP past the 2.5s budget — that's why splitting + lazy-loading matters.
Thresholds are exact/official (web.dev/articles/vitals). Connection bandwidth/RTT are representative — DevTools intentionally doesn’t publish exact preset values; the load model here is illustrative. Measure real numbers in the Performance panel, Lighthouse, or the web-vitals library.
██████╗██╗ ██╗██████╗ ██████╗ ███╗ ███╗███████╗
██╔════╝██║ ██║██╔══██╗██╔═══██╗████╗ ████║██╔════╝
██║ ███████║██████╔╝██║ ██║██╔████╔██║█████╗
██║ ██╔══██║██╔══██╗██║ ██║██║╚██╔╝██║██╔══╝
╚██████╗██║ ██║██║ ██║╚██████╔╝██║ ╚═╝ ██║███████╗
╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
██████╗ ███████╗██╗ ██╗████████╗ ██████╗ ██████╗ ██╗ ███████╗
██╔══██╗██╔════╝██║ ██║╚══██╔══╝██╔═══██╗██╔═══██╗██║ ██╔════╝
██║ ██║█████╗ ██║ ██║ ██║ ██║ ██║██║ ██║██║ ███████╗
██║ ██║██╔══╝ ╚██╗ ██╔╝ ██║ ██║ ██║██║ ██║██║ ╚════██║
██████╔╝███████╗ ╚████╔╝ ██║ ╚██████╔╝╚██████╔╝███████╗███████║
╚═════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝Chrome DevTools Developer Training & Resource Guide
Focus: Everything a developer can do with Chrome DevTools: the panels, the Chrome DevTools Protocol (CDP), the
chrome-devtools-mcpserver for Claude Code / Cursor / VS Code, Core Web Vitals budgets, and testing with Playwright, Puppeteer and Lighthouse CI. Grounded indeveloper.chrome.com,web.dev, the official MCP repo at tagchrome-devtools-mcp-v1.11.0, and the Claude Code MCP docs. Reviewed 2026-10-20.
Pinned versions in this guide (from npm view, 2026-10-20):
| Package | Version | Notes |
|---|---|---|
chrome-devtools-mcp | 1.11.0 (2026-10-15) | Node ^20.19.0 || ^22.12.0 || >=23; ships the chrome-devtools-mcp and chrome-devtools (CLI) binaries |
puppeteer | 25.14.0 | Same version the MCP server is built on |
playwright / @playwright/test | 1.64.1 | |
lighthouse | 13.5.0 | Adds the "Agentic Browsing" category (13.3.0+) |
web-vitals | 6.2.3 | |
@lhci/cli | 0.15.1 | |
| Chrome stable | 155 to 156 | 156.0.8078.36 was rolling out on 2026-10-20 |
How to use this guide
DevTools has three faces. Learn them in this order:
- The panels (manual): Part 1. What you open with F12 / Cmd+Opt+I to inspect, debug and profile by hand.
- The protocol (scriptable): Part 3. Everything the UI does, exposed as a WebSocket API that Playwright, Puppeteer, Lighthouse and the MCP all build on.
- The agent surface (Claude Code): Part 4.
chrome-devtools-mcplets an agent drive a real browser to verify your work.
The interactive learn module above this page is a live Core Web Vitals + network-throttle playground. Start there to build intuition, then use the reference below.
Overview
Chrome DevTools is the browser's built-in inspection, debugging and profiling suite. Under the UI sits the Chrome DevTools Protocol (CDP), a JSON-over-WebSocket API that exposes the same capabilities to automation. chrome-devtools-mcp (Google LLC, Apache-2.0) wraps a Puppeteer-driven Chrome as an MCP server so a coding agent can navigate, click, screenshot, read the console and network, record performance traces, run Lighthouse and analyse heap snapshots. Google's docs now call it "Chrome DevTools for agents"; it went stable in Chrome 149 (June 2026). It is the practical way to test in a browser before claiming done.
Official Documentation
| Resource | URL |
|---|---|
| Chrome DevTools docs | https://developer.chrome.com/docs/devtools |
| What's new in DevTools (monthly since Sept 2026) | https://developer.chrome.com/docs/devtools/news |
| Chrome DevTools Protocol (CDP) | https://chromedevtools.github.io/devtools-protocol/ |
| chrome-devtools-mcp repo | https://github.com/ChromeDevTools/chrome-devtools-mcp |
| MCP tool reference | https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md |
| MCP configuration (all flags) | https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/configuration.md |
| MCP troubleshooting | https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/troubleshooting.md |
| Web Vitals | https://web.dev/articles/vitals |
| Playwright | https://playwright.dev/docs/intro |
| Puppeteer | https://pptr.dev |
| Lighthouse CI | https://github.com/GoogleChrome/lighthouse-ci |
Part 1 — The DevTools panels
Open DevTools with F12, Cmd+Opt+I (macOS) or Ctrl+Shift+I (Windows/Linux). The Command Menu (Cmd/Ctrl+Shift+P) jumps to any panel or action by name, and is the most useful single shortcut.
| Panel | What it's for | Reach for it when… |
|---|---|---|
| Elements | Inspect and edit the live DOM and CSS (the Styles pane) | Tweaking layout, debugging CSS specificity, checking computed styles |
| Console | Log output plus a live JS REPL against the page | Reading errors, poking at window/page state, quick scripting |
| Sources | View files, set breakpoints, step through JS, edit and save (Workspaces) | Debugging logic, watching variables, ignore-listing scripts |
| Network | Every request and response, timing, headers, throttling | Checking payload size, caching, CORS, slow-connection behaviour |
| Performance | Record a trace of main-thread work; Live Metrics for Core Web Vitals; Insights | Diagnosing jank, long tasks, layout thrash, slow LCP, soft navigations |
| Memory | Heap snapshots and allocation timelines | Hunting memory leaks and detached DOM nodes |
| Application | Storage (localStorage, IndexedDB, cookies), Service Workers, Cache, manifest, Ads | Debugging PWAs, auth cookies, offline behaviour, ad cost |
| Lighthouse | One-click audit: Performance, Accessibility, Best Practices, SEO, Agentic Browsing | A scored baseline plus prioritised fixes |
| Recorder | Record, replay and measure a user flow; export to Puppeteer/Playwright | Turning a manual flow into a repeatable test |
| Privacy and security | Certificates, mixed content, third-party cookie controls | Verifying a page is fully HTTPS and cookie-clean |
| Rendering (drawer) | Paint flashing, FPS meter, emulate prefers-color-scheme and other media features | Spotting unnecessary repaints, testing dark mode |
| Coverage (drawer) | Unused JS/CSS per file | Trimming dead code from the bundle |
| Issues / Changes / Animations / Sensors / WebAuthn | Aggregated warnings · CSS diff · animation timeline · geolocation/orientation emulation · authenticator emulation | Targeted debugging of each concern |
Open drawer tools with Esc, then the ⋮ menu > More tools, or through the Command Menu.
Elements + Styles — DOM & CSS
Inspect Cmd/Ctrl+Shift+C, then click an element
Edit DOM double-click a node / press F2
Force state :hov → toggle :hover/:focus/:active to debug states
Color click a swatch in Styles for the eyedropper + contrast ratio
Specificity hover a selector to see its specificity breakdown (Chrome 151+)
Inactive rules that matched earlier but no longer apply can stay visible,
marked inactive (Settings, Chrome 153/154)The contrast ratio readout in the colour picker is the fastest accessibility check. It flags AA/AAA pass or fail inline.
Console — REPL + logging
// $0 is the currently-selected Elements node; $$ is querySelectorAll
$0.getBoundingClientRect();
$$('img:not([alt])'); // find images missing alt text
monitorEvents($0, 'click'); // log events on an element
copy(JSON.stringify(window.__DATA__)); // copy a value to clipboard
console.table(performance.getEntriesByType('resource')); // request tableSources — the debugger
Breakpoint click a line number
Conditional bp right-click a line → "Add conditional breakpoint"
Logpoint inject a console.log without editing source
DOM breakpoint Elements → right-click → "Break on" → subtree/attribute change
Step F10 over · F11 into · Shift+F11 out · F8 resumeNetwork — payload & throttling
Throttling presets (Chrome 127+): Offline · 3G · Slow 4G · Fast 4G · Custom
("Slow 3G" was renamed "3G" and "Fast 3G" became "Slow 4G" in Chrome 127.
DevTools does not publish exact kbps; the presets track real-world data.)
Per-request throttling throttle a single request (Chrome 144+)
Disable cache tick the box (while DevTools is open) to test cold loads
Filter larger-than:500k -domain:*.google.com mixed-content:all
Copy as cURL right-click a request → reproduce it from the terminal
(the "cmd" variant now caret-escapes for Windows cmd.exe)
Edit and resend right-click → "Edit and resend as fetch" opens the Console
with a ready fetch() call (Chrome 153/154)codeAmani habit: test every page with Disable cache on and the Slow 4G preset. For Kenya-targeted projects, test under 3G as well. If LCP goes past 2.5s, the bundle is too heavy for that connection: lazy-load and split before shipping.
Performance — traces & Core Web Vitals
Live Metrics open the panel: local LCP / CLS / INP update as you use the page
Record click ● (or Cmd/Ctrl+E) → interact → stop
Reload trace click ⟳ to capture a full page load
Read it Main track = JS/layout/paint; red-cornered bars = long tasks (>50ms)
Insights sidebar lists LCP breakdown, render-blocking requests, etc.
CPU calibrated CPU throttling presets (Chrome 134+)
Soft navs SPA route changes are measured end to end (Chrome 152 to 154)Application — storage & PWAs
Service Workers update-on-reload, bypass-for-network, push test
Storage localStorage / sessionStorage / IndexedDB / Cookies (edit inline,
including cookie flags)
Clear storage one button to reset to a first-visit state
Manifest installability + icon/colour validation for PWAs
Ads ad density, ad CPU/network cost, ad scripts table (Chrome 153/154)Device Mode
Cmd/Ctrl+Shift+M toggles device emulation. Since the October 2026 release the presets are grouped as Mobile, Foldables, Tablets & Desktops and Smart Displays, with current devices such as Pixel 9/10, iPhone 16 and Galaxy Z Fold 6. Emulation changes viewport, DPR, touch and user agent. It does not reproduce a real phone's GPU, radio or thermal limits.
Part 2 — Core Web Vitals & performance budgets
These are the scores for real-user performance. Thresholds are measured at the 75th percentile of page loads, split by mobile and desktop (source: web.dev/articles/vitals).
| Metric | Measures | Good | Needs improvement | Poor |
|---|---|---|---|---|
| LCP: Largest Contentful Paint | Loading | ≤ 2.5 s | 2.5 – 4.0 s | > 4.0 s |
| INP: Interaction to Next Paint | Interactivity | ≤ 200 ms | 200 – 500 ms | > 500 ms |
| CLS: Cumulative Layout Shift | Visual stability | ≤ 0.1 | 0.1 – 0.25 | > 0.25 |
INP replaced FID as a Core Web Vital in March 2024. It measures the latency of all interactions, not just the first.
Supporting diagnostics:
| Metric | Good threshold | Helps explain |
|---|---|---|
| FCP: First Contentful Paint | ≤ 1.8 s | LCP |
| TTFB: Time to First Byte | ≤ 0.8 s | FCP / LCP |
Measure vitals in code (field data)
npm install web-vitals@6.2.3import { onLCP, onINP, onCLS, type Metric } from "web-vitals";
// Field data: report from real users to your own endpoint
const send = (m: Metric) => navigator.sendBeacon("/api/vitals", JSON.stringify(m));
onLCP(send);
onINP(send);
onCLS(send);A fuller version with FCP/TTFB and a fetch fallback is in examples/web-vitals-field.ts.
Lab vs field: DevTools, Lighthouse and the MCP give you lab data (one synthetic run). web-vitals plus analytics give you field data (real users, the 75th percentile that counts). The MCP's performance trace also pulls CrUX field data for public URLs (see Privacy). Optimise in the lab, then verify in the field.
Part 3 — Chrome DevTools Protocol (CDP)
Everything the UI does is a CDP command, and Playwright, Puppeteer, Lighthouse and the MCP all use it. Start Chrome with a debugging port and you can drive it from any of them:
# Launch Chrome with the protocol exposed. Chrome requires a NON-default
# --user-data-dir when remote debugging is on.
google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug --headless=new
# List targets (tabs); each has a webSocketDebuggerUrl
curl http://127.0.0.1:9222/json# Windows
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="$env:TEMP\chrome-debug"// Raw CDP through Puppeteer's session: slow network + 4x CPU slowdown
import puppeteer from "puppeteer";
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
const client = await page.createCDPSession();
await client.send("Network.emulateNetworkConditions", {
offline: false,
latency: 150,
downloadThroughput: (1.6 * 1024 * 1024) / 8,
uploadThroughput: (750 * 1024) / 8,
});
await client.send("Emulation.setCPUThrottlingRate", { rate: 4 });Domains you'll use most: Page, Network, Runtime, Performance, Emulation, DOM, Accessibility. New in Chrome 153/154: Emulation.setCPUPerformanceOverride for calibrated, reproducible CPU tiers. Full reference: chromedevtools.github.io/devtools-protocol.
Security: an open debugging port lets any local process control that browser. Use a throwaway
--user-data-dir, never your daily profile, and don't browse sensitive sites while the port is open.
Part 4 — chrome-devtools-mcp (DevTools for agents)
The official chrome-devtools-mcp server (Google LLC, Apache-2.0; 1.11.0, released 2026-10-15) runs a Puppeteer-controlled Chrome and exposes it as MCP tools. Release cadence is roughly every two to four weeks (1.7.0 Aug 10 → 1.8.0 Aug 25 → 1.9.0 Sep 8 → 1.10.0/1.10.1 Sep 23 → 1.11.0 Oct 15).
Requirements: Node.js LTS that satisfies ^20.19.0 || ^22.12.0 || >=23; Chrome current stable or newer (Chrome and Chrome for Testing are the only officially supported browsers); npm.
Setup — Claude Code
Pick one of these two methods. Installing both gives you two servers fighting over one Chrome profile.
A. Plugin (MCP server + skills). This is what the codeAmani machine uses (chrome-devtools-mcp@claude-plugins-official). It bundles skills: chrome-devtools, a11y-debugging, debug-optimize-lcp, memory-leak-debugging, cookie-debugging, chrome-devtools-cli and troubleshooting.
/plugin marketplace add ChromeDevTools/chrome-devtools-mcp
/plugin install chrome-devtools-mcp@chrome-devtools-pluginsRestart Claude Code, then check with /skills and /mcp. The plugin pins the server version (1.11.0 runs npx --prefix ${PLUGIN_DATA} chrome-devtools-mcp@1.11.0), and its MCP server shows up as plugin:chrome-devtools-mcp:chrome-devtools.
B. CLI (MCP server only).
claude mcp add chrome-devtools --scope user -- npx -y chrome-devtools-mcp@latestProject-scoped .mcp.json (committed, shared with the team). The full file is in examples/mcp-config.json:
{
"mcpServers": {
"chrome-devtools": {
"type": "stdio",
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@1.11.0", "--isolated", "--no-usage-statistics"]
}
}
}Pin a version (@1.11.0) in shared project config so everyone runs the same tool surface. Use @latest only in personal, user-scoped config.
Setup — Cursor and VS Code
| Client | How |
|---|---|
| Cursor | Cursor Settings → MCP → New MCP Server, paste the standard config (npx -y chrome-devtools-mcp@latest), or use the "Install in Cursor" deeplink in the repo's docs/client-configurations.md |
| VS Code / Copilot | Recommended: Command Palette → Chat: Install Plugin From Source → ChromeDevTools/chrome-devtools-mcp (server + skills). MCP only: code --add-mcp '{"name":"io.github.ChromeDevTools/chrome-devtools-mcp","command":"npx","args":["-y","chrome-devtools-mcp"],"env":{}}' |
| VS Code on Windows (PowerShell) | Escape the quotes as the repo shows: code --add-mcp '{"""name""":"""io.github.ChromeDevTools/chrome-devtools-mcp""","""command""":"""npx""","""args""":["""-y""","""chrome-devtools-mcp"""]}' |
| Codex / Gemini CLI / Grok Build / others | See the repo's docs/client-configurations.md (about 25 clients listed) |
First prompt to confirm it works: Check the performance of https://developers.chrome.com. The server only launches Chrome when a tool first needs a browser. Connecting the MCP server alone does not open a window.
Tools (1.11.0)
The tool reference lists 59 tools. A default install exposes 32 (confirmed with a live tools/list on 2026-10-20). The others sit behind flags.
| Group | Default tools | Behind a flag |
|---|---|---|
| Input (10) | click · drag · fill · fill_form · handle_dialog · hover · press_key · type_text · upload_file | click_at (x,y): --experimentalVision |
| Navigation (6) | new_page · navigate_page · list_pages · select_page · close_page · wait_for | |
| Emulation (2) | emulate · resize_page | |
| Performance (3) | performance_start_trace · performance_stop_trace · performance_analyze_insight | |
| Network (2) | list_network_requests · get_network_request | |
| Debugging (9) | take_snapshot · take_screenshot · evaluate_script · list_console_messages · get_console_message · get_css_styles · lighthouse_audit · screencast_start · screencast_stop | |
| Memory (14) | take_heapsnapshot | the 13 analysis tools (compare_heapsnapshots, get_heapsnapshot_summary/dominators/retainers/retaining_paths/edges/details/class_nodes/object_details/duplicate_strings, query_heapsnapshot_objects, analyze_heapsnapshot_contexts, close_heapsnapshot): --memoryDebugging |
| Extensions (5) | install_extension · list_extensions · reload_extension · trigger_extension_action · uninstall_extension: --categoryExtensions | |
| PWA (4) | install_pwa · launch_pwa · uninstall_pwa · get_os_app_state: --categoryPwa (launched-browser/pipe mode only) | |
| Third-party (2) | list_3p_developer_tools · execute_3p_developer_tool: --categoryExperimentalThirdParty | |
| WebMCP (2) | list_webmcp_tools · execute_webmcp_tool: --categoryExperimentalWebmcp (Chrome 150+ with --enable-features=WebMCP) |
--slim replaces all of this with 3 tools (navigate, evaluate, screenshot) for basic browsing at minimal context cost.
Changes since the August guide (1.7.0), and corrections to it:
- Page-ID routing is on by default (1.8.0). Every page-scoped tool now requires
pageId. Get it fromnew_page/list_pages.--no-page-id-routingrestores "selected page" behaviour. lighthouse_auditdoes not score performance (the August guide was wrong about this). It covers accessibility, SEO, best practices and agentic browsing, and returns failing audits plus the DOM nodes they flag. Params:device(desktop/mobile),mode(navigationreloads,snapshotaudits the current state),outputDirPath. For performance, useperformance_start_trace.performance_start_tracetakesreload,autoStop,ignoreCache(cold load, new in 1.11.0) andfilePath(savetrace.json.gz). Results list "insight sets". Drill in withperformance_analyze_insight(insightSetId, insightName), for exampleinsightName: "LCPBreakdown"or"DocumentLatency".- Screencasts are on by default and no longer need ffmpeg (1.11.0).
--experimentalScreencastnow means "use the legacy ffmpeg recorder" and is deprecated. emulatetakesnetworkConditions(Offline,Slow 3G,Fast 3G,Slow 4G,Fast 4G, the Puppeteer preset names rather than the DevTools UI names),cpuThrottlingRate,viewport("412x915x2.625,mobile,touch"),geolocation,userAgent,colorScheme,extraHttpHeaders, and the media featuresprefersReducedMotion,prefersContrastandforcedColors(1.11.0). Each call replaces all previous emulation settings, so pass everything in one call.wait_forwaits for text (text: ["Dashboard"]), not a CSS selector.evaluate_scripttakesfunction(a function declaration such as() => document.title) orsourcePath(a local.jsfile, new in 1.11.0), plusformat,args(elementuids from a snapshot),serviceWorkerIdandfilePath.get_css_styles(1.10.0) returns the matched cascade for a snapshotuid, with overridden declarations marked[overloaded].list_console_messagescan include source-mapped stack traces (includeStackTraces) and preserved messages from the last 3 navigations.
take_snapshotreturns the accessibility tree with auidper element. Use it to locate elements by role and name instead of brittle CSS selectors, and prefer it over screenshots: it costs far fewer tokens. Tool names change between releases, so check the live list with/mcpafter upgrading.
Key server flags
All flags also work as camelCase keys in a JSON config file (--config <path>, or auto-discovered at %LOCALAPPDATA%\Google\cd4a\config.json on Windows and ~/.config/cd4a/config.json on macOS/Linux; 1.11.0). Command-line flags override the file.
| Flag | Default | Use it for |
|---|---|---|
--headless | false | No window. Use in CI or when you don't need to watch |
--isolated | false | Temporary profile, deleted on close. Use for parallel sessions or a clean slate |
--userDataDir <dir> | %USERPROFILE%\.cache\chrome-devtools-mcp\chrome-profile | Persistent profile. Only one browser can use it at a time |
--channel stable|beta|dev|canary | stable | Test against a newer Chrome |
--executablePath <path> / -e | auto | Point at a specific Chrome binary. There is no CHROME_PATH env var; use this flag |
--browserUrl http://127.0.0.1:9222 / -u | Attach to a Chrome you started with --remote-debugging-port | |
--wsEndpoint ws://… + --wsHeaders | Attach over a raw WebSocket (with auth headers) | |
--autoConnect | false | Attach to your running Chrome 144+ after enabling it at chrome://inspect/#remote-debugging |
--viewport 1280x720 | Initial window size (headless max 3840x2160) | |
--slim | false | 3-tool minimal mode |
--memoryDebugging | false | The 13 heap-analysis tools |
--experimentalVision | false | click_at(x, y) for computer-use models |
--categoryExtensions / --categoryPwa / --categoryExperimentalThirdParty / --categoryExperimentalWebmcp | false | Opt-in tool groups |
--category<Input|Navigation|Emulation|Performance|Network|Debugging|Memory>=false | true | Drop a whole group to save context |
--no-usage-statistics | stats on | Opt out of Google's usage telemetry (also off when CI is set) |
--no-performance-crux | CrUX on | Stop sending trace URLs to the CrUX API |
--no-javascript-evaluation | eval on | Disable evaluate_script, initScript and javascript:/data: navigations (not a sandbox) |
--no-file-navigations | allowed | Reject file: URLs (1.11.0) |
--allowedUrlPattern / --blockedUrlPattern | Restrict which URLs the browser may load (allow-list needs Chrome 149+) | |
--redactNetworkHeaders | false | Redact sensitive headers in network tool output |
--acceptInsecureCerts | false | Self-signed local HTTPS (use with care) |
--screenshotFormat jpeg|webp + --screenshotMaxWidth | png / none | Smaller screenshots, which means fewer image tokens |
--filesystemRoot <dir> (alias --workspace) | OS temp dir | Where file-writing tools (traces, screenshots, heap snapshots) may write when the client doesn't send MCP roots |
--logFile <path> | Debug log. Combine with the NODE_DEBUG env var set to * | |
--proxyServer, --chromeArg, --ignoreDefaultChromeArg | Pass-through Chrome launch options |
Run npx chrome-devtools-mcp@1.11.0 --help for the authoritative list.
The chrome-devtools CLI (experimental)
The same package ships a terminal CLI that talks to a background daemon (named pipes on Windows). It is useful for scripting, and for checking the server works without an MCP client:
npm i -g chrome-devtools-mcp@1.11.0
chrome-devtools status
chrome-devtools new_page "http://localhost:3000"
chrome-devtools take_screenshot 1 --filePath shot.png
chrome-devtools lighthouse_audit 1 --mode snapshot
chrome-devtools stopThe CLI defaults to headless, isolated and unrestricted filesystem access. Pass --workspace=<dir> to chrome-devtools start to confine it.
Privacy, telemetry and security defaults
- Usage statistics are on by default (tool success rates, latency, environment). Opt out with
--no-usage-statistics. They are also off whenCHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICSorCIis set. - CrUX lookups are on by default. Performance tools may send trace URLs to Google's CrUX API to fetch field data. Use
--no-performance-cruxfor internal or staging URLs you don't want to leave the machine. - Update checks hit the npm registry. Disable with
CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS. - The agent can read everything in that browser profile: cookies, storage, open tabs. Use
--isolatedor a dedicated profile. Never point--autoConnectat a browser that is signed into production admin consoles. - Keep the config file out of the agent's write path. It can set
executablePath,chromeArgand URL allow-lists.
Part 5 — Claude Code workflows
Skill: visual + accessibility + performance check
Custom slash commands are now skills. Save this as .claude/skills/browser-check/SKILL.md (an existing .claude/commands/browser-check.md still works) and invoke it with /browser-check http://localhost:3000/dashboard:
---
name: browser-check
description: Load a URL in Chrome via the chrome-devtools MCP and report layout, a11y, performance and console problems.
---
Check $ARGUMENTS in a real browser using the chrome-devtools MCP tools.
1. `new_page` with url $ARGUMENTS; note the returned pageId and pass it to every call below.
2. `emulate` with viewport "412x915x2.625,mobile,touch", networkConditions "Slow 4G", cpuThrottlingRate 4.
3. `take_screenshot`, then `take_snapshot` (a11y tree).
4. `performance_start_trace` with reload true, autoStop true, ignoreCache true.
Report LCP, CLS and INP against the budgets (LCP <= 2.5 s, CLS <= 0.1, INP <= 200 ms)
and drill into the worst insight with `performance_analyze_insight`.
5. `lighthouse_audit` with device "mobile" (accessibility, SEO, best practices, agentic browsing).
6. `list_console_messages` with types ["error", "warn"] and includeStackTraces true.
7. `close_page`.
Report: layout/contrast issues, perf vs budget, failing Lighthouse audits with their DOM nodes,
console errors with likely fixes.The plugin's bundled debug-optimize-lcp and a11y-debugging skills cover the same ground in more depth.
Hook: nudge a browser check after a UI change
Hooks receive JSON on stdin (there is no $CLAUDE_TOOL_INPUT variable). .claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.file_path // empty' | grep -qE '\\.(tsx|jsx|css)$' && echo 'UI file changed: verify with /browser-check before claiming done' || true"
}
]
}
]
}
}Playwright — E2E tests
npm init playwright@latest
npx playwright test --ui # interactive runner
npx playwright codegen <url> # record a test by clicking
npx playwright show-trace trace.zip// tests/auth.spec.ts
import { test, expect } from "@playwright/test";
test("user can sign in", async ({ page }) => {
await page.goto("/login");
await page.getByLabel("Email").fill("test@example.com");
await page.getByLabel("Password").fill("placeholder-password");
await page.getByRole("button", { name: "Sign in" }).click();
await expect(page).toHaveURL("/dashboard");
await expect(page.getByRole("heading", { level: 1 })).toContainText("Welcome");
});
test("renders within a slow-network budget", async ({ page }) => {
const client = await page.context().newCDPSession(page);
await client.send("Network.emulateNetworkConditions", {
offline: false,
latency: 300,
downloadThroughput: (400 * 1024) / 8,
uploadThroughput: (400 * 1024) / 8,
});
const t0 = Date.now();
await page.goto("/", { waitUntil: "load" });
expect(Date.now() - t0).toBeLessThan(8000); // hard ceiling on a slow link
});CDP sessions are Chromium-only in Playwright.
Puppeteer — scripted browser
import puppeteer, { PredefinedNetworkConditions } from "puppeteer";
// headless: true IS the new headless mode; "shell" is the legacy headless shell.
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.emulateNetworkConditions(PredefinedNetworkConditions["Slow 3G"]);
await page.emulateCPUThrottling(4);
await page.goto("https://example.com", { waitUntil: "networkidle0" });
await page.screenshot({ path: "shot.png", fullPage: true });
await browser.close();puppeteer.networkConditions no longer exists in Puppeteer 25. Import PredefinedNetworkConditions instead (keys: Slow 3G, Fast 3G, Slow 4G, Fast 4G). A runnable LCP/CLS budget check with a saved trace is in examples/puppeteer-3g-audit.mts.
Lighthouse CI — budgets in CI
# .github/workflows/lighthouse.yml
name: Lighthouse
on: [pull_request]
jobs:
lighthouse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '22' }
- run: npm ci && npm run build
- run: npx @lhci/cli@0.15.1 autorun
env: { LHCI_GITHUB_APP_TOKEN: "${{ secrets.LHCI_GITHUB_APP_TOKEN }}" }// lighthouserc.js — fail the PR if budgets regress
module.exports = {
ci: {
collect: { startServerCommand: "npm run start", url: ["http://localhost:3000/"], numberOfRuns: 3 },
assert: { assertions: {
"categories:performance": ["warn", { minScore: 0.8 }],
"categories:accessibility": ["error", { minScore: 0.9 }],
"largest-contentful-paint": ["error", { maxNumericValue: 2500 }],
"cumulative-layout-shift": ["error", { maxNumericValue: 0.1 }],
} },
upload: { target: "temporary-public-storage" },
},
};LHCI_GITHUB_APP_TOKEN is the token from the Lighthouse CI GitHub App and is stored as a repo secret. It is optional and only needed for status checks. Lighthouse 12 removed the PWA category; Lighthouse 13.3+ adds Agentic Browsing. temporary-public-storage uploads reports to a public URL, so don't use it for private staging sites.
Common use cases
| Goal | Fastest path |
|---|---|
| Verify a UI change | MCP new_page → take_snapshot + take_screenshot |
| Accessibility audit | take_snapshot (a11y tree) + lighthouse_audit, or the a11y-debugging skill |
| Performance / CWV | performance_start_trace (reload, autoStop) → performance_analyze_insight; not lighthouse_audit |
| Check the slow-connection budget | Network panel Slow 4G/3G + Disable cache, or MCP emulate |
| Find a memory leak | Memory panel snapshots, or MCP with --memoryDebugging → compare_heapsnapshots |
| Diagnose jank | Performance trace → long tasks (>50ms) |
| Debug CSS the agent can't see | take_snapshot → get_css_styles(uid) |
| Reproduce an API call | Network → Copy as cURL or Edit and resend as fetch |
| Record a test | Recorder panel → export to Playwright, or playwright codegen |
| Trim the bundle | Coverage drawer → delete unused JS/CSS |
Troubleshooting
"MCP server chrome-devtools connection timed out after 30000ms" (Claude Code, Windows)
This is the failure on the codeAmani machine (plugin server plugin:chrome-devtools-mcp:chrome-devtools). The connect step only spawns npx and waits for the MCP initialize reply. Chrome is not launched yet, so this is not a Chrome problem. Measured on that machine on 2026-10-20, run on its own: npx -y chrome-devtools-mcp@1.11.0 answered initialize + tools/list in about 6 s with the package cached. The same session reported timeouts for several other npx/uvx servers at the same moment, which points to start-up contention (many servers resolving packages through npx at once) rather than a bug in this server. Work through these in order:
- Probe it outside the client. Run
npx tsx chrome-devtools/examples/mcp-probe.mts. It prints the handshake time and the tool count (expect 32). If it is fast here but times out in Claude Code, go to step 2. If it errors, go to step 4. - Raise the start-up timeout. Claude Code reads the
MCP_TIMEOUTenvironment variable (milliseconds). Set it to 60000 before launchingclaude. In PowerShell:$env:MCP_TIMEOUT = "60000"; claude. To make it permanent, add it under"env"in~/.claude/settings.json. - Take npx out of the start-up path.
npm i -g chrome-devtools-mcp@1.11.0, then register the binary directly withclaude mcp add chrome-devtools --scope user -- chrome-devtools-mcp. If you do this, disable the plugin's copy in/pluginso the two don't collide. - Windows
npxshim problems (Connection closed,-32000, nothing on stdout): wrap withcmd /c, as inexamples/mcp-config.windows.json:"command": "cmd", "args": ["/c", "npx", "-y", "chrome-devtools-mcp@1.11.0"]. Or give the absolute path tonpx.cmd. Some clients also needSystemRootandPROGRAMFILESpassed inenv(the repo's Codex-on-Windows recipe also uses a 20 s start-up timeout). - Node mismatch. The client may launch a different Node than your terminal. Check
node -vsatisfies^20.19.0 || ^22.12.0 || >=23.ERR_MODULE_NOT_FOUNDusually means an old Node or a corrupted npx cache: delete%LOCALAPPDATA%\npm-cache\_npxand runnpm cache clean --force. - Turn on logs. Add
"--logFile", "C:\\Users\\<you>\\AppData\\Local\\Temp\\cdm.log"toargsand setNODE_DEBUGto*in the server'senv. Then read the log after the next/mcpreconnect. - Too many servers. Disable MCP servers you aren't using in this project. Every enabled stdio server is spawned at start-up.
Other problems
| Issue | Fix |
|---|---|
Target closed / Chrome failed to start | Another Chrome is using the same profile. Close it, or use --isolated. Also check Chrome stable is installed and up to date |
| Chrome not found / wrong Chrome | --executablePath "C:\Program Files\Google\Chrome\Application\chrome.exe" (no CHROME_PATH env var exists) |
| Two agents fight over the browser | Default profile allows one browser at a time. Give each session --isolated |
| Tool errors "pageId required" | Page-ID routing has been the default since 1.8.0 (Aug 2026). Pass the pageId from new_page/list_pages, or start with --no-page-id-routing |
lighthouse_audit shows no performance score | By design. Use performance_start_trace |
| Heap tools missing | Start with --memoryDebugging (only take_heapsnapshot is default) |
| Screenshots or traces won't save | Paths are limited to the OS temp dir unless the client sends MCP roots. Add --filesystemRoot <dir> |
| WSL: server can't launch Windows Chrome | Known WSL issue. Install Chrome inside WSL, or start Windows Chrome with --remote-debugging-port=9222 plus mirrored networking and use --browserUrl. Or run from PowerShell/Git Bash instead |
--autoConnect times out | Chrome 144+ must already be running, with remote debugging allowed at chrome://inspect/#remote-debugging and the prompt accepted. Avoid hundreds of open tabs |
| OS sandbox blocks Chrome | Disable sandboxing for this server, or start Chrome yourself and use --browserUrl |
| Running as root (containers/CI) | Chrome refuses to start as root. Run as a non-root user |
Plugin install: Failed to clone repository | GitHub HTTPS blocked. Use the CLI install (method B) |
| CDP connection refused (scripts) | Launch Chrome with --remote-debugging-port=9222 --user-data-dir=<non-default dir> |
| Playwright browser missing | npx playwright install chromium |
| Lighthouse times out | Raise --max-wait-for-load, or reduce CPU throttling |
| Throttling preset names differ | DevTools UI (Chrome 127+): 3G / Slow 4G / Fast 4G. Puppeteer and MCP emulate: Slow 3G / Fast 3G / Slow 4G / Fast 4G |
| INP shows "—" | INP needs a real interaction. Click or type, then re-measure |
codeAmani notes
- US-first defaults, Kenya per project. The default test condition is Slow 4G + 4x CPU + Disable cache on a mid-range mobile viewport. For Kenya-targeted projects (primary users in Kenya), add 3G as a hard gate, because 2G/3G-first is the African-market mandate. Gate PRs on LCP ≤ 2.5 s and CLS ≤ 0.1 with Lighthouse CI either way.
- Verify, don't assume. After a UI change, use the
chrome-devtoolsMCP to load the page: take a snapshot and screenshot, record a performance trace, read the console, and runlighthouse_auditfor a11y and SEO. Do this before claiming done. It is the browser half of the "evidence before assertions" rule. - One install method per machine. This machine runs the official plugin. Don't also
claude mcp addthe server, or two servers will compete for the default Chrome profile. If the plugin's server times out at start-up, follow the timeout runbook above. - Privacy defaults matter. Run with
--no-usage-statistics, and use--no-performance-cruxwhen tracing internal, staging or client URLs, so they aren't sent to Google's CrUX API. Use--isolatedso the agent never sees a signed-in personal profile. - Payments flows. Stripe is the default rail: drive Checkout in test mode with test cards in an
--isolatedbrowser. For Kenya-targeted projects, drive the M-Pesa STK-Push UI against the Daraja sandbox. In both cases, use the Network panel orlist_network_requeststo confirm that no secret keys or tokens reach client requests, the console or screenshots, and add--redactNetworkHeaderswhen sharing MCP output. - Secrets stay server-side. Never paste credentials into the Console on a production page. Scrub
evaluate_scriptsnippets of any secret before saving them to a skill or the repo. DevTools output ends up in screenshots, traces and logs. - AI routing. The MCP is model-agnostic. Claude (primary) drives it from Claude Code; Cursor and VS Code use the same server config.