Give Your Coding Agent Chrome DevTools
Connect a coding agent to Chrome for browser debugging, network inspection, and performance traces.
A coding agent can read your frontend code and still miss the request that failed in the browser. Chrome DevTools MCP gives a compatible agent tools to inspect a live Chrome session: navigate pages, examine network requests and console messages, capture screenshots, and record performance traces. That makes it useful when the bug only appears after a real page loads.
The Chrome DevTools for agents project provides both an MCP server and a CLI. This is an established project worth exploring, not a claim that it launched today. The workflow below follows its documentation; it has not been tested locally for this article.
Connect a client
You need Node.js LTS, npm, a current stable Chrome installation, and an MCP-compatible client. The maintainers officially support Google Chrome and Chrome for Testing; other Chromium browsers may work but aren’t guaranteed. Add the server to your client’s MCP configuration, adapting the location to that client:
1
2
3
4
5
6
7
8
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest", "--no-usage-statistics", "--no-performance-crux"]
}
}
}
The flags opt out of the server’s default usage statistics and disable CrUX lookups by its performance tools. Without the latter, the project says performance tools may send trace URLs to Google’s CrUX API. The server also checks npm for updates by default; the README documents a separate environment variable to disable those checks. Using @latest fetches the current package, so pin a reviewed version if reproducible behavior matters more than automatic updates. See the project README and its client configuration guide for client-specific setup.
Connecting the server alone does not start Chrome. According to the maintainers, Chrome starts when a client first uses a tool requiring a browser. Try asking the agent to inspect a local development page and report its console errors. Confirm the client actually invokes the tool and returns observations; a confident answer without tool output is not a browser check.
Follow a failing request
Suppose a dashboard renders an empty list. Give the agent a bounded task: open the local page, reproduce the empty state, list failed network requests, and inspect the relevant console messages. Ask it to report the URL, status, and the evidence for its diagnosis before changing code.
The tool reference documents list_network_requests, get_network_request, list_console_messages, and get_console_message. A failed API request and a JavaScript exception can point to different causes; a screenshot alone may show the symptom but not which one occurred. Review request details carefully: headers, responses, and URLs can contain credentials or personal data.
For a slow page, ask for a performance trace around a repeatable interaction, then inspect the reported insight and its supporting trace. A trace is a measurement of that run under its conditions, not proof that every user sees the same delay. Compare runs with the same setup and verify any change with another trace.
Treat browser access as real access
The server exposes browser content to its MCP clients, which can inspect and modify data in the browser and DevTools. Use a separate test profile and non-sensitive accounts where possible. Avoid connecting it to a session with secrets you would not share with the agent or its model provider. Restrict the task to a site you control or are authorized to test, and review actions before allowing changes to real data.
The tool can shorten the path from a visual symptom to evidence, but it does not replace reading the code or checking the result. Keep the agent’s observations, proposed fix, and verification separate so a plausible explanation does not become an untested conclusion.