Provides extensive tools for auditing computed styles, managing custom variables, and analyzing typography and color palettes across web pages.
Enables comparing live UI elements against Figma design specifications to calculate similarity scores and generate actionable CSS fixes.
Supports design consistency checks by comparing live web elements with specifications from Penpot.
Allows for visual QA by comparing browser-rendered components against Sketch design requirements to identify styling discrepancies.
Click on "Install 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., "@mcp-browser-lensanalyze the accessibility of the current page and list any ARIA issues"
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.
How It Works
Browser Lens connects your IDE's AI agent to any running web page through a lightweight bookmarklet. No browser extensions, no code changes, no build step — just click and inspect.
The flow:
Bookmarklet runs in your browser, capturing DOM, CSS, layout, screenshots, and more
WebSocket streams data in real-time to the Browser Lens MCP server (
:3203)MCP server stores and indexes everything, exposes 22 tools, 12 resources, 5 prompts
IDE AI agent queries tools via stdio to inspect, compare, and fix your UI
What Gets Captured
Category | Data | Details |
DOM | Full tree + element details | Tags, classes, attributes, text, semantic structure, headings, landmarks |
CSS | Computed styles | Every CSS property for any element, applied classes, matched rules |
CSS | Variables | All |
CSS | Typography | Font families, sizes, weights, line-heights — grouped with usage counts |
CSS | Colors | Text, background, border colors with hex values and occurrence counts |
Layout | Box model | Width, height, padding, margin, border, content dimensions |
Layout | Flex & Grid | Direction, wrap, gap, template columns/rows, child positioning |
Layout | Spacing | Margin/padding analysis across elements, spacing scale, inconsistencies |
Visual | Screenshots | Viewport capture as PNG (base64), returned directly as image to IDE |
Visual | Figma comparison | Compare any element against design specs — score + per-property diff |
A11y | Accessibility | ARIA labels, roles, alt text, heading levels, landmarks, issues |
Responsive | Viewport | Dimensions, device pixel ratio, active media queries, breakpoint status |
Mutations | DOM changes | Attribute modifications, added/removed nodes — real-time via MutationObserver |
Quick Start
Step 1 — Configure your IDE
File: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
"mcpServers": {
"mcp-browser-lens": {
"command": "npx",
"args": ["-y", "browser-lens-mcp@latest"]
}
}
}File: .vscode/mcp.json (project) or User Settings (global)
{
"servers": {
"mcp-browser-lens": {
"type": "stdio",
"command": "npx",
"args": ["-y", "browser-lens-mcp@latest"]
}
}
}Run once — adds to ~/.claude.json:
claude mcp add mcp-browser-lens npx -y browser-lens-mcp@latestFile: ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-browser-lens": {
"command": "npx",
"args": ["-y", "browser-lens-mcp@latest"]
}
}
}File: .opencode/config.json or ~/.config/opencode/config.json
{
"mcpServers": {
"mcp-browser-lens": {
"command": "npx",
"args": ["-y", "browser-lens-mcp@latest"]
}
}
}File: ~/.config/zed/settings.json
{
"context_servers": {
"mcp-browser-lens": {
"command": {
"path": "npx",
"args": ["-y", "browser-lens-mcp@latest"]
}
}
}
}The server communicates via stdio transport. Run:
npx browser-lens-mcp@latestConnect your MCP client to the process stdin/stdout.
Step 2 — Connect your browser
Open http://localhost:3202 in your browser
Drag the bookmarklet to your bookmarks bar
Navigate to any web app
Click the bookmarklet — you'll see in the console:
[Browser Lens] WebSocket connected
[Browser Lens] Connected! DOM, CSS, layout, and visual data streaming to IDE.Step 3 — Ask your AI agent
@mcp-browser-lens Describe this page's UI layout and structure
@mcp-browser-lens Compare .hero-button with Figma: fontSize 16px, fontWeight 600, backgroundColor #8b5cf6
@mcp-browser-lens Take a screenshot and audit the design
@mcp-browser-lens What CSS variables are defined on this page?
@mcp-browser-lens Show me all accessibility issues
@mcp-browser-lens Suggest CSS fixes for the last comparisonFigma Design Comparison
The killer feature — compare your live UI against any design tool's specs and get actionable CSS fixes.
How to use:
1. Connect browser to your app (bookmarklet)
2. Ask: "Compare .hero-button with Figma: fontSize 16px, fontWeight 600, backgroundColor #8b5cf6, borderRadius 8px"
3. Get: Score 84/100 with 3 property diffs (1 major, 2 minor)
4. Ask: "Suggest CSS fixes" → get copy-paste CSS
5. Apply fixes → re-compare → Score 98/100 ✓Scoring:
Score | Status | Meaning |
95–100 |
| Pixel-perfect — ship it |
80–94 |
| Close — small CSS tweaks needed |
50–79 |
| Significant gaps — fixes required |
0–49 |
| Major rework needed |
Works with any design tool — Figma, Sketch, Adobe XD, Zeplin, Penpot. Just provide the expected CSS values.
MCP Tools (22)
DOM Inspection (5 tools)
Tool | Description |
| Full DOM tree with semantic structure analysis |
| Complete element details: DOM + styles + layout + a11y |
| Search DOM by tag, class, ID, or CSS selector |
| Parent → child path from root to any element |
| Overview of all captured elements with dimensions |
CSS Analysis (4 tools)
Tool | Description |
| All computed CSS properties for any element |
| CSS custom properties ( |
| Font families, sizes, weights — grouped with usage counts |
| All colors (text, bg, border) with hex + occurrence count |
Layout & Spacing (3 tools)
Tool | Description |
| Box model, flex/grid info, positioning details |
| Margin/padding/gap analysis + spacing scale detection |
| Viewport, DPR, breakpoints, active media queries |
Visual & Screenshots (3 tools)
Tool | Description |
| Latest viewport screenshot — returned as PNG image |
| List all captured screenshots with metadata |
| AI-friendly page description: structure, colors, fonts, a11y |
Design Comparison (3 tools)
Tool | Description |
| Compare element vs design specs → score + per-property diff |
| All previous comparison results |
| Generate copy-paste CSS from comparison diff |
General (4 tools)
Tool | Description |
| Page URL, viewport, element count, data availability |
| Recent DOM changes (attributes, added/removed nodes) |
| ARIA labels, roles, headings, landmarks, issues |
| Clear all captured data |
MCP Prompts (5)
Prompt | Description |
| Guided Figma comparison workflow with fix suggestions |
| Comprehensive UI audit: colors, typography, spacing, a11y |
| Detailed page description for AI-assisted modifications |
| Prioritized fix list from comparisons + a11y + spacing |
| Visual QA check: screenshot + compare + pass/fail report |
MCP Resources (12)
URI | Description |
| Full DOM tree snapshot |
| Captured element selectors |
| Recent DOM changes |
| CSS custom properties |
| Typography analysis |
| Color palette data |
| Viewport & breakpoint info |
| Spacing analysis |
| Screenshot metadata |
| Accessibility audit results |
| Comparison results |
| Page info + data availability |
Configuration
Ports
Port | Protocol | Purpose |
| HTTP | Connector page + health endpoint + data ingestion |
| WebSocket | Real-time data streaming from browser |
Environment Variables
Variable | Default | Description |
|
| HTTP server port |
|
| WebSocket server port |
|
| Custom store file path |
Custom port example:
MCP_BROWSER_LENS_PORT=4000 MCP_BROWSER_LENS_WS_PORT=4001 npx browser-lens-mcpLicense
MIT — see LICENSE
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.