Skip to main content
Glama

πŸ‘οΈ WebSight

Give Your AI Agent Eyes

TypeScript MCP Playwright License: MIT

WebSight is an MCP server that enables AI agents to see, analyze, and verify visual changes on web pages with pixel-perfect accuracy.

Getting Started β€’ Features β€’ How It Works β€’ API Reference β€’ Contributing


🎯 The Problem

AI coding assistants are incredibly powerful at writing and modifying codeβ€”but they're blind. When you ask an AI to "make the button bigger" or "change the theme to dark mode", it edits the code and hopes for the best. There's no way for the AI to actually see what changed.

Related MCP server: mcp-ux-vision

πŸ’‘ The Solution

WebSight gives AI agents vision. It's a set of visual analysis tools exposed via the Model Context Protocol (MCP), allowing AI agents to:

  • πŸ” Analyze β€” Understand page structure, CSS variables, themes, and interactive elements

  • πŸ“Έ Snapshot β€” Capture visual baselines before making changes

  • 🎯 Compare β€” Verify changes with pixel-level diffing and percentage metrics


✨ Features

Feature

Description

🎨 Theme Extraction

Automatically detects light/dark mode, color schemes, CSS custom properties

πŸ—οΈ Layout Analysis

Identifies landmarks (header, nav, main, footer) and content sections

πŸ–±οΈ Action Detection

Finds all interactive elements with their selectors and test IDs

πŸ“Š Visual Diffing

Pixel-by-pixel comparison with configurable threshold

πŸ–±οΈ Page Interactions

Click, type, select, hover, scroll β€” all from AI commands

⚑ 10x Faster

Persistent browser session eliminates cold-start overhead

πŸ€– MCP Integration

Works seamlessly with Claude Desktop, Cursor, and VS Code Copilot

πŸ” Auto-Detection

Automatically finds running dev servers (Vite, Next.js, etc.)


πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/h34tsink/websight.git
cd websight

# Install dependencies
npm install

# Build the project
npm run build

# Auto-install to your AI tools
npm run install:mcp

πŸ’‘ Tip: The installer automatically detects and configures Claude Desktop, Cursor, and VS Code!

Target Specific Tools

npm run install:claude   # Claude Desktop only
npm run install:cursor   # Cursor only
npm run install:vscode   # VS Code Copilot only
npm run install:all      # All detected tools

πŸ”„ How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        AI AGENT WORKFLOW                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚   1. LOOK          2. BASELINE         3. DIFF                  β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚   β”‚ Analyze the β”‚  β”‚ Save visual β”‚     β”‚ Compare and β”‚          β”‚
β”‚   β”‚ current page│──│ snapshot    │────►│ verify      β”‚          β”‚
β”‚   β”‚ structure   β”‚  β”‚ before edit β”‚     β”‚ the changes β”‚          β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚                                                                 β”‚
β”‚   "I see CSS vars,   "Baseline          "2.3% pixel             β”‚
β”‚    theme is dark,     saved!"            difference,            β”‚
β”‚    3 buttons..."                         change OK!"            β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Example Conversation

You: "Use WebSight to change the primary color to red"

AI: Looking at page... I see --primary: #3b82f6 in the CSS variables. Let me save a baseline first.

[Makes code changes]

Comparing with baseline... Visual difference: 12.4%. The primary color has been updated across 3 buttons and the header accent.


πŸ“– Usage

Just tell your AI assistant:

"use websight to analyze this page"
"use websight to change the theme to dark mode"  
"use websight to verify my CSS changes worked"

The AI will automatically use the appropriate tools in sequence.

CLI Commands

npm run dev         # Start test page at localhost:5173
npm run look        # Analyze the current page
npm run baseline    # Save snapshot before changes
npm run diff        # Compare current state with baseline

πŸ“š API Reference

MCP Tool Actions

Action

Parameters

Description

look

url?

Analyze page structure, CSS variables, theme, and interactive elements

baseline

url?

Capture and save visual snapshot for later comparison

diff

url?

Compare current state against saved baseline, returns % difference

click

target, url?

Click an element by text, test ID, or selector

type

target, text, url?

Type text into an input field

select

target, value, url?

Choose an option from a dropdown

hover

target, url?

Hover over an element

scroll

direction, url?

Scroll the page (up/down/top/bottom)

press

key, url?

Press a keyboard key (Enter, Escape, Tab, etc.)

Example Usage

websight(action="look")
websight(action="click", target="Submit")
websight(action="type", target="email", text="test@example.com")
websight(action="select", target="country", value="USA")

Programmatic API

import { analyze, saveBaseline, closeSession, click, type } from 'websight/session';

// Analyze any page
const { snapshot, report } = await analyze('http://localhost:3000');

// Interact
await click('Open Modal');
await type('email', 'test@example.com');
await click('Submit');

console.log(analysis.snapshot.theme);        // { mode: 'dark', scheme: 'monochrome' }
console.log(analysis.snapshot.cssVars);      // { '--primary': '#3b82f6', ... }
console.log(analysis.snapshot.actions);      // [{ type: 'button', text: 'Submit', ... }]

// Save baseline before changes
await saveBaseline('http://localhost:3000', './out');

// Clean up
await closeBrowser();

πŸ—‚οΈ Project Structure

websight/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ mcp-server.ts           # MCP server entry point
β”‚   └── πŸ“ tools/
β”‚       β”œβ”€β”€ api.ts              # Programmatic API
β”‚       β”œβ”€β”€ types.ts            # TypeScript definitions
β”‚       β”œβ”€β”€ detect.ts           # Dev server auto-detection
β”‚       β”œβ”€β”€ compare.ts          # Pixel diffing logic
β”‚       β”œβ”€β”€ report.ts           # Report generation
β”‚       └── πŸ“ extractors/      # Page analysis modules
β”‚           β”œβ”€β”€ theme.ts        # Theme & CSS variable extraction
β”‚           β”œβ”€β”€ landmarks.ts    # Layout landmark detection
β”‚           β”œβ”€β”€ sections.ts     # Content section analysis
β”‚           β”œβ”€β”€ actions.ts      # Interactive element finder
β”‚           └── overlays.ts     # Modal/overlay detection
β”œβ”€β”€ πŸ“ scripts/
β”‚   └── install.js              # Automated MCP installer
β”œβ”€β”€ πŸ“ test-page/
β”‚   └── index.html              # Development test page
β”œβ”€β”€ πŸ“ dist/                    # Compiled output
└── πŸ“ out/                     # Generated analysis & snapshots

βš™οΈ Configuration

npm run install:mcp

This automatically detects and configures your AI tools.

Manual Configuration

Edit %APPDATA%/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "websight": {
      "command": "node",
      "args": ["C:/path/to/websight/dist/src/mcp-server.js"]
    }
  }
}

Edit .vscode/mcp.json in your workspace:

{
  "mcpServers": {
    "websight": {
      "command": "node", 
      "args": ["C:/path/to/websight/dist/src/mcp-server.js"]
    }
  }
}

Edit %APPDATA%/Cursor/User/globalStorage/cursor.mcp/mcp.json:

{
  "mcpServers": {
    "websight": {
      "command": "node",
      "args": ["C:/path/to/websight/dist/src/mcp-server.js"]
    }
  }
}

Option 1: Create .mcp.json in your project root:

{
  "mcpServers": {
    "websight": {
      "command": "node",
      "args": ["C:/path/to/websight/dist/src/mcp-server.js"]
    }
  }
}

Option 2: Use the CLI command:

claude mcp add websight node C:/path/to/websight/dist/src/mcp-server.js

πŸ› οΈ Development

npm run dev         # Start test page with hot reload
npm run mcp         # Run MCP server in dev mode
npm run build       # Build for production
npm run clean       # Remove generated files

🀝 Contributing

Contributions are welcome! Feel free to:

  • πŸ› Report bugs

  • πŸ’‘ Suggest features

  • πŸ”§ Submit pull requests


πŸ‘€ Author


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with ❀️ for the AI-assisted development community

Because AI agents shouldn't have to code blind.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/h34tsink/websight'

If you have feedback or need assistance with the MCP directory API, please join our Discord server