browser-lens-mcp 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +341 -0
  3. package/dist/src/index.d.ts +3 -0
  4. package/dist/src/index.d.ts.map +1 -0
  5. package/dist/src/index.js +25 -0
  6. package/dist/src/index.js.map +1 -0
  7. package/dist/src/prompts/index.d.ts +4 -0
  8. package/dist/src/prompts/index.d.ts.map +1 -0
  9. package/dist/src/prompts/index.js +180 -0
  10. package/dist/src/prompts/index.js.map +1 -0
  11. package/dist/src/resources/index.d.ts +4 -0
  12. package/dist/src/resources/index.d.ts.map +1 -0
  13. package/dist/src/resources/index.js +64 -0
  14. package/dist/src/resources/index.js.map +1 -0
  15. package/dist/src/server.d.ts +4 -0
  16. package/dist/src/server.d.ts.map +1 -0
  17. package/dist/src/server.js +15 -0
  18. package/dist/src/server.js.map +1 -0
  19. package/dist/src/store/browser-store.d.ts +45 -0
  20. package/dist/src/store/browser-store.d.ts.map +1 -0
  21. package/dist/src/store/browser-store.js +240 -0
  22. package/dist/src/store/browser-store.js.map +1 -0
  23. package/dist/src/store/types.d.ts +342 -0
  24. package/dist/src/store/types.d.ts.map +1 -0
  25. package/dist/src/store/types.js +3 -0
  26. package/dist/src/store/types.js.map +1 -0
  27. package/dist/src/tools/index.d.ts +4 -0
  28. package/dist/src/tools/index.d.ts.map +1 -0
  29. package/dist/src/tools/index.js +889 -0
  30. package/dist/src/tools/index.js.map +1 -0
  31. package/dist/src/transport/connector-script.d.ts +2 -0
  32. package/dist/src/transport/connector-script.d.ts.map +1 -0
  33. package/dist/src/transport/connector-script.js +336 -0
  34. package/dist/src/transport/connector-script.js.map +1 -0
  35. package/dist/src/transport/http-receiver.d.ts +4 -0
  36. package/dist/src/transport/http-receiver.d.ts.map +1 -0
  37. package/dist/src/transport/http-receiver.js +218 -0
  38. package/dist/src/transport/http-receiver.js.map +1 -0
  39. package/dist/src/transport/ws-receiver.d.ts +4 -0
  40. package/dist/src/transport/ws-receiver.d.ts.map +1 -0
  41. package/dist/src/transport/ws-receiver.js +39 -0
  42. package/dist/src/transport/ws-receiver.js.map +1 -0
  43. package/package.json +79 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hoai Nho Nguyen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,341 @@
1
+ <div align="center">
2
+ <img src="assets/logo.svg" alt="Browser Lens" width="120" height="120">
3
+ <h1>mcp-browser-lens</h1>
4
+ <p><strong>Your browser's UI, deeply understood by your IDE's AI agent.</strong></p>
5
+ <p>
6
+ <a href="https://www.npmjs.com/package/browser-lens-mcp"><img src="https://img.shields.io/npm/v/browser-lens-mcp?style=flat-square&color=8b5cf6" alt="npm"></a>
7
+ <a href="https://www.npmjs.com/package/browser-lens-mcp"><img src="https://img.shields.io/npm/dm/browser-lens-mcp?style=flat-square&color=8b5cf6" alt="downloads"></a>
8
+ <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-Compatible-blue?style=flat-square" alt="MCP"></a>
9
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node.js-20%2B-green?style=flat-square" alt="Node"></a>
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow?style=flat-square" alt="License"></a>
11
+ </p>
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## How It Works
17
+
18
+ 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.
19
+
20
+ <div align="center">
21
+ <img src="assets/architecture-flow.svg" alt="Architecture Flow" width="100%">
22
+ </div>
23
+
24
+ **The flow:**
25
+
26
+ 1. **Bookmarklet** runs in your browser, capturing DOM, CSS, layout, screenshots, and more
27
+ 2. **WebSocket** streams data in real-time to the Browser Lens MCP server (`:3203`)
28
+ 3. **MCP server** stores and indexes everything, exposes 22 tools, 12 resources, 5 prompts
29
+ 4. **IDE AI agent** queries tools via stdio to inspect, compare, and fix your UI
30
+
31
+ ---
32
+
33
+ ## What Gets Captured
34
+
35
+ <div align="center">
36
+ <img src="assets/bookmarklet-capture.svg" alt="Bookmarklet Captures" width="100%">
37
+ </div>
38
+
39
+ | Category | Data | Details |
40
+ |----------|------|---------|
41
+ | **DOM** | Full tree + element details | Tags, classes, attributes, text, semantic structure, headings, landmarks |
42
+ | **CSS** | Computed styles | Every CSS property for any element, applied classes, matched rules |
43
+ | **CSS** | Variables | All `--*` custom properties from `:root` and stylesheets |
44
+ | **CSS** | Typography | Font families, sizes, weights, line-heights — grouped with usage counts |
45
+ | **CSS** | Colors | Text, background, border colors with hex values and occurrence counts |
46
+ | **Layout** | Box model | Width, height, padding, margin, border, content dimensions |
47
+ | **Layout** | Flex & Grid | Direction, wrap, gap, template columns/rows, child positioning |
48
+ | **Layout** | Spacing | Margin/padding analysis across elements, spacing scale, inconsistencies |
49
+ | **Visual** | Screenshots | Viewport capture as PNG (base64), returned directly as image to IDE |
50
+ | **Visual** | Figma comparison | Compare any element against design specs — score + per-property diff |
51
+ | **A11y** | Accessibility | ARIA labels, roles, alt text, heading levels, landmarks, issues |
52
+ | **Responsive** | Viewport | Dimensions, device pixel ratio, active media queries, breakpoint status |
53
+ | **Mutations** | DOM changes | Attribute modifications, added/removed nodes — real-time via MutationObserver |
54
+
55
+ ---
56
+
57
+ ## Quick Start
58
+
59
+ ### Step 1 — Configure your IDE
60
+
61
+ <details open>
62
+ <summary><strong>Cursor</strong></summary>
63
+
64
+ **File:** `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global)
65
+
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "mcp-browser-lens": {
70
+ "command": "npx",
71
+ "args": ["-y", "browser-lens-mcp@latest"]
72
+ }
73
+ }
74
+ }
75
+ ```
76
+ </details>
77
+
78
+ <details>
79
+ <summary><strong>VS Code (Copilot)</strong></summary>
80
+
81
+ **File:** `.vscode/mcp.json` (project) or User Settings (global)
82
+
83
+ ```json
84
+ {
85
+ "servers": {
86
+ "mcp-browser-lens": {
87
+ "type": "stdio",
88
+ "command": "npx",
89
+ "args": ["-y", "browser-lens-mcp@latest"]
90
+ }
91
+ }
92
+ }
93
+ ```
94
+ </details>
95
+
96
+ <details>
97
+ <summary><strong>Claude Code (Anthropic)</strong></summary>
98
+
99
+ **Run once** — adds to `~/.claude.json`:
100
+
101
+ ```bash
102
+ claude mcp add mcp-browser-lens npx -y browser-lens-mcp@latest
103
+ ```
104
+ </details>
105
+
106
+ <details>
107
+ <summary><strong>Windsurf (Codeium)</strong></summary>
108
+
109
+ **File:** `~/.codeium/windsurf/mcp_config.json`
110
+
111
+ ```json
112
+ {
113
+ "mcpServers": {
114
+ "mcp-browser-lens": {
115
+ "command": "npx",
116
+ "args": ["-y", "browser-lens-mcp@latest"]
117
+ }
118
+ }
119
+ }
120
+ ```
121
+ </details>
122
+
123
+ <details>
124
+ <summary><strong>OpenCode</strong></summary>
125
+
126
+ **File:** `.opencode/config.json` or `~/.config/opencode/config.json`
127
+
128
+ ```json
129
+ {
130
+ "mcpServers": {
131
+ "mcp-browser-lens": {
132
+ "command": "npx",
133
+ "args": ["-y", "browser-lens-mcp@latest"]
134
+ }
135
+ }
136
+ }
137
+ ```
138
+ </details>
139
+
140
+ <details>
141
+ <summary><strong>Zed</strong></summary>
142
+
143
+ **File:** `~/.config/zed/settings.json`
144
+
145
+ ```json
146
+ {
147
+ "context_servers": {
148
+ "mcp-browser-lens": {
149
+ "command": {
150
+ "path": "npx",
151
+ "args": ["-y", "browser-lens-mcp@latest"]
152
+ }
153
+ }
154
+ }
155
+ }
156
+ ```
157
+ </details>
158
+
159
+ <details>
160
+ <summary><strong>Any MCP-compatible client</strong></summary>
161
+
162
+ The server communicates via **stdio** transport. Run:
163
+
164
+ ```bash
165
+ npx browser-lens-mcp@latest
166
+ ```
167
+
168
+ Connect your MCP client to the process stdin/stdout.
169
+ </details>
170
+
171
+ ### Step 2 — Connect your browser
172
+
173
+ 1. Open **http://localhost:3202** in your browser
174
+ 2. **Drag** the bookmarklet to your bookmarks bar
175
+ 3. Navigate to any web app
176
+ 4. **Click** the bookmarklet — you'll see in the console:
177
+
178
+ ```
179
+ [Browser Lens] WebSocket connected
180
+ [Browser Lens] Connected! DOM, CSS, layout, and visual data streaming to IDE.
181
+ ```
182
+
183
+ ### Step 3 — Ask your AI agent
184
+
185
+ ```
186
+ @mcp-browser-lens Describe this page's UI layout and structure
187
+ @mcp-browser-lens Compare .hero-button with Figma: fontSize 16px, fontWeight 600, backgroundColor #8b5cf6
188
+ @mcp-browser-lens Take a screenshot and audit the design
189
+ @mcp-browser-lens What CSS variables are defined on this page?
190
+ @mcp-browser-lens Show me all accessibility issues
191
+ @mcp-browser-lens Suggest CSS fixes for the last comparison
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Figma Design Comparison
197
+
198
+ The killer feature — compare your live UI against any design tool's specs and get actionable CSS fixes.
199
+
200
+ <div align="center">
201
+ <img src="assets/figma-comparison-flow.svg" alt="Figma Comparison Flow" width="100%">
202
+ </div>
203
+
204
+ **How to use:**
205
+
206
+ ```
207
+ 1. Connect browser to your app (bookmarklet)
208
+ 2. Ask: "Compare .hero-button with Figma: fontSize 16px, fontWeight 600, backgroundColor #8b5cf6, borderRadius 8px"
209
+ 3. Get: Score 84/100 with 3 property diffs (1 major, 2 minor)
210
+ 4. Ask: "Suggest CSS fixes" → get copy-paste CSS
211
+ 5. Apply fixes → re-compare → Score 98/100 ✓
212
+ ```
213
+
214
+ **Scoring:**
215
+
216
+ | Score | Status | Meaning |
217
+ |-------|--------|---------|
218
+ | 95–100 | `match` | Pixel-perfect — ship it |
219
+ | 80–94 | `minor-diff` | Close — small CSS tweaks needed |
220
+ | 50–79 | `major-diff` | Significant gaps — fixes required |
221
+ | 0–49 | `mismatch` | Major rework needed |
222
+
223
+ Works with **any design tool** — Figma, Sketch, Adobe XD, Zeplin, Penpot. Just provide the expected CSS values.
224
+
225
+ ---
226
+
227
+ ## MCP Tools (22)
228
+
229
+ ### DOM Inspection (5 tools)
230
+ | Tool | Description |
231
+ |------|-------------|
232
+ | `get_dom_tree` | Full DOM tree with semantic structure analysis |
233
+ | `inspect_element` | Complete element details: DOM + styles + layout + a11y |
234
+ | `query_selector` | Search DOM by tag, class, ID, or CSS selector |
235
+ | `get_element_hierarchy` | Parent → child path from root to any element |
236
+ | `get_elements_summary` | Overview of all captured elements with dimensions |
237
+
238
+ ### CSS Analysis (4 tools)
239
+ | Tool | Description |
240
+ |------|-------------|
241
+ | `get_computed_styles` | All computed CSS properties for any element |
242
+ | `get_css_variables` | CSS custom properties (`--*`) with current values |
243
+ | `get_typography` | Font families, sizes, weights — grouped with usage counts |
244
+ | `get_color_palette` | All colors (text, bg, border) with hex + occurrence count |
245
+
246
+ ### Layout & Spacing (3 tools)
247
+ | Tool | Description |
248
+ |------|-------------|
249
+ | `get_layout_info` | Box model, flex/grid info, positioning details |
250
+ | `get_spacing_analysis` | Margin/padding/gap analysis + spacing scale detection |
251
+ | `get_responsive_info` | Viewport, DPR, breakpoints, active media queries |
252
+
253
+ ### Visual & Screenshots (3 tools)
254
+ | Tool | Description |
255
+ |------|-------------|
256
+ | `get_page_screenshot` | Latest viewport screenshot — returned as PNG image |
257
+ | `get_all_screenshots` | List all captured screenshots with metadata |
258
+ | `describe_ui` | AI-friendly page description: structure, colors, fonts, a11y |
259
+
260
+ ### Design Comparison (3 tools)
261
+ | Tool | Description |
262
+ |------|-------------|
263
+ | `compare_with_figma` | Compare element vs design specs → score + per-property diff |
264
+ | `get_comparison_history` | All previous comparison results |
265
+ | `suggest_css_fixes` | Generate copy-paste CSS from comparison diff |
266
+
267
+ ### General (4 tools)
268
+ | Tool | Description |
269
+ |------|-------------|
270
+ | `get_page_info` | Page URL, viewport, element count, data availability |
271
+ | `get_dom_mutations` | Recent DOM changes (attributes, added/removed nodes) |
272
+ | `get_accessibility_info` | ARIA labels, roles, headings, landmarks, issues |
273
+ | `clear_data` | Clear all captured data |
274
+
275
+ ---
276
+
277
+ ## MCP Prompts (5)
278
+
279
+ | Prompt | Description |
280
+ |--------|-------------|
281
+ | `compare_with_figma` | Guided Figma comparison workflow with fix suggestions |
282
+ | `audit_ui` | Comprehensive UI audit: colors, typography, spacing, a11y |
283
+ | `describe_page` | Detailed page description for AI-assisted modifications |
284
+ | `suggest_fixes` | Prioritized fix list from comparisons + a11y + spacing |
285
+ | `visual_qa` | Visual QA check: screenshot + compare + pass/fail report |
286
+
287
+ ---
288
+
289
+ ## MCP Resources (12)
290
+
291
+ | URI | Description |
292
+ |-----|-------------|
293
+ | `dom://snapshot` | Full DOM tree snapshot |
294
+ | `dom://elements` | Captured element selectors |
295
+ | `dom://mutations` | Recent DOM changes |
296
+ | `css://variables` | CSS custom properties |
297
+ | `css://typography` | Typography analysis |
298
+ | `css://colors` | Color palette data |
299
+ | `layout://responsive` | Viewport & breakpoint info |
300
+ | `layout://spacing` | Spacing analysis |
301
+ | `visual://screenshots` | Screenshot metadata |
302
+ | `a11y://audit` | Accessibility audit results |
303
+ | `figma://comparisons` | Comparison results |
304
+ | `browser://page` | Page info + data availability |
305
+
306
+ ---
307
+
308
+ ## Configuration
309
+
310
+ ### Ports
311
+
312
+ | Port | Protocol | Purpose |
313
+ |------|----------|---------|
314
+ | `3202` | HTTP | Connector page + health endpoint + data ingestion |
315
+ | `3203` | WebSocket | Real-time data streaming from browser |
316
+
317
+ ### Environment Variables
318
+
319
+ | Variable | Default | Description |
320
+ |----------|---------|-------------|
321
+ | `MCP_BROWSER_LENS_PORT` | `3202` | HTTP server port |
322
+ | `MCP_BROWSER_LENS_WS_PORT` | `3203` | WebSocket server port |
323
+ | `MCP_BROWSER_LENS_STORE_PATH` | `.store/browser.json` | Custom store file path |
324
+
325
+ **Custom port example:**
326
+
327
+ ```bash
328
+ MCP_BROWSER_LENS_PORT=4000 MCP_BROWSER_LENS_WS_PORT=4001 npx browser-lens-mcp
329
+ ```
330
+
331
+ ---
332
+
333
+ ## License
334
+
335
+ MIT — see [LICENSE](LICENSE)
336
+
337
+ ---
338
+
339
+ <div align="center">
340
+ <sub>Built by <a href="https://github.com/nano-step"><strong>nano-step</strong></a> — Copyright &copy; 2026 Hoai Nho Nguyen</sub>
341
+ </div>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { BrowserStore } from "./store/browser-store.js";
4
+ import { createMcpServer } from "./server.js";
5
+ import { createHttpReceiver } from "./transport/http-receiver.js";
6
+ import { createWsReceiver } from "./transport/ws-receiver.js";
7
+ const HTTP_PORT = parseInt(process.env.MCP_BROWSER_LENS_PORT ?? "3202", 10);
8
+ const WS_PORT = parseInt(process.env.MCP_BROWSER_LENS_WS_PORT ?? "3203", 10);
9
+ const store = new BrowserStore();
10
+ const mcpServer = createMcpServer(store);
11
+ createHttpReceiver(store, HTTP_PORT, WS_PORT);
12
+ createWsReceiver(store, WS_PORT);
13
+ const transport = new StdioServerTransport();
14
+ mcpServer.connect(transport).then(() => {
15
+ process.stderr.write(`[mcp-browser-lens] MCP server connected via stdio\n`);
16
+ });
17
+ process.on("SIGINT", async () => {
18
+ await mcpServer.close();
19
+ process.exit(0);
20
+ });
21
+ process.on("SIGTERM", async () => {
22
+ await mcpServer.close();
23
+ process.exit(0);
24
+ });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;AAC5E,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;AAE7E,MAAM,KAAK,GAAG,IAAI,YAAY,EAAE,CAAC;AACjC,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAEzC,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9C,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAEjC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IAC/B,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { BrowserStore } from "../store/browser-store.js";
3
+ export declare function registerPrompts(server: McpServer, store: BrowserStore): void;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAU9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAoN5E"}
@@ -0,0 +1,180 @@
1
+ function userMsg(t) {
2
+ return {
3
+ messages: [
4
+ { role: "user", content: { type: "text", text: t } },
5
+ ],
6
+ };
7
+ }
8
+ export function registerPrompts(server, store) {
9
+ server.registerPrompt("compare_with_figma", {
10
+ title: "Compare with Figma Design",
11
+ description: "Compare the current browser page with Figma design specs — identify visual differences and suggest CSS fixes",
12
+ }, () => {
13
+ const dom = store.getDom();
14
+ const colors = store.getColors();
15
+ const typo = store.getTypography();
16
+ const elements = store.getElements();
17
+ const comparisons = store.getComparisons();
18
+ if (!dom)
19
+ return userMsg("No browser data captured. Click the bookmarklet on your app first.");
20
+ const elList = Object.keys(elements).slice(0, 15).map((k) => {
21
+ const el = elements[k];
22
+ return `- ${k}: ${el.layout?.display ?? "?"} ${Math.round(el.layout?.box.width ?? 0)}x${Math.round(el.layout?.box.height ?? 0)}, bg=${el.computedStyle?.styles.backgroundColor ?? "?"}, color=${el.computedStyle?.styles.color ?? "?"}`;
23
+ });
24
+ return userMsg([
25
+ "Compare this browser page with the Figma design. Here's the current state:\n",
26
+ `## Page: ${dom.title}`,
27
+ `URL: ${dom.url}`,
28
+ `Viewport: ${dom.viewport.width}x${dom.viewport.height}\n`,
29
+ "## Captured Elements\n" + elList.join("\n") + "\n",
30
+ colors ? `## Colors\nText: ${colors.colors.slice(0, 5).map((c) => c.hex).join(", ")}\nBackground: ${colors.backgroundColors.slice(0, 5).map((c) => c.hex).join(", ")}\n` : "",
31
+ typo ? `## Typography\n${typo.fonts.slice(0, 5).map((f) => `- ${f.family} ${f.weight} ${f.size}`).join("\n")}\n` : "",
32
+ comparisons.length > 0 ? `## Previous Comparisons\n${comparisons.slice(-3).map((c) => `- ${c.selector}: ${c.score}/100 (${c.status})`).join("\n")}\n` : "",
33
+ "\n## Instructions",
34
+ "1. Use the `compare_with_figma` tool to compare specific elements",
35
+ "2. Provide Figma specs (width, height, colors, fonts, spacing) for each element",
36
+ "3. Review the diff report — focus on critical and major differences first",
37
+ "4. Use `suggest_css_fixes` to get copy-paste CSS fixes",
38
+ "5. After fixing, re-compare to verify the score improved",
39
+ "6. Target: 95+ score for all key elements",
40
+ ].join("\n"));
41
+ });
42
+ server.registerPrompt("audit_ui", {
43
+ title: "UI Design Audit",
44
+ description: "Comprehensive audit of the page UI: colors, typography, spacing, accessibility, responsiveness",
45
+ }, () => {
46
+ const dom = store.getDom();
47
+ const colors = store.getColors();
48
+ const typo = store.getTypography();
49
+ const spacing = store.getSpacing();
50
+ const acc = store.getAccessibility();
51
+ const resp = store.getResponsive();
52
+ if (!dom)
53
+ return userMsg("No browser data captured. Click the bookmarklet on your app first.");
54
+ return userMsg([
55
+ "Perform a comprehensive UI audit on this page:\n",
56
+ `## Page: ${dom.title} (${dom.totalElements} elements)\n`,
57
+ colors ? `## Colors (${colors.totalUniqueColors} unique)\nText: ${colors.colors.slice(0, 5).map((c) => `${c.hex} (${c.count}x)`).join(", ")}\nBackgrounds: ${colors.backgroundColors.slice(0, 5).map((c) => `${c.hex} (${c.count}x)`).join(", ")}\nBorders: ${colors.borderColors.slice(0, 3).map((c) => `${c.hex} (${c.count}x)`).join(", ")}\n` : "",
58
+ typo ? `## Typography (${typo.fonts.length} combinations)\n${typo.fonts.slice(0, 8).map((f) => `- ${f.family} ${f.weight} ${f.size}/${f.lineHeight} — ${f.count} uses`).join("\n")}\n` : "",
59
+ spacing ? `## Spacing Scale: ${spacing.spacingScale.join(", ")}\nElements analyzed: ${spacing.elements.length}\n${spacing.inconsistencies.length > 0 ? "Inconsistencies: " + spacing.inconsistencies.length : "No inconsistencies detected"}\n` : "",
60
+ acc ? `## Accessibility\nInteractive: ${acc.summary.totalInteractive} (${acc.summary.withLabels} labeled)\nImages: ${acc.summary.imagesWithAlt + acc.summary.imagesWithoutAlt} total (${acc.summary.imagesWithoutAlt} missing alt)\nIssues: ${acc.summary.issues.length}\n${acc.summary.issues.slice(0, 5).map((i) => "- " + i).join("\n")}\n` : "",
61
+ resp ? `## Responsive\nViewport: ${resp.viewport.width}x${resp.viewport.height}\nDPR: ${resp.viewport.devicePixelRatio}\nActive: ${resp.activeMediaQueries.join(", ") || "none"}\n` : "",
62
+ "\n## Instructions",
63
+ "1. Rate the overall design quality (1-10) with justification",
64
+ "2. Check color consistency — are there too many unique colors?",
65
+ "3. Check typography consistency — too many font size/weight combos?",
66
+ "4. Check spacing — does it follow a consistent scale (4px, 8px, 16px...)?",
67
+ "5. Flag accessibility issues with specific fix suggestions",
68
+ "6. Note responsive readiness",
69
+ "7. Provide prioritized list of improvements",
70
+ ].join("\n"));
71
+ });
72
+ server.registerPrompt("describe_page", {
73
+ title: "Describe Page",
74
+ description: "Generate a detailed description of the page UI that an AI can use to understand and modify the design",
75
+ }, () => {
76
+ const dom = store.getDom();
77
+ if (!dom)
78
+ return userMsg("No browser data captured. Click the bookmarklet on your app first.");
79
+ const elements = store.getElements();
80
+ const elSummary = Object.keys(elements).slice(0, 20).map((k) => {
81
+ const el = elements[k];
82
+ const s = el.computedStyle?.styles ?? {};
83
+ return `- ${k}: ${el.layout?.display ?? "block"} | ${Math.round(el.layout?.box.width ?? 0)}x${Math.round(el.layout?.box.height ?? 0)} | bg:${s.backgroundColor ?? "none"} | color:${s.color ?? "inherit"} | font:${s.fontSize ?? "?"}`;
84
+ });
85
+ return userMsg([
86
+ "Describe this page's UI in detail for a developer who needs to modify it:\n",
87
+ `## Page: ${dom.title}`,
88
+ `URL: ${dom.url}`,
89
+ `Elements: ${dom.totalElements}`,
90
+ `Viewport: ${dom.viewport.width}x${dom.viewport.height}\n`,
91
+ "## Semantic Structure",
92
+ dom.semanticStructure.map((n) => `- <${n.tag}> ${n.label ?? ""} → ${n.selector}`).join("\n"),
93
+ "\n## Key Elements",
94
+ elSummary.join("\n"),
95
+ "\n## Instructions",
96
+ "1. Describe the page layout in natural language (header, sidebar, content area, footer)",
97
+ "2. Identify the design system cues (spacing patterns, color palette, typography)",
98
+ "3. Note interactive elements and their states",
99
+ "4. Describe the visual hierarchy (what draws attention first)",
100
+ "5. Identify any design patterns (cards, lists, forms, navigation)",
101
+ "6. Output a structured description the IDE can reference when making CSS changes",
102
+ ].join("\n"));
103
+ });
104
+ server.registerPrompt("suggest_fixes", {
105
+ title: "Suggest UI Fixes",
106
+ description: "Based on captured data, suggest specific CSS/HTML fixes to improve the design",
107
+ }, () => {
108
+ const comparisons = store.getComparisons();
109
+ const acc = store.getAccessibility();
110
+ const spacing = store.getSpacing();
111
+ const issues = [];
112
+ if (comparisons.length > 0) {
113
+ const failing = comparisons.filter((c) => c.score < 90);
114
+ if (failing.length > 0) {
115
+ issues.push("## Figma Comparison Failures");
116
+ for (const c of failing.slice(0, 5)) {
117
+ issues.push(`\n### ${c.selector} (${c.score}/100)`);
118
+ for (const d of c.differences) {
119
+ issues.push(`- ${d.property}: ${d.actual} → ${d.expected} (${d.severity})`);
120
+ }
121
+ }
122
+ }
123
+ }
124
+ if (acc && acc.summary.issues.length > 0) {
125
+ issues.push("\n## Accessibility Issues");
126
+ for (const i of acc.summary.issues.slice(0, 10)) {
127
+ issues.push(`- ${i}`);
128
+ }
129
+ }
130
+ if (spacing && spacing.inconsistencies.length > 0) {
131
+ issues.push("\n## Spacing Inconsistencies");
132
+ for (const i of spacing.inconsistencies.slice(0, 5)) {
133
+ issues.push(`- ${i.property}: ${i.values.join(", ")} → Suggested: ${i.suggestion}`);
134
+ }
135
+ }
136
+ if (issues.length === 0) {
137
+ return userMsg("No issues found. The page looks good! Use compare_with_figma to check specific elements.");
138
+ }
139
+ return userMsg([
140
+ "Fix these UI issues in priority order:\n",
141
+ ...issues,
142
+ "\n## Instructions",
143
+ "1. Fix Figma comparison failures first (highest visual impact)",
144
+ "2. Then accessibility issues (functional impact)",
145
+ "3. Then spacing inconsistencies (polish)",
146
+ "4. For each fix, provide the exact CSS change",
147
+ "5. After applying fixes, use compare_with_figma to verify improvement",
148
+ ].join("\n"));
149
+ });
150
+ server.registerPrompt("visual_qa", {
151
+ title: "Visual QA Check",
152
+ description: "Run a visual QA check: take screenshot, verify against Figma, report pass/fail with details",
153
+ }, () => {
154
+ const shot = store.getLatestScreenshot();
155
+ const dom = store.getDom();
156
+ const comparisons = store.getComparisons();
157
+ if (!dom)
158
+ return userMsg("No browser data captured. Click the bookmarklet first.");
159
+ const compSummary = comparisons.length > 0
160
+ ? comparisons.map((c) => `- ${c.selector}: ${c.score}/100 (${c.status})`).join("\n")
161
+ : "No comparisons run yet.";
162
+ return userMsg([
163
+ "Perform a visual QA check on this page:\n",
164
+ `## Page: ${dom.title}`,
165
+ `URL: ${dom.url}`,
166
+ `Screenshot available: ${shot ? "Yes" : "No"}`,
167
+ `Elements captured: ${Object.keys(store.getElements()).length}\n`,
168
+ "## Comparison Results",
169
+ compSummary,
170
+ "\n## Instructions",
171
+ "1. Use get_page_screenshot to see the current page state",
172
+ "2. Compare key UI elements with Figma specs using compare_with_figma",
173
+ "3. Check for visual regressions: broken layouts, overflow, missing content",
174
+ "4. Verify responsive behavior with get_responsive_info",
175
+ "5. Rate: PASS (all >90 score), NEEDS_WORK (some <90), FAIL (any <50)",
176
+ "6. Output a structured QA report with pass/fail per element",
177
+ ].join("\n"));
178
+ });
179
+ }
180
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAGA,SAAS,OAAO,CAAC,CAAS;IACxB,OAAO;QACL,QAAQ,EAAE;YACR,EAAE,IAAI,EAAE,MAAe,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;SACvE;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAiB,EAAE,KAAmB;IACpE,MAAM,CAAC,cAAc,CACnB,oBAAoB,EACpB;QACE,KAAK,EAAE,2BAA2B;QAClC,WAAW,EACT,8GAA8G;KACjH,EACD,GAAG,EAAE;QACH,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QACrC,MAAM,WAAW,GAAG,KAAK,CAAC,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AC9D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { BrowserStore } from "../store/browser-store.js";
3
+ export declare function registerResources(server: McpServer, store: BrowserStore): void;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAc9D,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,YAAY,GAClB,IAAI,CAmGN"}