DOMRay MCP Server
OfficialGenerates runnable Cypress E2E test specs from recorded user actions and network events, turning captured browser interactions into test blueprints.
Connects to live Google Chrome browser sessions through a Manifest V3 extension and Chrome DevTools Protocol, streaming runtime telemetry such as DOM state, user interactions, console errors, network activity, and client-side state into MCP.
Synthesizes Mock Service Worker v2 handlers from captured failed HTTP 4xx/5xx network transactions to support API mocking.
Inspects React 18/19 Fiber trees, unrolling hooks such as useState and useReducer plus props to expose live component state for debugging runtime issues.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@DOMRay MCP Serverinspect my current browser tab and write a Playwright test for this bug"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DOMRay β‘

The Missing Runtime Telemetry Bridge for AI Coding Agents.
Give your AI assistants (Cursor, Claude Code, Antigravity, Windsurf) real-time vision into active browser sessions β including web pages behind SSO, 2FA, VPNs, and dynamic client-side state β via standard Model Context Protocol (MCP).
π The Problem: The Runtime Blindspot of AI Coding
AI coding agents have revolutionized software development. Tools like Cursor, Claude Code, Windsurf, and Copilot understand your static codebase, git history, syntax trees, and type definitions with astonishing precision.
However, the moment your application runs in a browser, your AI coding agent becomes completely blind.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β THE RUNTIME GAP β
β β
β Static World (AI has 100% Context): β
β β Source Code & Git History β
β β Abstract Syntax Trees & Types β
β β Project Files & Dependencies β
β β
β =================== BLIND SPOT ===================== β
β β
β Runtime World (AI has 0% Context): β
β β Pages behind SSO, 2FA, VPNs, or Staging Auth β
β β Real-time React / Vue internal component state β
β β Causal user interaction sequences (Breadcrumbs) β
β β Failed API responses and HTTP 4xx/5xx payloads β
β β Console warnings and client storage (session/local) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββWhere Current Practices Fail:
The Authentication & Security Wall (SSO / 2FA / Staging):
Autonomous headless agents (e.g. Puppeteer/Playwright scripts) cannot log into internal staging environments, corporate VPNs, or apps protected by Okta/Google 2FA without complex credential passing or unsafe cookie sharing.The "Manual Copy-Paste" Tax:
When a bug occurs, developers waste time opening DevTools, copying messy stack traces, exporting HAR network logs, taking screenshots, and hand-crafting prompts for their AI. By the time the context is assembled, critical temporal details are lost.Silent State Bugs (No Errors Thrown):
Many of the hardest frontend bugs don't throw an uncaught exception (e.g. "The submit button is permanently stuck on 'Applying...', no error is in the console, and the cart total didn't change"). Static code analysis cannot tell the AI whetherisSubmittingin React Fiber or a Vuerefis currently stuck attrue.The Automated Testing Disconnect:
After discovering and manually reproducing a bug in the browser, translating that discovery into resilient, production-ready Playwright/Cypress E2E specs or MSW API mock handlers requires another round of manual, error-prone boilerplate coding.
Related MCP server: @nimbus21.ai/chrome-devtools-mcp
π‘ The Solution: DOMRay
DOMRay bridges the gap between your active browser runtime and your AI coding agent.
Instead of trying to automate a separate, detached browser instance, DOMRay connects directly to the living, authenticated browser tab you are already using as a developer.
Using the Chrome DevTools Protocol (CDP) and the open Model Context Protocol (MCP), DOMRay securely streams structured runtime telemetry into your AI agent's tool context while providing you with 100% visibility through a native Chrome Side Panel.
+-----------------------------------------------------------------------------------------+
| DOMRay WORKFLOW |
| |
| 1. DEVELOPER INTERACTS 2. DOMRAY CAPTURES 3. AI AGENT REPAIRS |
| |
| ββββββββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββ |
| β Authenticated Browser β β DOMRay Extension β β AI Agent (MCP) β |
| β (SSO / 2FA Active) β ββββββ> β - User Actions β ββββββ> β Cursor / Claude β |
| β User clicks "Apply", β β - Failed Network β β Queries state, β |
| β button freezes! β β - Fiber State β β generates fix & β |
| ββββββββββββββββββββββββββ β - Edge Redaction β β E2E test specs! β |
| βββββββββββββββββββββ βββββββββββββββββββ |
+-----------------------------------------------------------------------------------------+What DOMRay Gives You & Your AI:
π Zero-Friction Context: Your AI can inspect runtime exceptions, network request histories, and client storage on demand.
π±οΈ Causal Flow Reconstruction: Replays the exact sequence of clicks, form entries, and SPA navigations that triggered an issue.
βοΈ Framework State X-Ray: Traverses React 18/19 Fiber trees (hooks unrolled into
useState,useReducer, props) and Vue 3 reactiveref()/computed()components.π¬ Instant E2E Test Blueprints (
domray_get_test_blueprint): Converts recorded user actions and network events directly into runnable, resilient Playwright or Cypress test specs.π Auto MSW Mock Handlers (
domray_get_mock_handlers): Automatically synthesizes Mock Service Worker v2 handlers from real failed HTTP 4xx/5xx network transactions.π 1-Click AI Context Capsule: Copies an edge-redacted, Markdown-formatted diagnostic report to your clipboard for instant pasting into web ChatGPT, Claude, or GitHub Issues.
ποΈ Architecture & Technology Stack
DOMRay is built as a lightweight, local-first monorepo designed for performance and zero cognitive overhead.
[Target Web Page (SSO / 2FA / Strict CSP)]
β
βββ User Interaction Tracker (Content Script)
β βββ Captures: clicks, inputs, submits, SPA route changes
β βββ W3C Accessible Name resolution (label[for], aria-labelledby)
β
β (Chrome DevTools Protocol - CDP via chrome.debugger)
βΌ
[Chrome Extension (Manifest V3)]
βββ Service Worker
β βββ CDP Client (Runtime.enable, Network.enable, consoleAPICalled)
β βββ In-Memory Ring Buffers (Errors, Network, Breadcrumbs, Console)
β βββ Edge Redaction Engine (Masks Authorization, Cookie, Passwords BEFORE dispatch)
β βββ WebSocket Client (Loopback with keepalive heartbeat)
βββ Popup UI (1-Click Auto-Pairing, Re-attach, Quick Actions)
βββ π₯οΈ Live Telemetry & AI Audit Side Panel (chrome.sidePanel)
βββ π€ Live AI Audit Feed (Watches agent tool queries in real time)
βββ π΄ Exceptions, Stack Traces & Live User Breadcrumbs
βββ π― Visual Element Inspector (Hover highlighter & component name)
βββ π§Ή 1-Click State & Buffer Reset Control
β
β Localhost Loopback (ws://127.0.0.1:9123)
β Auth: Origin Validation + Ephemeral Cryptographic Token
βΌ
[Local DOMRay MCP Server (Node.js/TypeScript)]
βββ Hybrid HTTP + WebSocket Bridge
β βββ POST /pair (Zero-config 1-click handshake & origin registration)
β βββ WS Inbound/Outbound (Telemetry streams + Bidirectional DOM/State queries)
βββ Session Store (Ring buffers, active tab tracking, callback registry)
βββ Semantic DOM Sanitizer & Token Pruner (-85% LLM token consumption)
βββ MCP stdio Transport (JSON-RPC 2.0 over stdin/stdout)
β
βΌ
[AI Coding Agent (Cursor / Claude Code / Antigravity / Windsurf)]
βββ Standard MCP Tools (10 specialized tools)Technologies Used:
Protocol Standard: Model Context Protocol (MCP) via
@modelcontextprotocol/sdk.Browser Automation & Telemetry: Chrome DevTools Protocol (
chrome.debuggerAPI) under Manifest V3.UI & Developer Experience: Chrome native
chrome.sidePanelfor docked, persistent telemetry monitoring.Testing & Mocks: Playwright for resilient E2E automation and MSW v2 for API mocking.
Core Languages: 100% TypeScript with strict typing, bundled with
tsupandesbuild.
π‘οΈ Enterprise Security, Privacy & Zero-Data-Leak Guarantees
DOMRay was architected from day one for strict corporate environments, regulated data, and internal staging applications:
π 100% Local-First (No Cloud, No Third Parties):
DOMRay has zero external servers. Telemetry never leaves your local machine (127.0.0.1). There are no analytics, no tracking, and no external API dependencies.π‘οΈ Edge-Side Redaction Engine:
Data masking occurs inside the browser extension before dispatching over the local WebSocket:Sensitive HTTP headers (
Authorization,Cookie,Set-Cookie,X-API-Key) are replaced with***MASKED***.Sensitive URL query parameters (
token,password,secret,key) are automatically scrubbed.Form inputs (
type="password",data-private, card numbers, CVVs) never leak their values into breadcrumbs.
π Origin Validation & CSWSH Protection:
The local WebSocket bridge rejects any connection whoseOriginheader is not an authorizedchrome-extension://<EXTENSION_ID>. Regular web pages and external domains are immediately rejected with HTTP 403.π Ephemeral Cryptographic Tokens:
Every time the MCP server starts, it generates a cryptographically random 32-byte session token validated viacrypto.timingSafeEqual.ποΈ 100% Transparent AI Audit Feed:
Through the native Chrome Side Panel, developers see a live feed of every tool call the AI executes, including tool parameters, timestamp, and returned payloads. You are never left wondering what data the AI requested.
β‘ Quick Start
1. Clone and Build
# Clone the repository
git clone https://github.com/bishoku/domray.git
cd domray
# Install dependencies across monorepo workspaces
npm install
# Build both the MCP server and the Chrome Extension
npm run build2. Load the Extension into Google Chrome
Navigate to
chrome://extensionsin Chrome.Enable Developer mode (toggle in the top-right corner).
Click Load unpacked and select the directory:
domray/extension/dist/The DOMRay icon will appear in your Chrome toolbar. Pin it for quick access.
3. Configure Your AI Coding Agent
Add DOMRay to your AI agent's MCP configuration:
For Cursor (~/.cursor/mcp.json or Cursor Settings > Features > MCP):
{
"mcpServers": {
"domray": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/domray/mcp-server/dist/index.js"]
}
}
}For Claude Code (claude_desktop_config.json or project config):
{
"mcpServers": {
"domray": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/domray/mcp-server/dist/index.js"]
}
}
}4. Connect & Trace
Open your web application (or run our example playground:
npm run dev:example).Click the DOMRay extension icon in Chrome and click β‘ Auto-Connect (connects in 1 click).
Click Attach Debugger to begin capturing runtime telemetry.
Click π₯οΈ Open Side Panel to watch live telemetry and the AI audit stream side-by-side with your app!
π§° MCP Tools Reference (10 Tools)
DOMRay exposes 10 tools to connected AI coding agents:
Tool | Description | Key Parameters |
| Returns active tab URL, page title, uptime, and telemetry buffer counters. | None |
| Returns the latest unhandled runtime exception, call stack, and preceding causal breadcrumbs. |
|
| Interleaves user clicks, form submissions, network calls, and console logs into a unified chronological replay. |
|
| π¬ Synthesizes runnable Playwright or Cypress E2E test specs from recorded interactions and API calls. |
|
| π Synthesizes MSW v2 mock request handlers directly from recorded 4xx/5xx API transactions. |
|
| Traverses React 18/19 Fiber or Vue 3 reactive trees to extract props and hooks ( |
|
| Returns an intelligent, token-pruned (-85% tokens) HTML subtree for a given CSS selector. |
|
| Returns recent HTTP transactions (status, duration, method, response bodies for errors). |
|
| Returns live browser console logs ( |
|
| Reads |
|
π Real-World Playground Example
We include a standalone React 18 application in examples/checkout-app simulating an enterprise checkout page behind SSO:
# Start the example checkout app (runs on http://localhost:5173)
npm run dev:example
# Run the DOMRay-generated Playwright E2E test suite
npm run test:example:e2eThe Scenario: A checkout screen with simulated SSO 2FA session tokens.
The Bug: Applying coupon
EXPIRED20triggers an HTTP 422 error. Due to a state bug inCouponForm.tsx,isSubmittingnever resets, permanently freezing the button without throwing an error in the console.Try it with your AI:
"The checkout apply button is permanently frozen. Can you inspect the active tab with DOMRay, diagnose the issue, and provide a fix and automated test?"
π€ Contributing to DOMRay
We believe that the future of software development lies in empowering AI assistants with real, high-fidelity runtime awarenessβwithout sacrificing developer privacy or enterprise security.
DOMRay is an open-source, community-driven project, and we warmly welcome contributions from frontend developers, AI enthusiasts, and tool builders alike!
How You Can Help:
β Star the Repository: If DOMRay helps your daily workflow, star the repo to help other developers discover it!
π§© Expand Framework State Inspectors: Help us build deeper extractors for Svelte 5 runes, Angular signals, SolidJS stores, or Zustand / Redux slices.
π§ͺ Improve Testing Blueprints: Add support for Vitest Component Testing, Jest, or custom locator strategies.
π Report Issues & Ideas: Found an edge case or have a vision for a new MCP tool? Open an Issue or start a discussion.
π Submit Pull Requests: Check out open issues, fork the repo, and submit your PRs. We strive to review and merge community contributions promptly.
Please feel free to explore the codebase, test it with your favorite coding agents, and share your thoughts. Let's make AI-assisted frontend development faster, smarter, and context-aware together!
π License
DOMRay is open-source software licensed under the MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
Live browser debugging for AI assistants β DOM, console, network via MCP.
A paid remote MCP for AI agent browser DevTools MCP, built to return verdicts, receipts, usage logs,
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
A paid remote MCP for AI agent browser MCP session, built to return verdicts, receipts, usage logs,
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server for browser debugging, inspection, and verification that streams console logs, network errors, and user actions into AI coding assistants.65AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceLets AI coding agents control and inspect a live Chrome browser via MCP, providing Chrome DevTools capabilities for automation, debugging, and performance analysis.17 npmApache 2.0
- AlicenseAqualityBmaintenanceEnables 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.4MIT
- AlicenseAqualityDmaintenanceProvides AI coding agents real-time browser access to console logs, network requests, DOM elements, and screenshots via MCP, enabling tight edit-reload-verify feedback loops.157 npm2MIT