Huolala Figma MCP logo

Huolala Figma MCP

Organization
HuolalaTech

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

PublisherHuolalaTech
Repositoryhuolala-figma-mcp
LanguagePython
Forks
15
Stars
85
Available tools
0
Transport typestdio
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Huolala Figma MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    85 stars and 15 forks from the linked 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.

Use Huolala Figma MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Huolala Figma MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Huolala Figma MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Huolala Figma MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "huolala-figma-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Huolala Figma MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Huolala Figma MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Huolala Figma MCP to help me with this task?
Huolala Figma MCP
Sure. I read it.
Here is what I found using Huolala Figma MCP.

Frequently asked questions

What is the Huolala Figma MCP MCP server used for?

Huolala Figma MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Huolala Figma MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Huolala Figma MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Huolala Figma MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Huolala Figma MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Huolala Figma MCP MCP to TypingMind?

Huolala Figma MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Huolala Figma MCP MCP provide in TypingMind?

Huolala Figma MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Huolala Figma MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Huolala Figma MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇