Skip to main content
Glama

EyeDOM is a local browser DOM/CSS bug inspector and universal MCP (Model Context Protocol) + CLI bridge for AI coding agents.

Open any local dev server or live website with eyedom open <url>, click the broken element, and stream a clean, token-efficient Markdown report directly into Claude Code, Antigravity, Cursor, Windsurf, VS Code, Gemini CLI, Codex CLI, OpenCode, Zed, Aider, or any shell workflow. Works across Chrome, Firefox, Safari, Edge, and Brave.


Demo

Full-resolution MP4: assets/demo.mp4


Related MCP server: ui-ticket-mcp

Quick Start

npm install -g github:cosmicrouter/eyedom

# 1. Auto-connect EyeDOM MCP to every installed AI CLI & IDE
eyedom setup

# 2. Open any local or live URL with the inspector auto-injected
eyedom open http://localhost:3000

Or run directly without installing

npx github:cosmicrouter/eyedom setup
npx github:cosmicrouter/eyedom open http://localhost:3000

3-Step Workflow

  1. Run eyedom open <url> (e.g. http://localhost:3000, localhost:5173, or https://your-staging-app.com).

  2. Click the bottom-right Inspect button (or press Alt + Shift + D) and click the broken element.

  3. Ask your AI coding agent: "Fix the latest captured DOM bug."


Features

  • Same-Origin Local Reverse Proxy + HMR WebSocket Tunnel (eyedom open <url>): Strips strict Content-Security-Policy headers, follows http -> https and www redirects, tunnels WebSocket Upgrade connections so Vite / Next.js Hot Module Replacement (HMR) stays live, and serves /__eyedom/eyedom.js + /__eyedom/capture on the exact same origin.

  • Shadow DOM Isolated Inspector: The hover highlight frame, dimension/selector badge, and floating controls live inside an isolated Shadow DOM (z-index: 2147483647), completely immune to broken host-page CSS.

  • Token-Optimized Layout Extraction: Filters computed styles down to layout-critical CSS (display, position, box model, flex*, grid*, gap, overflow*, transform, z-index, opacity) and caps outerHTML at 1,500 characters so your agent gets signal instead of noise.

  • Overflow & Geometry Diagnostics: Computes exact getBoundingClientRect() coordinates alongside scrollWidth/clientWidth and viewport bounds to flag HORIZONTAL OVERFLOW (X), VERTICAL OVERFLOW (Y), and EXCEEDS VIEWPORT automatically.

  • Framework Component Trace: Inspects React (__reactFiber$ / __reactInternalInstance$) and Vue 2/3 (__vueParentComponent / __vue__) internals to report the exact component name and ancestor tree (PricingCard -> DashboardPage).

  • Parent Layout Context: Captures the immediate 2 ancestor elements (L1, L2) with their layout styles (display, position, overflow, width, height) — critical for debugging flex/grid shrinking and clipping issues.

  • Live Console & Runtime Errors: Hooks console.error, window.onerror, and unhandledrejection to attach the last 5 runtime errors to every capture.

  • Multi-Agent Port Safety (EADDRINUSE): Run Claude Code, Antigravity, Cursor, and OpenCode simultaneously without port 4789 collisions. Secondary MCP processes seamlessly fall back to file-backed reads from ~/.eyedom/.

  • Offline Clipboard Fallback: If the local server is stopped, EyeDOM automatically formats the captured element as Markdown and copies it to your clipboard.

  • Minimal Local Workspace (http://127.0.0.1:4789): Monochrome split-view workspace to launch any URL, browse the last 10 captures, preview/copy Markdown reports, and connect local agents in one click.


Real-World Workflows

1. Local Dev Server (Vite, Next.js, Remix, SvelteKit, Astro)

eyedom open http://localhost:3000

Click the overflowing card or misaligned navbar item → switch to Claude Code / Cursor / Antigravity → "Fix the latest captured DOM bug."

2. Live Staging or Production HTTPS Site (Strict CSP)

eyedom open https://staging.example.com/checkout

EyeDOM proxies the site locally, removes CSP blocks, injects the inspector, and reports the original https://staging.example.com/checkout URL in the bug report.

3. Pipe Directly into Any CLI Agent (Aider, Claude, Custom Scripts)

eyedom latest | claude
eyedom latest | aider --message-file -
eyedom latest --json | jq '.geometry'

4. Direct Script Tag (Optional, No Proxy Needed)

If you only debug your own local HTML and prefer not to use the proxy, start eyedom start and drop one line into your dev HTML:

<script src="http://127.0.0.1:4789/eyedom.js"></script>

Supported AI Agents

eyedom setup auto-detects installed agents across Linux, macOS, and Windows and safely merges the eyedom MCP entry without touching your existing configuration:

Agent

Config Path

Schema

Auto-Setup

Claude Code

~/.claude.json

mcpServers (JSON)

eyedom setup

Claude Desktop

Claude/claude_desktop_config.json

mcpServers (JSON)

eyedom setup

Antigravity

~/.gemini/antigravity/mcp_config.json

mcpServers (JSON)

eyedom setup

Cursor

~/.cursor/mcp.json

mcpServers (JSON)

eyedom setup

Windsurf

~/.codeium/windsurf/mcp_config.json

mcpServers (JSON)

eyedom setup

VS Code (Copilot MCP)

Code/User/mcp.json

servers (JSON)

eyedom setup

Gemini CLI

~/.gemini/settings.json

mcpServers (JSON)

eyedom setup

Codex CLI

~/.codex/config.toml

[mcp_servers] (TOML)

eyedom setup

OpenCode

~/.config/opencode/opencode.json

mcp (JSON)

eyedom setup

Zed

~/.config/zed/settings.json

context_servers (JSON)

eyedom setup

Aider / Any Pipe CLI

stdout / ~/.eyedom/latest.md

Pipe (|)

eyedom latest | aider --message-file -

Claude Code:

claude mcp add eyedom -- eyedom mcp

Antigravity / Cursor / Windsurf / Claude Desktop:

{
  "mcpServers": {
    "eyedom": {
      "command": "eyedom",
      "args": ["mcp"]
    }
  }
}

VS Code (mcp.json):

{
  "servers": {
    "eyedom": {
      "type": "stdio",
      "command": "eyedom",
      "args": ["mcp"]
    }
  }
}

Codex CLI (~/.codex/config.toml):

[mcp_servers.eyedom]
command = "eyedom"
args = ["mcp"]

OpenCode (~/.config/opencode/opencode.json):

{
  "mcp": {
    "eyedom": {
      "type": "local",
      "command": ["eyedom", "mcp"],
      "enabled": true
    }
  }
}

What Gets Captured

Every click writes an atomic Markdown report to ~/.eyedom/latest.md, full JSON to ~/.eyedom/latest.json, and updates the rolling 10-capture log in ~/.eyedom/history.json:

# EyeDOM Element Bug Report

- **Capture ID:** `cap_m9x4k2_a1f0`
- **Captured At:** 2026-11-28T20:33:11.885Z
- **Page URL:** http://localhost:3000/dashboard
- **Viewport:** 1440x900px (DPR: 2)
- **Framework:** React `<PricingCard />` (tree: `PricingCard` -> `DashboardPage`)

## 1. Element Identity
- **Tag:** `<div>`
- **ID:** `#pro`
- **Classes:** `pricing-card`, `overflow-bug`
- **Unique Selector:** `#pro`

### outerHTML
```html
<div id="pro" class="pricing-card overflow-bug">...</div>

2. Geometry & Overflow

  • Bounding Rect: x=348px, y=160px, width=260px, height=190px

  • Scroll vs Client: scroll=320x190px, client=260x190px

  • Overflow Status: HORIZONTAL OVERFLOW (X)

3. Computed Layout Styles

display: flex;
position: relative;
box-sizing: border-box;
width: 260px;
height: 190px;
overflow-x: visible;

4. Parent Context

  • Direct Parent (L1): section#grid-wrap.cards-grid

    • Layout: display: grid; position: relative; overflow: hidden; width: 960px; height: 400px

5. Recent Console & Runtime Errors (Last 5)

  1. (console.error) Warning: Each child in a list should have a unique key prop.


---

## Architecture

```mermaid
flowchart LR
  Browser["Browser (Any Site via eyedom open)"] -->|"Same-origin POST /__eyedom/capture"| Proxy["EyeDOM Reverse Proxy + Receiver (127.0.0.1:4789)"]
  Proxy -->|"Atomic write (last 10)"| Store["~/.eyedom/ (latest.md, latest.json, history.json)"]
  Store -->|"MCP stdio (EADDRINUSE-safe)"| Agents["Claude Code · Antigravity · Cursor · Windsurf · VS Code · Codex · OpenCode · Zed"]
  Store -->|"eyedom latest | ..."| CLI["Aider & Shell Pipelines"]

CLI Reference

Command

Description

eyedom setup [--all]

Auto-detect and connect EyeDOM MCP to all installed AI CLIs & IDEs. Pass --all to generate configs for all supported tools.

eyedom open <url> [--no-open]

Launch a same-origin local reverse proxy with EyeDOM auto-injected and open it in your default browser.

eyedom start

Start the minimal local workspace and HTTP receiver at http://127.0.0.1:4789.

eyedom mcp

Run the standard stdio MCP server (automatically falls back to file-backed mode if port 4789 is already occupied).

eyedom latest [--json]

Print the latest captured DOM bug to stdout (eyedom latest | claude).

eyedom list

Print a Markdown summary table of the last 10 captures.

eyedom status

Check if the local EyeDOM server is running.

eyedom clear

Clear all captures from memory and ~/.eyedom/.


MCP Tools

Tool

Parameters

Description

get_latest_dom_bug

none

Returns the full Markdown report for the most recently captured element.

list_dom_captures

none

Lists a summary table (ID, timestamp, URL, selector, overflow flags) of the last 10 captures.

get_dom_capture_by_id

{ id: string }

Returns the full Markdown report for a specific capture ID.

clear_dom_captures

none

Clears all stored capture history from memory and ~/.eyedom/.


HTTP API (127.0.0.1:4789)

  • GET / — Minimal local EyeDOM workspace (URL launcher, live captures, Markdown viewer, one-click Connect Agents)

  • POST /api/proxy — Launches a same-origin reverse proxy for { "url": "..." }

  • POST /api/setup — Runs auto-setup for all detected local AI agents

  • GET /eyedom.js — Standalone Shadow DOM inspector bundle

  • POST /capture — Receives and persists a DOM capture payload

  • GET /api/captures / DELETE /api/captures — List or clear stored captures

  • GET /health — Server status JSON

Environment Variables

Variable

Default

Description

EYEDOM_HOST

127.0.0.1

Bind host for the local HTTP server and proxies

EYEDOM_PORT

4789

Port for the main EyeDOM workspace and receiver

EYEDOM_DIR

~/.eyedom

Storage directory for latest.md, latest.json, and history.json


Privacy & Security

  • 100% Local: EyeDOM binds exclusively to 127.0.0.1 by default.

  • Zero Telemetry: No analytics, no cloud relay, no external API calls.

  • Atomic Local Storage: Captures are written only to ~/.eyedom/ on your machine and cleared anytime with eyedom clear.


FAQ

My AI agent doesn't see EyeDOM tools right after eyedom setup. Restart your AI CLI or IDE session once so it reloads its MCP server configuration.

Can I run Claude Code, Antigravity, and Cursor at the same time? Yes. The first process binds to 127.0.0.1:4789; every additional eyedom mcp instance detects EADDRINUSE and silently reads the shared atomic store in ~/.eyedom/.

Does it work on websites with strict CSP or HTTPS? Yes. eyedom open <url> proxies the target site on 127.0.0.1, strips CSP headers, and serves both the inspector script and capture endpoint on the same origin.


Development & Contributing

git clone https://github.com/cosmicrouter/eyedom.git
cd eyedom
npm install
npm test

Pull requests and issues are welcome. Please run npm test before submitting changes.

License

MIT © 2026 cosmicrouter

Available Tools

4 tools
clear_dom_capturesA

Clears all stored EyeDOM capture history from memory and ~/.eyedom/.

Inputs: no named parameters.

get_dom_capture_by_idA

Returns the full Markdown DOM/CSS/layout bug report for a specific capture ID from list_dom_captures.

Inputs: id (required).

get_latest_dom_bugA

Returns the most recently captured broken DOM element from EyeDOM (HTML, computed CSS, bounding box, overflow flags, parent layout context, React/Vue component name, and last 5 console errors) in clean Markdown.

Inputs: no named parameters.

list_dom_capturesA

Lists a concise summary (ID, timestamp, URL, selector, overflow flags) of the last 10 captured DOM elements.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct role: fetch the newest capture, enumerate recent captures, fetch one capture by ID, and wipe history. The only near-overlap (get_latest_dom_bug vs get_dom_capture_by_id) is made explicit by the names and descriptions, so selection is unambiguous.

    Naming Consistency4/5

    All four names follow a snake_case verb_noun pattern (get_/list_/clear_ + dom resource). The only wrinkle is vocabulary drift between 'dom_bug', 'dom_capture', and 'dom_captures' for what is effectively the same object, but the pattern itself is predictable.

    Tool Count4/5

    Four tools is a tight, well-scoped surface for a passive capture-inspection server where the browser extension does the capturing. It is slightly lean — no per-capture deletion or filtering — but nothing feels redundant or padded.

    Completeness4/5

    The read lifecycle (latest, list, get-by-ID) plus a bulk clear covers the core workflow with no dead ends. Minor gaps exist: no delete of an individual capture, no search/filter by URL or selector, and no way to distinguish 'clear history' from 'reset state' beyond the single bulk operation.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server and Chrome extension that allows users to select browser DOM elements via a keyboard shortcut to provide detailed technical context to AI coding tools. It captures HTML attributes, CSS styles, and React component metadata, enabling agents to analyze and modify web elements directly.
      599
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Human-to-AI code review bridge. Annotate UI elements in the browser with review comments, and AI agents read the feedback via MCP to fix code automatically — with full element context (CSS selector, styles, DOM path, accessibility info). 10 MCP tools, framework-agnostic Web Component, zero-config install via uvx.
      9
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to monitor and debug browser runtime errors, console logs, and page diagnostics in real time via a Chrome extension and local MCP server.
      4
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables visual annotation on web pages for Claude Code, allowing element selection, comment addition, screenshot capture, and structured UI feedback for code fixes via an MCP server.
      MIT