@codeandfunction/pixelnotperfect

中文文档
5.0.3发布于 2026/10/24SEE LICENSE IN LICENSEES Module近 30 天下载 1811

MCP server for visual regression and interactive design review.

原始使用文档
文档目录6 节
  1. Get Started
  2. 1. Install the server
  3. 2. Ask your agent to compare
  4. 3. Review in Chrome
  5. Reporting a Vulnerability
  6. License

Pixel Not Perfect

Check your coding agent's work against the design, down to the pixel.

Pixel Not Perfect is an MCP server that compares a rendered page with your design reference, whether that's a screenshot, a Figma export, a PDF or a live URL, and shows the agent exactly which regions differ. When it's your turn, open the page in Chrome, pin what needs work, and approve or reject each fix.

Works with any coding agent that supports MCP. No account, no lock-in.

Learn more at pixelnotperfect.dev.


Get Started

You need Node.js 20 or later and Google Chrome.

1. Install the server

Add Pixel Not Perfect to your coding agents with one command, then choose which agents to add it to. Your agents download and run the package; there is nothing else to install.

npx add-mcp @codeandfunction/pixelnotperfect --env "PIXELNOTPERFECT_ALLOWED_ROOTS=~/Designs" -g

Set PIXELNOTPERFECT_ALLOWED_ROOTS to the folders that hold your reference images and PDFs. The agent can read every folder you list, so keep it narrow.

To set it up by hand instead, add this to your MCP client's configuration:

{
  "mcpServers": {
    "pixelnotperfect": {
      "command": "npx",
      "args": ["-y", "@codeandfunction/pixelnotperfect"],
      "env": {
        "PIXELNOTPERFECT_ALLOWED_ROOTS": "~/Designs"
      }
    }
  }
}

2. Ask your agent to compare

Compare http://localhost:3000/login with ~/Designs/login.png and fix the differences.

The agent renders the page, compares it, fixes the code and repeats until the page is within the threshold.

3. Review in Chrome

Install the Pixel Not Perfect extension from the Chrome Web Store. Ask your agent for a visual review, open the page, and click Review this tab. Pin feedback on the page, talk each item through with the agent, and approve or reject every fix with before and after captures.

The server connects itself to the extension when it starts. Set PIXELNOTPERFECT_HOST_REGISTRATION=off to turn this off.


Reporting a Vulnerability

Email [email protected] with the details. Please do not disclose the issue publicly until it has been addressed.


License

Free to use, including on commercial projects, under the EULA. You may not resell, redistribute or rebrand it.

© Code and Function. All rights reserved.

版本与发布记录

@codeandfunction/pixelnotperfect 共发布 22 个版本,首次发布于 2026/10/07;过去 12 个月发布了 22 个版本。

版本发布日期距今
5.0.3latest2026/10/2416 天前
5.0.22026/10/2416 天前
5.0.12026/10/1822 天前
5.0.02026/10/1624 天前
4.0.22026/10/1526 天前
4.0.12026/10/1426 天前

关于 @codeandfunction/pixelnotperfect 的常见问题

@codeandfunction/pixelnotperfect 是什么?

MCP server for visual regression and interactive design review.

如何安装 @codeandfunction/pixelnotperfect?

在项目目录运行 npm install @codeandfunction/pixelnotperfect,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 pixelnotperfect、pixelnotperfect-native-host,可以用 npx pixelnotperfect 直接运行。

@codeandfunction/pixelnotperfect 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/codeandfunction__pixelnotperfect 是否存在。

@codeandfunction/pixelnotperfect 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@codeandfunction/pixelnotperfect 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@codeandfunction/pixelnotperfect 可以商用吗?

@codeandfunction/pixelnotperfect 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@codeandfunction/pixelnotperfect 的下载量有多少?

根据 npm 官方下载统计,@codeandfunction/pixelnotperfect 在 2026/10/10 – 2026/11/08 这 30 天内被下载 1,811 次,日均约 60 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@codeandfunction/pixelnotperfect 还在维护吗?

最新版本 5.0.3 发布于 2026/10/24(16 天前);至今共发布 22 个版本,其中过去 12 个月发布了 22 个;首次发布于 2026/10/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。