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
リンク
  • ツールをAIワークフローに接続

    Huolala Figma MCPは、対応するAIクライアントやAIエージェントから利用できる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.

Huolala Figma MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Huolala Figma MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」→「詳細設定」→「Model Context Protocol」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「Model Context Protocol」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Huolala Figma MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Huolala Figma MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタのステータスが「準備完了」のままか確認するには、画面を更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "huolala-figma-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてHuolala Figma MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Huolala Figma MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Huolala Figma MCPを使ってこのタスクを手伝ってもらえますか?
Huolala Figma MCP
はい、読みました。
Huolala Figma MCPで調べた結果をお伝えします。

よくある質問

Huolala Figma MCP MCPサーバーは何に使いますか?

Huolala Figma MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでは、複数のAIモデルでHuolala Figma MCP MCPを利用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでHuolala Figma MCPを利用できます。

TypingMindでHuolala Figma MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けのトップクラスのフロントエンドです。Huolala Figma MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Huolala Figma MCP MCPをTypingMindに接続するにはどうすればよいですか?

Huolala Figma MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでHuolala Figma MCP MCPのどのようなツールを利用できますか?

Huolala Figma MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Huolala Figma MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Huolala Figma MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇