← Back to dashboard
chrome-devtoolstoolingfreshReader view (for NotebookLM)

Chrome DevTools Developer Training & Resource Guide

What is Chrome DevTools?

The real model

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.

Connection (representative)
TTFB0.85s≤ 0.8s
FCP1.90s≤ 1.8s
LCP37.9s≤ 2.5s
Request waterfallLCP 37.9s
Connect (TLS)
TTFB (server)
Render-blocking
Render-blocking
Render-blocking
Parse / render
Content transfer (LCP)

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.

Core Web Vitals (75th pct):● LCP ≤ 2.5s● INP ≤ 200ms● CLS ≤ 0.1(INP & CLS come from interactions/layout, not bandwidth)

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.

Text
 ██████╗██╗  ██╗██████╗  ██████╗ ███╗   ███╗███████╗
██╔════╝██║  ██║██╔══██╗██╔═══██╗████╗ ████║██╔════╝
██║     ███████║██████╔╝██║   ██║██╔████╔██║█████╗
██║     ██╔══██║██╔══██╗██║   ██║██║╚██╔╝██║██╔══╝
╚██████╗██║  ██║██║  ██║╚██████╔╝██║ ╚═╝ ██║███████╗
 ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚═╝     ╚═╝╚══════╝

██████╗ ███████╗██╗   ██╗████████╗ ██████╗  ██████╗ ██╗     ███████╗
██╔══██╗██╔════╝██║   ██║╚══██╔══╝██╔═══██╗██╔═══██╗██║     ██╔════╝
██║  ██║█████╗  ██║   ██║   ██║   ██║   ██║██║   ██║██║     ███████╗
██║  ██║██╔══╝  ╚██╗ ██╔╝   ██║   ██║   ██║██║   ██║██║     ╚════██║
██████╔╝███████╗ ╚████╔╝    ██║   ╚██████╔╝╚██████╔╝███████╗███████║
╚═════╝ ╚══════╝  ╚═══╝     ╚═╝    ╚═════╝  ╚═════╝ ╚══════╝╚══════╝

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-mcp server for Claude Code / Cursor / VS Code, Core Web Vitals budgets, and testing with Playwright, Puppeteer and Lighthouse CI. Grounded in developer.chrome.com, web.dev, the official MCP repo at tag chrome-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):

PackageVersionNotes
chrome-devtools-mcp1.11.0 (2026-10-15)Node ^20.19.0 || ^22.12.0 || >=23; ships the chrome-devtools-mcp and chrome-devtools (CLI) binaries
puppeteer25.14.0Same version the MCP server is built on
playwright / @playwright/test1.64.1
lighthouse13.5.0Adds the "Agentic Browsing" category (13.3.0+)
web-vitals6.2.3
@lhci/cli0.15.1
Chrome stable155 to 156156.0.8078.36 was rolling out on 2026-10-20

How to use this guide

DevTools has three faces. Learn them in this order:

  1. The panels (manual): Part 1. What you open with F12 / Cmd+Opt+I to inspect, debug and profile by hand.
  2. The protocol (scriptable): Part 3. Everything the UI does, exposed as a WebSocket API that Playwright, Puppeteer, Lighthouse and the MCP all build on.
  3. The agent surface (Claude Code): Part 4. chrome-devtools-mcp lets 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


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.

PanelWhat it's forReach for it when…
ElementsInspect and edit the live DOM and CSS (the Styles pane)Tweaking layout, debugging CSS specificity, checking computed styles
ConsoleLog output plus a live JS REPL against the pageReading errors, poking at window/page state, quick scripting
SourcesView files, set breakpoints, step through JS, edit and save (Workspaces)Debugging logic, watching variables, ignore-listing scripts
NetworkEvery request and response, timing, headers, throttlingChecking payload size, caching, CORS, slow-connection behaviour
PerformanceRecord a trace of main-thread work; Live Metrics for Core Web Vitals; InsightsDiagnosing jank, long tasks, layout thrash, slow LCP, soft navigations
MemoryHeap snapshots and allocation timelinesHunting memory leaks and detached DOM nodes
ApplicationStorage (localStorage, IndexedDB, cookies), Service Workers, Cache, manifest, AdsDebugging PWAs, auth cookies, offline behaviour, ad cost
LighthouseOne-click audit: Performance, Accessibility, Best Practices, SEO, Agentic BrowsingA scored baseline plus prioritised fixes
RecorderRecord, replay and measure a user flow; export to Puppeteer/PlaywrightTurning a manual flow into a repeatable test
Privacy and securityCertificates, mixed content, third-party cookie controlsVerifying a page is fully HTTPS and cookie-clean
Rendering (drawer)Paint flashing, FPS meter, emulate prefers-color-scheme and other media featuresSpotting unnecessary repaints, testing dark mode
Coverage (drawer)Unused JS/CSS per fileTrimming dead code from the bundle
Issues / Changes / Animations / Sensors / WebAuthnAggregated warnings · CSS diff · animation timeline · geolocation/orientation emulation · authenticator emulationTargeted debugging of each concern

Open drawer tools with Esc, then the ⋮ menu > More tools, or through the Command Menu.

Elements + Styles — DOM & CSS

Text
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

JavaScript
// $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 table

Sources — the debugger

Text
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 resume

Network — payload & throttling

Text
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

Text
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

Text
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).

MetricMeasuresGoodNeeds improvementPoor
LCP: Largest Contentful PaintLoading≤ 2.5 s2.5 – 4.0 s> 4.0 s
INP: Interaction to Next PaintInteractivity≤ 200 ms200 – 500 ms> 500 ms
CLS: Cumulative Layout ShiftVisual stability≤ 0.10.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:

MetricGood thresholdHelps explain
FCP: First Contentful Paint≤ 1.8 sLCP
TTFB: Time to First Byte≤ 0.8 sFCP / LCP

Measure vitals in code (field data)

Bash
npm install web-vitals@6.2.3
TypeScript
import { 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:

Bash
# 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
PowerShell
# Windows
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="$env:TEMP\chrome-debug"
TypeScript
// 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.

Text
/plugin marketplace add ChromeDevTools/chrome-devtools-mcp
/plugin install chrome-devtools-mcp@chrome-devtools-plugins

Restart 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).

Bash
claude mcp add chrome-devtools --scope user -- npx -y chrome-devtools-mcp@latest

Project-scoped .mcp.json (committed, shared with the team). The full file is in examples/mcp-config.json:

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

ClientHow
CursorCursor 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 / CopilotRecommended: 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 / othersSee 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.

GroupDefault toolsBehind a flag
Input (10)click · drag · fill · fill_form · handle_dialog · hover · press_key · type_text · upload_fileclick_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_heapsnapshotthe 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 from new_page / list_pages. --no-page-id-routing restores "selected page" behaviour.
  • lighthouse_audit does 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 (navigation reloads, snapshot audits the current state), outputDirPath. For performance, use performance_start_trace.
  • performance_start_trace takes reload, autoStop, ignoreCache (cold load, new in 1.11.0) and filePath (save trace.json.gz). Results list "insight sets". Drill in with performance_analyze_insight(insightSetId, insightName), for example insightName: "LCPBreakdown" or "DocumentLatency".
  • Screencasts are on by default and no longer need ffmpeg (1.11.0). --experimentalScreencast now means "use the legacy ffmpeg recorder" and is deprecated.
  • emulate takes networkConditions (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 features prefersReducedMotion, prefersContrast and forcedColors (1.11.0). Each call replaces all previous emulation settings, so pass everything in one call.
  • wait_for waits for text (text: ["Dashboard"]), not a CSS selector.
  • evaluate_script takes function (a function declaration such as () => document.title) or sourcePath (a local .js file, new in 1.11.0), plus format, args (element uids from a snapshot), serviceWorkerId and filePath.
  • get_css_styles (1.10.0) returns the matched cascade for a snapshot uid, with overridden declarations marked [overloaded].
  • list_console_messages can include source-mapped stack traces (includeStackTraces) and preserved messages from the last 3 navigations.

take_snapshot returns the accessibility tree with a uid per 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 /mcp after 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.

FlagDefaultUse it for
--headlessfalseNo window. Use in CI or when you don't need to watch
--isolatedfalseTemporary profile, deleted on close. Use for parallel sessions or a clean slate
--userDataDir <dir>%USERPROFILE%\.cache\chrome-devtools-mcp\chrome-profilePersistent profile. Only one browser can use it at a time
--channel stable|beta|dev|canarystableTest against a newer Chrome
--executablePath <path> / -eautoPoint at a specific Chrome binary. There is no CHROME_PATH env var; use this flag
--browserUrl http://127.0.0.1:9222 / -uAttach to a Chrome you started with --remote-debugging-port
--wsEndpoint ws://… + --wsHeadersAttach over a raw WebSocket (with auth headers)
--autoConnectfalseAttach to your running Chrome 144+ after enabling it at chrome://inspect/#remote-debugging
--viewport 1280x720Initial window size (headless max 3840x2160)
--slimfalse3-tool minimal mode
--memoryDebuggingfalseThe 13 heap-analysis tools
--experimentalVisionfalseclick_at(x, y) for computer-use models
--categoryExtensions / --categoryPwa / --categoryExperimentalThirdParty / --categoryExperimentalWebmcpfalseOpt-in tool groups
--category<Input|Navigation|Emulation|Performance|Network|Debugging|Memory>=falsetrueDrop a whole group to save context
--no-usage-statisticsstats onOpt out of Google's usage telemetry (also off when CI is set)
--no-performance-cruxCrUX onStop sending trace URLs to the CrUX API
--no-javascript-evaluationeval onDisable evaluate_script, initScript and javascript:/data: navigations (not a sandbox)
--no-file-navigationsallowedReject file: URLs (1.11.0)
--allowedUrlPattern / --blockedUrlPatternRestrict which URLs the browser may load (allow-list needs Chrome 149+)
--redactNetworkHeadersfalseRedact sensitive headers in network tool output
--acceptInsecureCertsfalseSelf-signed local HTTPS (use with care)
--screenshotFormat jpeg|webp + --screenshotMaxWidthpng / noneSmaller screenshots, which means fewer image tokens
--filesystemRoot <dir> (alias --workspace)OS temp dirWhere 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, --ignoreDefaultChromeArgPass-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:

Bash
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 stop

The 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 when CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS or CI is 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-crux for 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 --isolated or a dedicated profile. Never point --autoConnect at a browser that is signed into production admin consoles.
  • Keep the config file out of the agent's write path. It can set executablePath, chromeArg and 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:

Markdown
---
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:

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

Bash
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
TypeScript
// 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

TypeScript
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

YAML
# .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 }}" }
JavaScript
// 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

GoalFastest path
Verify a UI changeMCP new_page → take_snapshot + take_screenshot
Accessibility audittake_snapshot (a11y tree) + lighthouse_audit, or the a11y-debugging skill
Performance / CWVperformance_start_trace (reload, autoStop) → performance_analyze_insight; not lighthouse_audit
Check the slow-connection budgetNetwork panel Slow 4G/3G + Disable cache, or MCP emulate
Find a memory leakMemory panel snapshots, or MCP with --memoryDebugging → compare_heapsnapshots
Diagnose jankPerformance trace → long tasks (>50ms)
Debug CSS the agent can't seetake_snapshot → get_css_styles(uid)
Reproduce an API callNetwork → Copy as cURL or Edit and resend as fetch
Record a testRecorder panel → export to Playwright, or playwright codegen
Trim the bundleCoverage 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:

  1. 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.
  2. Raise the start-up timeout. Claude Code reads the MCP_TIMEOUT environment variable (milliseconds). Set it to 60000 before launching claude. In PowerShell: $env:MCP_TIMEOUT = "60000"; claude. To make it permanent, add it under "env" in ~/.claude/settings.json.
  3. Take npx out of the start-up path. npm i -g chrome-devtools-mcp@1.11.0, then register the binary directly with claude mcp add chrome-devtools --scope user -- chrome-devtools-mcp. If you do this, disable the plugin's copy in /plugin so the two don't collide.
  4. Windows npx shim problems (Connection closed, -32000, nothing on stdout): wrap with cmd /c, as in examples/mcp-config.windows.json: "command": "cmd", "args": ["/c", "npx", "-y", "chrome-devtools-mcp@1.11.0"]. Or give the absolute path to npx.cmd. Some clients also need SystemRoot and PROGRAMFILES passed in env (the repo's Codex-on-Windows recipe also uses a 20 s start-up timeout).
  5. Node mismatch. The client may launch a different Node than your terminal. Check node -v satisfies ^20.19.0 || ^22.12.0 || >=23. ERR_MODULE_NOT_FOUND usually means an old Node or a corrupted npx cache: delete %LOCALAPPDATA%\npm-cache\_npx and run npm cache clean --force.
  6. Turn on logs. Add "--logFile", "C:\\Users\\<you>\\AppData\\Local\\Temp\\cdm.log" to args and set NODE_DEBUG to * in the server's env. Then read the log after the next /mcp reconnect.
  7. Too many servers. Disable MCP servers you aren't using in this project. Every enabled stdio server is spawned at start-up.

Other problems

IssueFix
Target closed / Chrome failed to startAnother 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 browserDefault 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 scoreBy design. Use performance_start_trace
Heap tools missingStart with --memoryDebugging (only take_heapsnapshot is default)
Screenshots or traces won't savePaths are limited to the OS temp dir unless the client sends MCP roots. Add --filesystemRoot <dir>
WSL: server can't launch Windows ChromeKnown 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 outChrome 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 ChromeDisable 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 repositoryGitHub 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 missingnpx playwright install chromium
Lighthouse times outRaise --max-wait-for-load, or reduce CPU throttling
Throttling preset names differDevTools 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-devtools MCP to load the page: take a snapshot and screenshot, record a performance trace, read the console, and run lighthouse_audit for 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 add the 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-crux when tracing internal, staging or client URLs, so they aren't sent to Google's CrUX API. Use --isolated so 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 --isolated browser. For Kenya-targeted projects, drive the M-Pesa STK-Push UI against the Daraja sandbox. In both cases, use the Network panel or list_network_requests to confirm that no secret keys or tokens reach client requests, the console or screenshots, and add --redactNetworkHeaders when sharing MCP output.
  • Secrets stay server-side. Never paste credentials into the Console on a production page. Scrub evaluate_script snippets 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.