شعار Huolala Figma MCP

Huolala Figma MCP

مؤسسة
HuolalaTech

Huolala's in-house MCP service that automatically converts Figma designs into high-fidelity UI code.

الناشرHuolalaTech
المستودعhuolala-figma-mcp
اللغةPython
التفريعات
15
النجوم
85
الأدوات المتاحة
0
نوع نقل البياناتstdio
الترخيصApache-2.0
الروابط
  • اربط الأدوات بمسارات عمل الذكاء الاصطناعي

    يتيح Huolala Figma MCP إمكانات MCP لتطبيقات الذكاء الاصطناعي العميلة المتوافقة معه، وكذلك لوكلاء الذكاء الاصطناعي المتوافقين معه.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم مقتطفات التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات اهتمام المجتمع بالمستودع مفتوح المصدر

    إحصاءات المستودع المرتبط: النجوم: 85، والتفريعات: 15.

Huolala Figma MCP

license Version Python Platform MCP

English | 简体中文


Introduction

  Huolala Figma MCP (huolala-figma-mcp) is Huolala's in-house MCP service that automatically converts Figma designs into high-fidelity UI code. Built on FastMCP, it exposes MCP tools to AI clients (such as Cursor and Qorder). After invocation, clients receive a ZIP package containing index.html, sliced images, fonts, and other assets, which can then be further converted by an LLM into target platform code (HTML, React, Vue, Objective-C, Swift, Kotlin, React Native, and more).

  • High fidelity: Cleans redundant layers and controls; recognizes red-dot badges, system bars, and home bars
  • Complete layout capabilities: Supports distributed alignment, center alignment, linear layout, overlapping layout, list detection, automatic text width/height removal, and more — producing more usable code
  • Extensible: DSL processing uses a processor registry plus priority pipeline; steps can be enabled or disabled as needed. Custom Skills are also supported to tailor the LLM workflow

Core Workflow

  The core flow is: Figma API fetch → intermediate DSL → pipeline layout & visual processing → export ZIP. A rules engine handles structured layout and asset processing; optional VLM multimodal capabilities support complex UI recognition.

StepDescription
① DSL to TreeRecord cross-overlap, overflow, containment, and hierarchy
② System Bar RemovalRemove status bar and Home Bar
③ VLM CallList detection and merging (optional, disabled by default)
④ Red Dot ProcessingRed-dot badge detection and hierarchy adjustment
⑤ Icon RecognitionIcon detection and merging
⑥ Layer CleaningRemove invisible and transparent redundant layers
⑦ Layout CalculationProjection split, list layout, text width/height removal, container auto-sizing
⑧ Asset PackagingImage deduplication, font export, multimodal structure and HTML

Comparison

  Below is a comparison of common Design-to-Code approaches (fidelity, implementation, and typical issues):

SolutionOpen SourceFidelityVisual Example / IssuesImplementationLimitations
Image Input + Multimodal LLMPartially open sourceLowUses multimodal LLMs to recognize UI layout and details from imagesCannot perceive sub-pixel differences; unable to accurately restore design attributes
Open Source Figma Context MCPOpen sourceHigh1. Calls RESTful API, extracts key info, merges identical attributes, then sends to LLM for transcoding 2. Uses get_image for asset slicingDoes not integrate multimodal LLMs; poor handling of repeating component grouping
Figma Official MCPNot open sourceHigh1. Reads design JSON 2. Reads design screenshot and calls multimodal LLM 3. Merges both data sources via LLMPoor fidelity on complex pages
Huolala In-house MCPOpen sourceHighest1. Image processing and CV to clean designs and remove redundant elements/layers 2. In-house icon recognition for precise slicing 3. Custom Skills to fuse multimodal LLM output with DSL for controllable workflow 4. Custom layout algorithms for developer-friendly codeComplex technical approach

Guide

MCP Service Setup

  1. Clone the repository locally.

  2. Create a virtual environment and install dependencies:

  • Python 3.11 or higher
bash
python3.11 -m venv venv
source venv/bin/activate
pip install -e .
  1. Configure the Figma token:
bash
cp .env.example .env
# Edit .env and set MDAP_FIGMA_TOKEN
  1. Start the service:
bash
python -m mdap_u2c --port=10001
  1. Configure the MCP client with the service URL, for example:
json
"ui2code-local": {
  "url": "http://localhost:10001/mcp",
  "transport": "http"
}

Prompt example: Call the figma_to_code_package tool with a Figma design URL to generate an HTML page with high visual fidelity.

Optional: Prompt Templates

  The assets/prompts/ directory provides two prompt templates to standardize Agent calls to MCP tools and subsequent transcoding workflows:

Template FileMCP Prompt NamePurpose
get_figma_property.mdget_figma_propertyExtract Figma design properties: read text, styles, etc. — suitable for partial UI updates
ui2code_with_skills.mdui2code_with_skillsFull UI-to-code workflow: fetch ZIP, adjust repeating components, load Skills by target platform, and generate code

IDEs with MCP Prompts support (e.g. Cursor)

  After starting the MCP service and configuring the client, invoke the prompts directly in chat with /:

/get_figma_property
/ui2code_with_skills

  Then fill in the Figma URL, target language, and other parameters as prompted.

IDEs without MCP Prompts support

  Adapt the template content to a format your IDE supports, for example:

  • Skills: Copy or link assets/prompts/*.md into your IDE's Skills directory and let the Agent load them on demand
  • Commands / Rules: Split templates into fixed commands or project rules

  Template source files match the server-side MCP Prompt registration. After editing files under assets/prompts/, restart the service to sync changes to MCP Prompts.

Optional: VLM Multimodal

Disabled by default. When enabled, the DSL pipeline calls multimodal models to recognize UI structure. If not configured, the prompt templates will automatically use the multimodal LLM available in the smart IDE via subagent.

bash
export MDAP_VLM_PROVIDER=openai
export MDAP_VLM_API_KEY=sk-...
export MDAP_VLM_MODEL=gpt-4o
export MDAP_VLM_BASE_URL=https://api.openai.com/v1

Optional: Automated Comparison Testing

Batch-run Figma links and generate HTML similarity reports (requires Playwright):

bash
pip install ".[ui2code-test]"
playwright install chromium
python tests/ui2code_auto_test.py

Test URLs are configured in tests/test_url_list.txt.

Project Modules

huolala-figma-mcp/
├── src/mdap_u2c/          # Main source code
│   ├── figma/             # Figma integration
│   ├── dsl_processors/    # DSL processing pipeline
│   ├── services/          # Business orchestration
│   ├── server/            # MCP / HTTP service
│   └── config/            # Configuration
├── assets/                # Fonts, CV templates, Skills, prompts
├── tests/                 # Comparison test tools
└── pyproject.toml
  • Figma Integration Layer (src/mdap_u2c/figma/)

    Figma API client, node parsing, and DSL component conversion — maps design nodes to the internal DSL model.

  • DSL Processing Layer (src/mdap_u2c/dsl_processors/)

    Pipeline with auto-registered processors: image merging, DSL-to-tree, system bar cropping, red-dot marking, projection grouping, layout calculation, and more.

  • Service Orchestration Layer (src/mdap_u2c/services/)

    • FigmaService: Figma → DSL
    • UI2CodeService: Single entry point for the three-layer flow (Figma → DSL → processing → ZIP)
    • ExportService: Export DSL to ZIP package (HTML + assets)
  • MCP / HTTP Service Layer (src/mdap_u2c/server/)

    FastMCP instance, MCP tools/resources/prompt registration, and health-check REST routes.

  • Assets & Skills (assets/)

    Fonts, CV template images, YOLO badge models, platform conversion Skill prompts, and more.

Tool name: figma_to_code_package

ParameterDescription
figma_urlFull Figma design URL; must include /file/{key}/ or /design/{key}/ and ?node-id=
image_scaleImage scale list, e.g. [3, 2]; values 1–4
target_platformTarget platform: h5 / vue / react / react native / ios / android

Response example:

json
{
  "zip_url": "http://localhost:10001/...",
  "metadata": { "...": "..." },
  "message": "zip_url 可直接下载"
}

Contents after extracting the ZIP:

File / DirectoryDescription
index.htmlRule-based Web code for LLM secondary conversion
images/Icons and sliced image assets
fonts/Font files
dsl.jsonIntermediate DSL data
design.pngOrigin design screenshot image
vlm_result.jsonMultimodal LLM result; only present when configured in the pipeline

License

  Licensed under the Apache License 2.0.

استخدم MCP الخاص بـ Huolala Figma MCP مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل Huolala Figma MCP، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal مفتوحة واترك العملية قيد التشغيل أثناء استخدام أدوات MCP.
3

إضافة Huolala Figma MCP كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ Huolala Figma MCP.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "huolala-figma-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ Huolala Figma MCP، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ Huolala Figma MCP.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Huolala Figma MCP لمساعدتي في هذه المهمة؟
Huolala Figma MCP
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Huolala Figma MCP.

الأسئلة الشائعة

ما استخدامات خادم MCP Huolala Figma MCP؟

Huolala Figma MCP هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP Huolala Figma MCP مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام Huolala Figma MCP مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم خادم MCP Huolala Figma MCP مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل Huolala Figma MCP، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP Huolala Figma MCP بـ TypingMind؟

يعمل Huolala Figma MCP عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP Huolala Figma MCP في TypingMind؟

يتيح Huolala Figma MCP إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP Huolala Figma MCP؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويتيح لك التحكم بنفسك في مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP. إذا كان Huolala Figma MCP يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇