Gathering detailed insights and metrics for figma-restoration-mcp-vue-tools
Gathering detailed insights and metrics for figma-restoration-mcp-vue-tools
Gathering detailed insights and metrics for figma-restoration-mcp-vue-tools
Gathering detailed insights and metrics for figma-restoration-mcp-vue-tools
Professional Figma Component Restoration Kit - Complete MCP tools with snapDOM-powered high-quality screenshots, intelligent shadow detection, and smart debugging for Vue component restoration
npm install figma-restoration-mcp-vue-tools
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (56.24%)
Vue (29.67%)
Shell (13.98%)
HTML (0.11%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
26 Commits
1 Branches
1 Contributors
Updated on Jul 17, 2025
Latest Version
1.3.1
Package Id
figma-restoration-mcp-vue-tools@1.3.1
Unpacked Size
23.95 MB
Size
4.47 MB
File Count
3,259
NPM Version
10.7.0
Node Version
18.20.3
Published on
Jul 17, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
基于MCP (Model Context Protocol) 的Vue组件开发和Figma还原工具集。专注于AI生成的Vue组件验证和像素级对比分析,支持3倍图归一化处理和智能差异定位。
mcp-vue-tools/
├── figma-restoration-toolkit.mjs # 🎯 核心工具包 (一站式解决方案)
├── compare-pixelmatch-enhanced.mjs # 🔍 增强版像素对比工具
├── compile-and-render.mjs # 🖼️ Vue组件编译渲染工具
├── clean-component.mjs # 🗑️ 智能组件清理工具
├── show-diff-details.mjs # 📊 详细差异分析工具
├── example.mjs # 📖 使用示例
├── src/server.js # 🛠️ MCP服务器
├── mcp-config.json # ⚙️ MCP配置
├── results/ # 📁 分析结果目录
└── temp/ # 📁 临时文件目录
1cd mcp-vue-tools 2yarn install # 或 npm install
1# 使用核心工具包进行完整还原分析 2node figma-restoration-toolkit.mjs MyComponent ./MyComponent.vue 3 4# 或者单独使用编译渲染工具 5node compile-and-render.mjs MyComponent 6 7# 单独使用像素对比工具 8node compare-pixelmatch-enhanced.mjs expected.png actual.png diff.png
Add to your MCP client configuration:
1{ 2 "mcpServers": { 3 "vue-figma-tools": { 4 "command": "node", 5 "args": ["path/to/mcp-vue-tools/src/server.js"], 6 "env": { 7 "CHROME_EXECUTABLE_PATH": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" 8 } 9 } 10 } 11}
一站式Figma组件还原解决方案,包含完整的分析和修复流程。
功能特性:
使用方法:
1node figma-restoration-toolkit.mjs <component-name> <vue-file-path> 2 3# 示例 4node figma-restoration-toolkit.mjs MyButton ./components/MyButton.vue
输出结果:
增强版像素对比分析工具,支持3倍图归一化和详细差异分析。
功能特性:
使用方法:
1node compare-pixelmatch-enhanced.mjs <expected-image> <actual-image> <diff-output> 2 3# 示例 4node compare-pixelmatch-enhanced.mjs expected.png actual.png diff.png
Vue组件编译和截图工具,支持自动元素检测和高质量渲染。
功能特性:
使用方法:
1node compile-and-render.mjs <component-name> [output-dir] 2 3# 示例 4node compile-and-render.mjs MyButton ./results/MyButton
智能组件文件清理工具,避免重复生成时文件堆积。
功能特性:
使用方法:
1# 预览清理 (安全模式) 2node clean-component.mjs clean MyComponent 3 4# 执行清理 5node clean-component.mjs clean MyComponent --execute 6 7# 清理所有组件 8node clean-component.mjs clean-all --execute 9 10# 查看清理统计 11node clean-component.mjs stats
显示完整的差异分析结果,包含位置信息和元素匹配。
使用方法:
1node show-diff-details.mjs <component-name> 2 3# 示例 4node show-diff-details.mjs MyButton
步骤1: 准备Vue组件代码
1<template> 2 <div class="my-button"> 3 <span class="button-text">Click me</span> 4 </div> 5</template> 6 7<script> 8export default { 9 name: 'MyButton' 10} 11</script> 12 13<style scoped> 14.my-button { 15 width: 120px; 16 height: 40px; 17 background: #007bff; 18 border-radius: 4px; 19 display: flex; 20 align-items: center; 21 justify-content: center; 22} 23.button-text { 24 color: white; 25 font-size: 14px; 26} 27</style>
步骤2: 运行完整分析
1node figma-restoration-toolkit.mjs MyButton ./MyButton.vue
步骤3: 查看分析结果
🎉 还原工作流程完成!
📊 还原总结:
匹配度: 97.47%
质量评级: high
差异区域: 4个
修复建议: 2个
💡 建议:
✅ 高质量还原,建议直接使用
🔧 可以应用细节修复建议进一步优化
📁 结果文件: ./results/MyButton/restoration-report.json
重要更新: 为了简化工作流程,我们移除了独立的vue_dev_server
和save_vue_component
工具:
这样的设计更加自动化和用户友好!
核心工具 - 完整的Figma组件还原对比分析解决方案,集成snapDOM高质量截图技术。
功能特性:
MCP调用示例:
1// 完整的组件对比分析 (使用snapDOM) 2{ 3 "tool": "figma_compare", 4 "arguments": { 5 "componentName": "BeeSchoolHomepage", 6 "port": 83, 7 "viewport": {"width": 1440, "height": 800}, 8 "screenshotOptions": { 9 "deviceScaleFactor": 3, 10 "omitBackground": true, 11 "useSnapDOM": true, 12 "embedFonts": true, 13 "compress": true 14 }, 15 "threshold": 0.1, 16 "generateReport": true 17 } 18}
工作流程:
🆕 三倍图增强:
新增工具 - 专门的snapDOM截图工具,提供最高质量的DOM-to-image转换。
功能特性:
MCP调用示例:
1// 高质量组件截图 2{ 3 "tool": "snapdom_screenshot", 4 "arguments": { 5 "componentName": "MyComponent", 6 "port": 83, 7 "snapDOMOptions": { 8 "scale": 3, 9 "compress": true, 10 "embedFonts": true, 11 "backgroundColor": "transparent", 12 "includeBoxShadow": true, 13 "padding": 0 14 }, 15 "outputPath": "./custom-screenshot.png" 16 } 17}
输出报告示例:
1# ExchangeSuccess Figma还原分析报告 2 3## 📊 总体评估 4- **还原度**: 97.20% 5- **状态**: ✨ 优秀级别 6- **发现问题**: 2 个 7- **预计改进**: +1.5% 8 9## 🎯 问题分布 10| 优先级 | 数量 | 说明 | 11|--------|------|------| 12| 🔴 高优先级 | 0 | 需要立即修复 | 13| 🟡 中优先级 | 2 | 建议优化 | 14| 🟢 低优先级 | 0 | 可选优化 | 15 16## 🔧 修复建议 171. [MEDIUM] 调整卡片内容位置 18 - position: absolute; top: 20px; left: 46px; 19 - 检查父容器的定位和尺寸
工具包自动处理Figma 3倍图与Vue组件的坐标系转换:
基于Figma位置信息精确定位问题元素:
正确的snapDOMOptions配置至关重要:
1"snapDOMOptions": { 2 "padding": 0, // 关键: 确保精确对齐 3 "includeBoxShadow": true // 完整视觉效果 4}
错误配置可能导致精度从98.33%降至93.23%!
1# Chrome浏览器路径 (macOS) - snapDOM需要 2export CHROME_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" 3 4# 开发模式 5export NODE_ENV="development"
MIT
No vulnerabilities found.
No security vulnerabilities found.