Skip to main content

The screenshot-to-code MCP server for Claude Code, Cursor & VS Code

Pixcel is an MCP server that turns design screenshots into measured UI evidence your coding agent can act on: it reads exact colours, font sizes, borders and layout from a screenshot, compiles them into an implementation prompt, captures your running app on localhost, and scores how closely it matches. Install it in Claude Code with `claude mcp add pixcel -- npx -y pixcel-mcp`.

Install

Claude Code

claude mcp add pixcel -- npx -y pixcel-mcp

Cursor, VS Code, Windsurf, Claude Desktop (mcp.json)

{
  "mcpServers": {
    "pixcel": {
      "command": "npx",
      "args": ["-y", "pixcel-mcp"]
    }
  }
}

On Windows use "command": "cmd", "args": ["/c", "npx", "-y", "pixcel-mcp"]. Run npx -y pixcel-mcp --init cursor to print a ready-made config for your editor.

Tools your agent gets

ToolWhat it does
inspect_reference_imageMeasures a screenshot: palette, text with size/weight/colour, surfaces, layout tree.
compile_ui_promptTurns the measurements into an implementation prompt for your stack.
capture_ui_screenshotScreenshots your app on localhost with a sandboxed, network-locked headless browser.
verify_ui_implementationCompares your build with the reference and returns agreement plus a correction prompt.

Why measurement beats “here’s a screenshot”

Coding agents see images at reduced resolution and round what they see to familiar defaults. Pixcel gives them numbers instead: 98.6% of text colours exact, font sizes within ±1px for 93.1% of words, 89.9% of containers found — and then lets the agent check its own work against the reference.

The closed loop

  1. Install. Run `claude mcp add pixcel -- npx -y pixcel-mcp` in your project (Cursor, VS Code and others use an mcp.json entry with `npx -y pixcel-mcp`).
  2. Add a reference. Put the design screenshot in a design-references/ folder in your project.
  3. Ask your agent. Ask it to build the UI from design-references/your-screen.png using the Pixcel tools.
  4. Let it verify. The agent captures its own build on localhost and compares it with the reference until it matches.

Security model

  • Reads only PNG/JPEG and spec files inside allowed folders; symlink, junction, UNC and traversal escapes are rejected.
  • Never auto-authorises your home folder or a drive root.
  • Capture is limited to localhost; the browser keeps its sandbox and cannot reach the internet or your LAN.
  • Configuration comes only from your editor’s MCP env block — never from a repository’s .env files.

Questions

What is an MCP server?
MCP (Model Context Protocol) is the standard way AI coding agents such as Claude Code, Cursor and VS Code Copilot call external tools. An MCP server is a small local program that exposes those tools; Pixcel’s server exposes screenshot measurement, prompt compilation, capture and verification.
Is it safe to give an agent this server?
It only reads PNG/JPEG images and spec files inside folders you allow, refuses paths that escape them (including symlinks and network paths), only captures loopback URLs, and runs its headless browser sandboxed with all non-local network traffic blocked. It never loads your project’s .env files.
Does it need an API key or the internet?
No. Measurement, OCR, capture and comparison run locally. Optional AI critique via Groq is off unless you enable it in the MCP config.
Which editors are supported?
Claude Code, Cursor, VS Code (Copilot), Windsurf, Claude Desktop, Google Antigravity and Gemini CLI — anything that speaks MCP over stdio. On Windows, configs launch it through cmd /c npx.