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:
- Notice a blank page or broken UI
- Open Chrome DevTools
- Read through the console errors
- Copy the relevant ones
- 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.
Why Existing Approaches Fall Short
Section titled “Why Existing Approaches Fall Short”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.
What Cursor Can See Through Gasoline
Section titled “What Cursor Can See Through Gasoline”Once connected, Cursor can query your browser for live telemetry:
| Data Type | What Cursor Sees |
|---|---|
| Console logs | All console.log, console.warn, console.error output |
| JavaScript errors | Uncaught exceptions with full stack traces |
| Network requests | URLs, status codes, timing, headers |
| Network bodies | Request and response payloads (opt-in) |
| WebSocket messages | Real-time WS frame data |
| DOM state | Query 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.
Setup: Four Steps
Section titled “Setup: Four Steps”1. Start the Gasoline server
Section titled “1. Start the Gasoline server”npx gasoline-mcp@latestThis downloads a single Go binary (no Node.js runtime, no node_modules/). It starts a local MCP server on your machine.
2. Install the Chrome extension
Section titled “2. Install the Chrome extension”Install the Gasoline extension from the Chrome Web Store. It connects to the local server automatically.
3. Add the MCP server to Cursor
Section titled “3. Add the MCP server to Cursor”Open Cursor Settings, navigate to MCP, and add a new server with this configuration:
{ "mcpServers": { "gasoline": { "command": "npx", "args": ["-y", "gasoline-mcp@latest"] } }}4. Ask Cursor to check the browser
Section titled “4. Ask Cursor to check the browser”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):
- See blank screen in browser
- Open DevTools, find
TypeError: Cannot read properties of undefined (reading 'map')in console - Switch to Network tab, notice the
/api/dashboardrequest returned a 500 - Copy both the error and the failed request details
- 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.
How do I connect Cursor to my browser?
Section titled “How do I connect Cursor to my browser?”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.
Is Gasoline MCP secure?
Section titled “Is Gasoline MCP secure?”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.
Get Started
Section titled “Get Started”npx gasoline-mcp@latestOne command to give Cursor full visibility into your browser. For the complete Cursor integration guide, see the Cursor + Gasoline setup docs.