Guides · Bugs and AI coding agents

How to give your AI coding agent browser console and network logs

Updated Sep 23, 2026

Either let the agent drive a browser itself (Cursor's browser tool, Claude in Chrome, Chrome DevTools MCP), or record the bug once and hand the agent the recording over MCP. Live tools are best when the agent can reproduce the bug on your machine. A recording is the only option when the bug already happened, or happened to someone else.

The three options

ApproachExamplesGood forFalls short when
Agent drives a browserCursor browser tool, Claude in ChromeChecking your own UI changes as you buildThe bug needs a specific account, data or timing to show up
DevTools protocol MCPChrome DevTools MCP, BrowserTools MCPLive debugging, performance traces, LighthouseThe bug already happened, or happened on another machine
Recorded bug over MCPRollIntermittent bugs, bugs reported by others, handing off a reproYou want the agent to click around and try fixes live

They are not either/or. A common loop: someone records the bug, the agent reads the recording to find the cause, then uses a live browser to check the fix.

Option 1: let the agent open the page

Cursor has a built-in browser tool. The agent opens your dev server, clicks through it, and reads console messages and network requests on its own. Claude Code does the same through the Claude in Chrome extension: install it, start a session with claude --chrome, and Claude can read the console, network requests and DOM of the tabs it works in.

This is the least setup. It works when the agent can reproduce the bug by itself: your local app, a route it can reach, no special account state.

Option 2: connect a DevTools MCP server

Chrome DevTools MCP gives the agent the DevTools protocol: list_console_messages, list_network_requests, screenshots, performance traces. By default it starts its own Chrome with a separate profile, so you're not logged in there. On Chrome 144+ you can point it at your normal browser with --autoConnect after enabling remote debugging at chrome://inspect.

More detail on when this beats a recording, and when it doesn't: Chrome DevTools MCP vs a recorded bug report.

Option 3: record the bug once, serve it over MCP

The first two options need the bug to happen again, in front of the agent. Many don't: the race condition that shows up one time in five, the 500 a customer got on their account, the error a teammate saw on staging yesterday.

Roll records the tab and keeps the console, every fetch and XHR request with its body, and every click, on one timeline. When you stop, it writes a timeline.md that puts them in order:

t+00:02.14 · click   "Continue" · button.primary
t+00:02.31 · net     POST /v2/preferences → 500 · 2.5s
             res: {"error":"plan is undefined"}
t+00:07.02 · console TypeError: Cannot read properties
             of undefined (reading 'plan')
             at PreferenceForm (onboarding.tsx:142)

A local MCP server reads recordings straight from your disk. No cloud endpoint, no API key. Add it to Claude Code:

claude mcp add roll -- npx -y @rollapp.pro/mcp

Or to Cursor, in .cursor/mcp.json:

{
  "mcpServers": {
    "roll": {
      "command": "npx",
      "args": ["-y", "@rollapp.pro/mcp"]
    }
  }
}

Then ask the agent:

Open the latest Roll and tell me why checkout failed.

It calls get_timeline first, then get_network with failed_only: true and get_console with level: "error" for the detail. A published link like rollapp.pro/c/… works as the id too, so a bug a teammate recorded is one paste away. Full setup is in the MCP docs. To see what a recording holds before installing anything, open the live demo.

What to give the agent, whichever you pick

If you're writing this by hand, use the bug report template for AI agents.

Questions

Why can't my coding agent see the browser console?

Cursor, Claude Code and Codex run in your editor or terminal. The console and network panel live inside the browser process, so the agent sees nothing unless a tool bridges the two: a browser the agent controls, a DevTools connection, or a file you give it.

Is pasting the console error into the chat good enough?

For a single obvious stack trace, yes. It falls short when the cause is a request that failed a few seconds earlier, a response body the UI swallowed, or the order of clicks. The agent needs the sequence, not one line.

Should I send the agent the screen recording?

Not the video. Video is expensive in context and the model can't read a 500 response or a stack trace from pixels reliably. Send structured data (a timeline, the failed requests, the console errors) and keep the video for humans.

Does this work for bugs a customer or teammate hit?

Only the recording approach does. Live tools need the bug to happen in a browser the agent can reach. With Roll, whoever saw the bug records it and shares a link, and your agent opens that link by its /c/ URL through the MCP server.