Skip to content

How to Give Cursor Access to Browser Console Logs

Cursor is a powerful AI code editor, but it has a blind spot: your browser. When your app throws an error at runtime, Cursor has no idea. You end up copying console output, screenshotting network tabs, and pasting fragments into chat — losing context every time.

Gasoline MCP is an open-source browser extension + MCP server that streams real-time browser telemetry to AI coding assistants. It connects Cursor directly to your browser so it can read console logs, network failures, and DOM state without you lifting a finger.

The Problem: Cursor Can’t See Your Browser

Section titled “The Problem: Cursor Can’t See Your Browser”

When something breaks in the browser, your workflow probably looks like this:

  1. Notice a blank page or broken UI
  2. Open Chrome DevTools
  3. Read through the console errors
  4. Copy the relevant ones
  5. Paste them into Cursor and explain what happened

By the time Cursor sees the error, you’ve already done the hard part — finding it. And you’ve stripped away surrounding context: the network request that failed before the error, the sequence of console warnings that preceded it, the state of the DOM.

Cursor needs raw, continuous access to what the browser is doing.

You could keep a DevTools window open and manually relay information to Cursor. But manual copy-paste has real costs:

  • Lost context. You copy one error but miss the failed API call that caused it.
  • Stale data. By the time you paste, the browser state has changed.
  • Friction. Every round trip between browser and editor breaks your flow.

Cursor supports MCP (Model Context Protocol) natively, which means any tool that speaks MCP can feed data directly into Cursor’s context. Gasoline uses this to bridge the gap.

Once connected, Cursor can query your browser for live telemetry:

Data TypeWhat Cursor Sees
Console logsAll console.log, console.warn, console.error output
JavaScript errorsUncaught exceptions with full stack traces
Network requestsURLs, status codes, timing, headers
Network bodiesRequest and response payloads (opt-in)
WebSocket messagesReal-time WS frame data
DOM stateQuery elements, read attributes, check visibility

This is not a snapshot. Gasoline captures events continuously, so Cursor can ask “what happened in the browser?” at any point and get the full picture.

Terminal window
npx gasoline-mcp@latest

This downloads a single Go binary (no Node.js runtime, no node_modules/). It starts a local MCP server on your machine.

Install the Gasoline extension from the Chrome Web Store. It connects to the local server automatically.

Open Cursor Settings, navigate to MCP, and add a new server with this configuration:

{
"mcpServers": {
"gasoline": {
"command": "npx",
"args": ["-y", "gasoline-mcp@latest"]
}
}
}

In Cursor’s chat or agent mode, just ask:

“Check the browser for errors”

Cursor will call Gasoline’s MCP tools, read the captured telemetry, and respond with what it finds — and often fix the issue in the same turn.

Real Workflow: React Dashboard Blank Screen

Section titled “Real Workflow: React Dashboard Blank Screen”

Without Gasoline (5 steps):

  1. See blank screen in browser
  2. Open DevTools, find TypeError: Cannot read properties of undefined (reading 'map') in console
  3. Switch to Network tab, notice the /api/dashboard request returned a 500
  4. Copy both the error and the failed request details
  5. Paste into Cursor, explain the situation, wait for a fix

With Gasoline (1 step):

Ask Cursor: “The dashboard page is blank. Check the browser and fix it.”

Cursor reads the console error and the failed network request simultaneously through Gasoline, identifies that the API returned a 500 causing an undefined .map() call, and adds a null check or error boundary — all in one turn.

Install the Gasoline Chrome extension and add the MCP server config to Cursor’s settings. Gasoline handles the connection between browser and editor over localhost. No accounts, no cloud services, no API keys.

Gasoline runs entirely on your machine. The server binds to 127.0.0.1 only and rejects non-localhost connections at the TCP level. It never makes outbound network calls. Sensitive headers (Authorization, Cookie) are stripped from captured network data by default. Request and response body capture is opt-in.

Terminal window
npx gasoline-mcp@latest

One command to give Cursor full visibility into your browser. For the complete Cursor integration guide, see the Cursor + Gasoline setup docs.