Logo vun Huolala Figma MCP

Huolala Figma MCP

Organisatioun
HuolalaTech

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

EditeurHuolalaTech
Repositoryhuolala-figma-mcp
SproochPython
Forks
15
Stären
85
Disponibel Tools
0
Transporttypstdio
LizenzApache-2.0
Linken
  • Tools mat KI-Workflows verbannen

    Huolala Figma MCP stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    85 Stären an 15 Forks aus dem verlinkte Repository.

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.

Huolala Figma MCP MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Huolala Figma MCP verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Huolala Figma MCP als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Huolala Figma MCP an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "huolala-figma-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Huolala Figma MCP. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Huolala Figma MCP.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Huolala Figma MCP?
Huolala Figma MCP
Jo. Ech hunn et gelies.
Dat hunn ech mat Huolala Figma MCP fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Huolala Figma MCP benotzt?

Huolala Figma MCP ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Huolala Figma MCP MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Huolala Figma MCP mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Huolala Figma MCP MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Huolala Figma MCP verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Huolala Figma MCP MCP mat TypingMind?

Huolala Figma MCP leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Huolala Figma MCP MCP an TypingMind zur Verfügung?

Huolala Figma MCP stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Huolala Figma MCP MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Huolala Figma MCP eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇