Chrome DevTools MCP: Debug a Live Page Through an Agent

Configure Chrome DevTools MCP, reproduce a browser bug in its controlled Chrome instance, inspect console and network evidence, and verify the fix.

Updated · Markdown version

Chrome DevTools MCP is an open-source MCP server that lets an AI agent drive and inspect a Chrome tab with the same kinds of data a developer sees in DevTools. This guide covers the setup, a debugging session from start to finish, and the failure modes that waste the most time.

Set up the server

  1. Install a supported Node.js LTS release, npm, and Google Chrome or Chrome for Testing. The project officially supports current stable Chrome or newer; other Chromium-based browsers may work but are not guaranteed.
  2. Add the server to your MCP client's configuration. The README's snippet is:
{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["-y", "chrome-devtools-mcp@latest"]
    }
  }
}
  1. Restart the client so it loads the server and lists its tools.
  2. Add flags only when you need them. The repository documents --headless, --isolated, and --no-usage-statistics. Usage data collection is on by default, so --no-usage-statistics or the environment variable CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS turns it off. Check the README for the current option list, since it changes.

Check that it worked: ask the agent to call list_pages. It should return at least one open page.

Debug a live page

  1. Ask the agent to call list_pages. In the default setup, the server controls the browser instance it starts; it does not automatically attach to a tab in your everyday Chrome profile. Open the test URL with new_page, or select a page already listed for that controlled instance.
  2. Reproduce the problem with navigate_page, then click, fill, or press_key. After navigation or a substantial DOM change, take a fresh snapshot before reusing element identifiers.
  3. Call list_console_messages to get the errors and warnings. Ask for get_console_message on the exact entry you care about, so the agent works from the full text and not a paraphrase.
  4. Call list_network_requests, then get_network_request on the failing call. Compare the status code and response body with what the frontend expects.
  5. Call take_snapshot to read the page structure, and take_screenshot if the layout is the issue.
  6. Test one hypothesis at a time with evaluate_script using a small expression. Change one thing, reproduce, and compare.
  7. For a slow load, call performance_start_trace, reproduce the slow action, call performance_stop_trace, then performance_analyze_insight on the result.

Check that it worked: reproduce the same action under the same test conditions. Confirm the original console error no longer appears and inspect the relevant network request's status and response. Absence of one error is not enough if the user-visible behavior is still wrong, so repeat the original task as the final acceptance check.

The README points to its Advanced Usage Guide for connecting to a running Chrome instance instead of starting a new one. The flag name is not on the README, so read that guide before you try to attach to a browser you already have open.

Pitfalls

  • Logged-in state is missing. The server-controlled browser may not share the session you expected. Use a dedicated test account or follow the Advanced Usage Guide to connect to an appropriate running browser. Remember that the MCP client can inspect, debug, and modify data visible in that browser, so do not expose personal or sensitive sessions unnecessarily.
  • Stale element references. After the DOM changes, a click against an old snapshot can target the wrong element or fail. Call take_snapshot again before the next interaction.
  • Summaries replacing raw output. An agent may say "there is a CORS error" when the console shows something narrower. Ask for the exact message text and the request URL, and compare them yourself.
  • Trace numbers from different conditions. Trace results change with CPU load, cache state, and network throttling. Record the baseline and the fix under the same conditions.
  • Usage statistics are enabled unexpectedly. The server collects tool reliability, latency, and environment statistics by default. Disable that collection with --no-usage-statistics or CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS if it does not fit your policy. This telemetry setting is separate from the broader risk of exposing browser contents to the MCP client.

When to use a skill instead

The MCP server supplies browser observations; a skill can provide a repeatable investigation or test-writing workflow, but it does not prove the diagnosis. systematic-debugging has only a provisional three-task, single-run evaluation. browser-e2e-testing was measured on six paired tasks with a LIFT_UNCONFIRMED verdict, including one harmed task. Use either as optional guidance and keep the live evidence, regression test, and human review as the acceptance criteria.

FAQ

What is an MCP server? In practice, an MCP server is a process that offers callable tools, readable resources and prompt templates to a client application. The Chrome DevTools server offers its browser actions and debugging data through that same interface.

What does MCP stand for? MCP stands for Model Context Protocol. The protocol is openly specified and gives AI applications one common way to reach outside tools and data sources.

Does Chrome DevTools MCP need Node.js? Yes. The README asks for an LTS version of Node.js, and the setup snippet launches the server with npx. Check the README for the current requirement before installing.

Platform Score is our assessment under a published method. It is not a safety guarantee.

Next steps

  1. Debug an MCP Server with MCP Inspector Read next.
  2. Sentry MCP: pull an error into an agent session Read next.
  3. All guides by topic Browse everything.

Sources