relay-inspect
Provides 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.
README
<img src="logo.svg" width="128" height="128" alt="Relay Inspect">
Stop copying and pasting console logs, server errors and screenshots into your CLI. Relay Inspect gives your AI coding agent direct access to your browser—so it can see what you see, verify its own changes, and debug without asking you to copy and paste.
Relay Inspect is a lightweight tool for designers and engineers who want to spend more time building and less time debugging.
┌─ Chrome (CDP over WebSocket)
AI Coding Agent ←→ Relay Inspect (MCP over stdio) ─┤
└─ Dev Servers (child processes)
Relay Inspect is a bridge between the Chrome DevTools Protocol, your dev server and your agent. It exposes browser state as MCP tools—console output, network requests, DOM queries and screenshots. Your agent edits code, the dev server hot reloads, and the agent verifies the result itself.
Looking for annotations? The browser annotation overlay has moved to its own package: Annoku.
Why Relay Inspect over Chrome DevTools MCP?
Google's Chrome DevTools MCP is a full browser automation tool—it clicks buttons, fills forms, runs Lighthouse audits, and scripts interactions. Relay Inspect gives agents continuous visibility while they work, so mistakes get caught in the moment, not at the end.
- Gives agents eyes. Real-time access to console output, network requests, and DOM state — so your agent sees what's happening as it happens, not after it's already moved on.
- Tight feedback loop. The edit → reload → verify cycle happens in a single turn. Your agent makes a change, waits for the dev server to reload, and immediately confirms it worked—without additional back-and-forth.
- Focused tools, fewer wrong turns. A handful of purpose-built tools means your agent reaches for the right one rather than thrashing through a broad API surface. Less noise, more signal.
- Zero overhead, zero telemetry. Connects lazily on the first tool call—no Puppeteer, no phoning home. Nothing runs until your agent needs it.
Tools
Your agent gets access to the following tools automatically via MCP:
Browser Inspection
| Tool | Description | Key Parameters |
|---|---|---|
evaluate_js |
Execute a JavaScript expression in the browser and return the result | expression (string) |
get_console_logs |
Return buffered console output (logs, warnings, errors) | clear (bool, default: true) |
get_network_requests |
Return captured network requests and responses | filter (URL substring), clear (bool, default: true) |
get_network_request_detail |
Get full request/response body for a specific network request | requestId (string, from get_network_requests) |
get_elements |
Query the DOM with a CSS selector and return matching elements' outer HTML | selector (string), limit (number, default: 10) |
take_screenshot |
Capture a screenshot of the current page | format (png/jpeg, default: png), quality (0-100, jpeg only) |
Page Control
| Tool | Description | Key Parameters |
|---|---|---|
reload_page |
Reload the current page (optionally bypass cache) | ignoreCache (bool, default: false) |
wait_and_check |
Wait N seconds then return new console output captured during the wait | seconds (number, default: 2) |
connect_to_page |
Switch to a specific Chrome page target by ID or URL match | id (string) OR urlPattern (string), waitForMs (number) |
navigate_to |
Navigate the current page to a new URL | url (string) |
Server Management
| Tool | Description | Key Parameters |
|---|---|---|
start_server |
Start a dev server or background process and capture its output | id (string), command (string), args (string[]), cwd (string), env (object), optional urlPattern + connectWaitForMs |
get_server_logs |
Read stdout/stderr output from a managed server process | id (string), clear (bool, default: true) |
stop_server |
Stop a running managed server process | id (string) |
list_servers |
List all managed server processes and their status | — |
Diagnostics
| Tool | Description | Key Parameters |
|---|---|---|
check_connection |
Check Chrome connection status and diagnose issues (does not auto-launch) | — |
Setup
Prerequisites
- Node.js 20+
- Chrome (or any Chromium-based browser)
Add to your MCP client
No install required — npx downloads and runs the package on first use.
Claude Code — add to .mcp.json or .claude/settings.json:
{
"mcpServers": {
"relay-inspect": {
"command": "npx",
"args": ["-y", "relay-inspect"]
}
}
}
Codex CLI:
codex mcp add relay-inspect -- npx -y relay-inspect
opencode — add to opencode.json:
{
"mcp": {
"relay-inspect": {
"type": "local",
"command": "npx",
"args": ["-y", "relay-inspect"]
}
}
}
Chrome is auto-launched on first tool call if it isn't already running. To disable this or customize behavior, see Configuration below.
Configuration
| Environment Variable | Default | Description |
|---|---|---|
CHROME_DEBUG_PORT |
9222 |
Chrome debugging port |
CHROME_DEBUG_HOST |
localhost |
Chrome debugging host |
CHROME_AUTO_LAUNCH |
true |
Auto-launch Chrome if not already running |
CHROME_PATH |
(auto-detect) | Override Chrome/Chromium executable path |
CHROME_LAUNCH_URL |
(none) | URL to open when Chrome is auto-launched (e.g. http://localhost:1420) |
CDP_WS_URL |
(none) | Connect directly to a CDP WebSocket URL, skipping Chrome discovery |
CONSOLE_BUFFER_SIZE |
500 |
Max console entries to buffer |
NETWORK_BUFFER_SIZE |
200 |
Max network requests to buffer |
SERVER_LOG_BUFFER_SIZE |
1000 |
Max log entries per managed server |
If Chrome is already running with --remote-debugging-port, Relay Inspect will connect to it directly without launching a new instance.
Development
git clone https://github.com/samsolomon/relay-inspect.git
cd relay-inspect
npm install
npm run dev # Run with tsx (auto-recompile)
npm run build # Build with tsup
npm start # Run the built bundle
npm test # Run tests with vitest
For detailed architecture, conventions, and CDP implementation notes, see CLAUDE.md.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。