Dev.to AI ๐Ÿค– Ai ๐Ÿ‘ 0 ๐Ÿ“– 2 min read

EyeDOM: Click Any Broken CSS/DOM Element and Stream It Straight to Your AI Agent via MCP (No Extension)

Debugging layout bugs with AI coding agents usually means opening DevTools, copying huge HTML snippets, inspecting two parent containers, checking computed styles, and pasting screenshots into chat. I built EyeDOM to tu

EyeDOM: Click Any Broken CSS/DOM Element and Stream It Straight to Your AI Agent via MCP (No Extension)

Debugging layout bugs with AI coding agents usually means opening DevTools, copying huge HTML snippets, inspecting two parent containers, checking computed styles, and pasting screenshots into chat.

I built EyeDOM to turn that entire loop into a single click โ€” with zero browser extensions and zero manual MCP JSON editing.

EyeDOM Demo

GitHub: https://github.com/cosmicrouter/eyedom

Quick Start

Install directly from GitHub:

npm install -g github:cosmicrouter/eyedom
eyedom setup
eyedom open http://localhost:3000

Click the bottom-right Inspect button (or press Alt + Shift + D), click any broken element on the page, and ask your AI agent to fix the latest captured DOM bug.

Why a Local Reverse Proxy Instead of an Extension or Bookmarklet?

Bookmarklets break on modern HTTPS sites because of strict Content-Security-Policy and Mixed Content rules, and browser extensions require per-browser installs (and rarely support Safari).

eyedom open <url> solves this by spinning up a lightweight same-origin Node.js reverse proxy:

  1. Strips CSP headers and follows http -> https and www redirects cleanly.
  2. Tunnels WebSocket upgrades (net/tls) so Vite and Next.js Hot Module Replacement (HMR) continue working live.
  3. Serves /__eyedom/eyedom.js and /__eyedom/capture on the same origin, eliminating CORS and Mixed Content completely.
  4. Renders the inspector inside an isolated Shadow DOM, so broken host-page CSS never breaks the inspector itself.

Because it has zero browser-specific APIs, it works identically in Chrome, Firefox, Safari, Edge, Brave, and Opera.

What Your AI Agent Actually Receives

Instead of dumping a 10,000-token DOM tree, EyeDOM sends a compact Markdown report via the get_latest_dom_bug MCP tool:

  • Unique CSS selector and trimmed outerHTML (max 1,500 chars)
  • Filtered layout-relevant computed CSS (display, position, flex*, grid*, gap, overflow*, sizing, z-index, transform)
  • getBoundingClientRect() with automatic HORIZONTAL OVERFLOW (X) / VERTICAL OVERFLOW (Y) / EXCEEDS VIEWPORT flags
  • Layout styles of the 2 parent containers (where most flex/grid bugs originate)
  • React Fiber / Vue 2 & 3 component name and ancestor tree
  • The last 5 console.error / window.onerror / unhandledrejection logs

One-Command Setup for 10+ AI Agents

Running eyedom setup auto-detects installed agents across Linux, macOS, and Windows and safely merges the MCP config without overwriting existing settings:

  • Claude Code (~/.claude.json)
  • Claude Desktop
  • Antigravity
  • Cursor
  • Windsurf
  • VS Code (Copilot MCP)
  • Gemini CLI
  • Codex CLI (~/.codex/config.toml)
  • OpenCode
  • Zed

You can also pipe directly into any CLI tool:

eyedom latest | claude
eyedom latest | aider --message-file -

Multi-Agent Safety (EADDRINUSE)

If you run Claude Code, Cursor, and Antigravity at the same time, they won't fight over port 4789. The first process hosts the local server, and every additional eyedom mcp process catches EADDRINUSE and seamlessly switches to atomic file-backed reads from ~/.eyedom/.

Links

Feedback and PRs are very welcome โ€” what else would you want captured when debugging frontend bugs with AI agents?

๐Ÿ“ฐ Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.