Logo van Huolala Figma MCP

Huolala Figma MCP

Organisatie
HuolalaTech

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

UitgeverHuolalaTech
Repositoryhuolala-figma-mcp
TaalPython
Forks
15
Sterren
85
Beschikbare tools
0
Transporttypestdio
LicentieApache-2.0
Links
  • Koppel tools aan AI-workflows

    Huolala Figma MCP biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • Beschikbare tools: 0

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Belangstelling voor het opensourceproject

    Statistieken van de gekoppelde repository (sterren: 85, forks: 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.

Gebruik Huolala Figma MCP MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Huolala Figma MCP is verbonden, kun je de verbinding dus met verschillende AI-modellen in TypingMind gebruiken, zonder die voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Huolala Figma MCP toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus op ‘Gereed’ staat.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Huolala Figma MCP.
  4. Sla de serverlijst op.
  5. Vernieuw de pagina als je wilt controleren of de connectorstatus nog op ‘Gereed’ staat.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "huolala-figma-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Huolala Figma MCP in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Huolala Figma MCP in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Huolala Figma MCP gebruiken om me hiermee te helpen?
Huolala Figma MCP
Zeker. Ik heb het gelezen.
Dit vond ik met Huolala Figma MCP.

Veelgestelde vragen

Waarvoor wordt de MCP-server Huolala Figma MCP gebruikt?

Huolala Figma MCP is een MCP-server waarmee compatibele AI-clients toegang krijgen tot externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Huolala Figma MCP MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Huolala Figma MCP gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Huolala Figma MCP MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Huolala Figma MCP verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Huolala Figma MCP MCP met TypingMind?

Huolala Figma MCP werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt Huolala Figma MCP MCP in TypingMind?

Huolala Figma MCP biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Huolala Figma MCP MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Huolala Figma MCP authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇