ui-annotator-mcp

ui-annotator-mcp

MCP server that annotates any web page with hover labels — zero extensions, works in any browser

Category
访问服务器

README

UI Annotator MCP

npm version license GitHub stars GitHub forks

English | 廣東話

See what every UI element is called — in any browser, zero extensions.

An MCP server that adds interactive hover annotations to any web page. Open a proxied URL, hover any element, see its name. Tell your AI assistant "make the sidebar wider" — it knows exactly what you mean.

Demo

The Problem

When reviewing a web UI with an AI coding assistant, the hardest part isn't the code change — it's describing which element you want changed.

"That thing on the left... the second row... no, the one with the icon..."

You don't know what it's called. The AI doesn't know what you're pointing at. You waste time on miscommunication instead of shipping.

The Solution

Open your page through the annotator proxy. Hover any element — instantly see its name, CSS selector, and dimensions. Now you both speak the same language.

# Start the MCP server
npx @mcpware/ui-annotator

# Open in ANY browser
http://localhost:7077/localhost:3847

That's it. No browser extensions. No code changes. No setup. Works in Chrome, Firefox, Safari, Edge — any browser.

How It Works

Your app (localhost:3847)
        │
        ▼
┌─────────────────────┐
│  UI Annotator Proxy  │ ← Reverse proxy on port 7077
│  (MCP Server)        │
└─────────────────────┘
        │
        ▼
Proxied page with hover annotations injected
        │
        ├──► User sees: hover overlay + tooltip with element names
        └──► AI sees: structured element data via MCP tools

The proxy fetches your page, injects a lightweight annotation script, and serves it back. The script scans the DOM, identifies named elements, and reports them to the MCP server. Your AI assistant queries the server to understand what's on the page.

Features

Hover Annotations

Hover any element to see:

  • Element name (pink) — the human-readable identifier
  • CSS selector (monospace) — the technical reference
  • Content preview — what text the element contains
  • Dimensions — width × height in pixels

Inspect Mode

Click the Inspect button in the toolbar (or let your AI toggle it). In inspect mode:

  • Click any element → copies its name to clipboard
  • All page interactions are paused (clicks don't trigger buttons/links)
  • Click Inspect again to return to normal mode

Collapsible Toolbar

The toolbar sits at the top center of the page showing:

  • Inspect toggle button
  • Element count
  • Helpful subtitle explaining what to do
  • Collapse button (▲) to minimize when not needed

MCP Tools for AI

Tool What it does
annotate(url) Returns proxy URL for user to open in any browser
get_elements() Returns all detected UI elements with names, selectors, positions
highlight_element(name) Flash-highlights a specific element so user can confirm
rescan_elements() Force DOM rescan after page changes
inspect_mode(enabled) Toggle inspect mode remotely

Why Not Just Use DevTools?

Browser DevTools UI Annotator
Target user Frontend developers who know the DOM Anyone — QA, PM, designer, junior dev
Learning curve Need to understand DOM tree, CSS selectors, box model Hover and read — zero learning
Communication "The div.flex.gap-4 inside the second child of..." "The sidebar"
Language CSS/HTML technical terms Human-readable names
Setup Teach people to open DevTools + navigate the DOM Open a URL
AI integration None — AI can't see what you're inspecting MCP — AI sees the same element names you do

DevTools is for debugging. UI Annotator is for communication — giving humans and AI a shared vocabulary for UI elements.

Why Not Use Existing Tools?

Tool Approach Why we're different
MCP Pointer Chrome extension + MCP server Requires Chrome extension. Click-to-inspect, no hover overlay.
Agentation npm package embedded in your app Requires code changes. React 18+ dependency. Not zero-config.
Cursor Visual Editor Built-in IDE browser Only works inside Cursor IDE.
Windsurf Previews Built-in IDE browser Only works inside Windsurf IDE.
Chrome DevTools MCP Programmatic DOM access for AI AI can inspect, but humans don't see visual annotations.
VisBug Chrome extension for visual editing No MCP integration. No AI connection. Chrome only.
Marker.io / BugHerd SaaS visual feedback widgets Not MCP. Paid. For bug reporting, not AI-assisted development.

Feature Comparison

Feature UI Annotator MCP Pointer Agentation Cursor Chrome DevTools MCP
Visual hover annotation Yes No Partial Yes (IDE only) No
Shows element names Yes Yes Yes No (high-level) Programmatic
Shows dimensions Yes Yes Yes (Detailed) Yes Programmatic
MCP server Yes Yes Yes No Yes
Zero browser extensions Yes No Yes N/A No
Zero code changes Yes Yes No N/A Yes
Any browser Yes Chrome only Desktop only Cursor only Chrome only
Zero dependencies Yes Chrome ext React 18+ Cursor Chrome
Click to copy element name Yes No No No No

Architecture

Zero external dependencies

  • Reverse proxy: Node.js built-in http module
  • MCP server: @modelcontextprotocol/sdk (stdio transport)
  • Communication: HTTP POST (browser → server) + GET polling (server → browser)
  • No WebSocket, no Express, no browser extension

How the proxy works

  1. User requests localhost:7077/localhost:3847
  2. Proxy fetches http://localhost:3847
  3. For HTML responses:
    • Injects fetch() / XMLHttpRequest interceptor (rewrites API paths through proxy)
    • Rewrites href="/..." and src="/..." attributes to route through proxy
    • Injects annotation script before </body>
  4. For non-HTML (CSS, JS, images): passes through directly
  5. Strips Content-Security-Policy headers to allow injected script

How annotation works

  1. Script scans DOM for elements with id, class, semantic roles, or interactive roles
  2. On hover: positions overlay border (follows border-radius) + positions tooltip (always within viewport)
  3. Reports all detected elements to server via POST /__annotator/elements
  4. Polls GET /__annotator/commands every second for server instructions (highlight, rescan, inspect toggle)
  5. MutationObserver auto-rescans when DOM changes

Quick Start

With Claude Code

# Add as MCP server
claude mcp add ui-annotator -- npx @mcpware/ui-annotator

# Then in conversation:
# "Annotate my app at localhost:3847"
# → AI returns proxy URL, you open it, hover elements, discuss changes by name

Manual

npx @mcpware/ui-annotator
# Proxy starts on http://localhost:7077
# Open http://localhost:7077/localhost:YOUR_PORT

Environment Variables

Variable Default Description
UI_ANNOTATOR_PORT 7077 Port for the proxy server

More from @mcpware

Project What it does Install
Pagecast Record any browser page as GIF or video via MCP npx @mcpware/pagecast
Claude Code Organizer Visual dashboard for memories, skills, MCP servers, hooks npx @mcpware/claude-code-organizer
Instagram MCP 23 tools for the Instagram Graph API npx @mcpware/instagram-mcp

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选