NPM Star
Collections
  1. Home
  2. Compare
  3. figma-developer-mcp vs figma-transformer
NPM Compare

Compare NPM packages statistics, trends, and features

CollectionsVS Code extensionChrome extensionTermsPrivacyLinkTreeIndiehackersBig Frontendqiuyumi

Figma Development and Transformation Tools

These packages help developers work with Figma designs, and files. figma-developer-mcp is for building custom plugins and apps, and figma-transformer is for converting Figma files into code. Comparing them helps you decide which tool to use for your Figma development needs.

Figma DevelopmentFigmaPlugin DevelopmentDesign-to-CodeUI Tools

Unable to load comparison data. Please try again later.

Similar Packages

json2figma

80%

A tool that allows you to convert JSON data into Figma designs, making it easy to generate and update Figma designs programmatically.

This package is a great alternative to figma-transformer because it provides a similar functionality of converting data into Figma designs, but with a more focused solution for JSON data. It's a well-maintained and has a strong community behind it.

Design Automation

figma-api

70%

A JavaScript library that provides a set of APIs for interacting with Figma designs, making it easy to automate and integrate Figma designs into your development workflow.

This package is a good alternative because it provides a similar functionality of working with Figma designs programmatically, but with a more comprehensive set of APIs. It's a well-maintained and has a strong community behind it.

Design Automation

design-token-manager

60%

A tool that allows you to manage and generate design tokens, making it easy to maintain consistency across your design system.

This package is a promising alternative because it provides a similar functionality of working with design systems, but with a more focused solution for design tokens. It's a well-maintained and has a growing community behind it.

Design Automation
<a href="https://www.framelink.ai/?utm_source=github&utm_medium=referral&utm_campaign=readme" target="_blank" rel="noopener"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://www.framelink.ai/github/HeaderDark.png" /> <img alt="Framelink" src="https://www.framelink.ai/github/HeaderLight.png" /> </picture> </a> <div align="center"> <h1>Framelink Figma MCP 伺服器</h1> <p> 🌐 可用語言: <a href="README.md">English (英文)</a> | <a href="README.ko.md">한국어 (韓文)</a> | <a href="README.ja.md">日本語 (日文)</a> | <a href="README.zh-cn.md">简体中文 (簡體中文)</a> </p> <h3>讓您的程式碼代理存取您的 Figma 資料。<br/>在任何框架中一次性完成設計。</h3> <a href="https://npmcharts.com/compare/figma-developer-mcp?interval=30"> <img alt="每週下載次數" src="https://img.shields.io/npm/dm/figma-developer-mcp.svg"> </a> <a href="https://github.com/GLips/Figma-Context-MCP/blob/main/LICENSE"> <img alt="MIT 授權條款" src="https://img.shields.io/github/license/GLips/Figma-Context-MCP" /> </a> <a href="https://framelink.ai/discord"> <img alt="Discord" src="https://img.shields.io/discord/1352337336913887343?color=7389D8&label&logo=discord&logoColor=ffffff" /> </a> <br /> <a href="https://twitter.com/glipsman"> <img alt="Twitter" src="https://img.shields.io/twitter/url?url=https%3A%2F%2Fx.com%2Fglipsman&label=%40glipsman" /> </a> </div> <br/>

使用此 Model Context Protocol 伺服器,讓 Cursor 和其他由 AI 驅動的程式碼工具存取您的 Figma 檔案。

當 Cursor 可以存取 Figma 設計資料時,它在一次性精準實現設計方面,比貼上螢幕截圖等替代方案好得多。

<h3><a href="https://www.framelink.ai/docs/quickstart?utm_source=github&utm_medium=referral&utm_campaign=readme">查看快速入門指南 →</a></h3>

示範

觀看在 Cursor 中使用 Figma 設計資料建構 UI 的示範

觀看影片

運作方式

  1. 開啟您 IDE 的聊天功能(例如 Cursor 中的代理模式)。
  2. 貼上 Figma 檔案、框架或群組的連結。
  3. 要求 Cursor 對 Figma 檔案執行操作 — 例如,實現設計。
  4. Cursor 將從 Figma 取得相關元數據,並用它來編寫您的程式碼。

此 MCP 伺服器專為與 Cursor 搭配使用而設計。在從 Figma API 回應內容之前,它會簡化和轉譯回應,以便只向模型提供最相關的版面配置和樣式資訊。

減少提供給模型的內容有助於提高 AI 的準確性並使回應更具關聯性。

入門指南

許多程式碼編輯器和其他 AI 客戶端都使用設定檔來管理 MCP 伺服器。

可以透過將以下內容新增至您的設定檔來設定 figma-developer-mcp 伺服器。

注意:您需要建立一個 Figma 存取權杖才能使用此伺服器。有關如何建立 Figma API 存取權杖的說明,請參閱此處。

MacOS / Linux

{ "mcpServers": { "Framelink Figma MCP": { "command": "npx", "args": ["-y", "figma-developer-mcp", "--figma-api-key=YOUR-KEY", "--stdio"] } } }

Windows

{ "mcpServers": { "Framelink Figma MCP": { "command": "cmd", "args": ["/c", "npx", "-y", "figma-developer-mcp", "--figma-api-key=YOUR-KEY", "--stdio"] } } }

或者您可以在 env 欄位中設定 FIGMA_API_KEY 和 PORT。

如果您需要有關如何設定 Framelink Figma MCP 伺服器的更多資訊,請參閱 Framelink 文件。

Star 歷史

<a href="https://star-history.com/#GLips/Figma-Context-MCP"><img src="https://api.star-history.com/svg?repos=GLips/Figma-Context-MCP&type=Date" alt="Star History Chart" width="600" /></a>

了解更多

Framelink Figma MCP 伺服器既簡單又強大。請前往 Framelink 網站了解更多資訊,以充分利用它。

<p align="center"> <br/> <img width="100" src="./figma-transformer.svg" /> </p> <h1 align="center"> figma-transformer </h1> <div align="center">

A tiny utility library that makes the Figma API more human friendly.

npm version npm downloads gzip size modules MIT License PRs Welcome

</div>

How to use figma-transformer?

import { processFile } from "figma-transformer"; // Fetch the file you want using your favourite method const originalFile = fetchFigmaFile(); const file = processFile(originalFile); // ✨ You can now use `file` for whatever you need! ✨ // Let's get the styles for a component named "Test" const testStyles = file.shortcuts.components.find( component => component.name === "Test" ).shortcuts.styles;

Why use figma-transformer?

The Figma API is great but sometimes it feels like it's built for machines, not humans. The more you use it, the more you'll end up wasting a lot of time to get to the information that you want.

These are the most common problems:

  • Code needs to change if file structure changes
  • Incomplete information about styles and components
  • No type safety

With figma-transformer you get the file structure that you wished the Figma API had.

How does figma-transformer solve these problems?

Break free from the file structure

The Figma API response is very strict in terms of the file structure. To get to a specific node you have to navigate through the entire tree of nodes and it's really easy for your code to break if there's a change in the design file that changes the initial hierarchy.

We break from that rigid structure by creating shortcuts that are grouped by node type, making it a lot easier to access the nodes that we want irrespective of their placement in the file.

{ "children": [{...}, {...}], "shortcuts": { "CANVAS": [...], "INSTANCE": [...], "RECTANGLE": [...], "STYLE": [...], "TEXT": [...], "FRAME": [...], "COMPONENT": [...], "GROUP": [...] } }

We can see that even though this node just has two direct children, it actually contains a lot more elements down the tree, which are surfaced in the shortcuts.

Each node of the document tree contains the shortcuts to all their respective child nodes, which reduces the amount of work needed to get to the information we need.

Missing information from nodes

From the API we can get the information about the styles and components that are present in the file, which is great, but it doesn't contain all the information so we need to parse the entire file to get the additional information that we usuallly need.

Let's look at how the Figma API describes the styles in a document:

styles: { "1:12": { key: "ea017aed6616af00f3c4d59e3d945c8c3e47adca", name: "Green", styleType: "FILL", description: "", }, "1:11": { key: "e234400b962ffafce654af9b3220ce88857523ec", name: "Red", styleType: "FILL", description: "", }, "97:6": { key: "cc806814e1b9b7d20ce0b6bed8adf52099899c01", name: "Body", styleType: "TEXT", description: "", }, },

and this is how it's represented after being processed (note the populated styles from the associated nodes)

[ { id: "1:12", key: "ea017aed6616af00f3c4d59e3d945c8c3e47adca", name: "Green", styleType: "FILL", description: "", styles: [ { blendMode: "NORMAL", type: "SOLID", color: { r: 0.047774821519851685, g: 0.9563318490982056, b: 0.02923285961151123, a: 1, }, }, ], type: "STYLE", }, { id: "1:11", key: "e234400b962ffafce654af9b3220ce88857523ec", name: "Red", styleType: "FILL", description: "", styles: [ { blendMode: "NORMAL", type: "SOLID", color: { r: 0.8515284061431885, g: 0.11155396699905396, b: 0.11155396699905396, a: 1, }, }, ], textStyles: { fontFamily: "Roboto", fontPostScriptName: null, fontWeight: 400, fontSize: 12, textAlignHorizontal: "LEFT", textAlignVertical: "TOP", letterSpacing: 0, lineHeightPx: 14.0625, lineHeightPercent: 100, lineHeightUnit: "INTRINSIC_%", }, type: "STYLE", }, { id: "97:6", key: "cc806814e1b9b7d20ce0b6bed8adf52099899c01", name: "Body", styleType: "TEXT", description: "", textStyles: { fontFamily: "Roboto", fontPostScriptName: null, fontWeight: 400, fontSize: 12, textAlignHorizontal: "LEFT", textAlignVertical: "TOP", letterSpacing: 0, lineHeightPx: 14.0625, lineHeightPercent: 100, lineHeightUnit: "INTRINSIC_%", }, type: "STYLE", }, ];

The same happens with the components, this is what we get from the API:

components: { "1:5": { key: "", name: "Rectangle", description: "" }, },

and this is the processed data:

{ "id": "1:5", "parentId": "7:0", "fileId": "cLp23bR627jcuNSoBGkhL04E", "name": "Rectangle", "type": "COMPONENT", "blendMode": "PASS_THROUGH", "absoluteBoundingBox": { "x": -232, "y": -208, "width": 201, "height": 109 }, "constraints": { "vertical": "TOP", "horizontal": "LEFT" }, "clipsContent": false, "background": [ { "blendMode": "NORMAL", "visible": false, "type": "SOLID", "color": { "r": 1, "g": 1, "b": 1, "a": 1 } } ], "backgroundColor": { "r": 0, "g": 0, "b": 0, "a": 0 }, "effects": [], "children": [...], "shortcuts": {...} }

Not only we have the complete node definition but we also have its child nodes and shortcuts so we can easily navigate through the component tree if needed.

Improved type safety

The Figma API doesn't have official type definitions, but fortunately we can provide a better developer experience by extending the TypeScript type definitions provided by the awesome figma-js library.

This means that you can continue to use your preferred way of fetching the data from the Figma API and figma-transformer will provide the types for you.

Examples

Let's see more specific examples where the benefits of the library really stand out.

Getting all text used in a document

const text = file.shortcuts.texts.map(node => node.characters);

Finding the styles applied to a specific component

const styles = file.shortcuts.components .filter(component => component.name === "Test") .map(component => component.shortcuts.styles);

Getting the fill colours for all the rectangles in the first page

const fills = file.shortcuts.pages .filter(page => page.name === "Page 1") .map(page => page.shortcuts.rectangles.fills);

Projects using figma-transformer

  • figma-graphql
  • theme.figma

Local Development

Below is a list of commands you will probably find useful.

npm start or yarn start

Runs the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab.

Your library will be rebuilt if you make edits.

npm run build or yarn build

Bundles the package to the dist folder. The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).

npm test or yarn test

Runs the test watcher (Jest) in an interactive mode. By default, runs tests related to files changed since the last commit.

This project was bootstrapped with TSDX.

StarsIssuesVersionUpdatedⓘLast publish dateCreatedⓘPackage creation dateSizeⓘMinified + Gzipped size
F
figma-developer-mcp
11,577320.6.4a month ago9 months agoinstall size 5.1 KB
F
figma-transformer
57182.1.03 years ago6 years agoinstall size 1.1 KB

Dependencies Comparison

figma-developer-mcp

Dependencies

@figma/rest-api-spec^0.33.0
@modelcontextprotocol/sdk^1.10.2
@types/yargs^17.0.33
cross-env^7.0.3
dotenv^16.4.7
express^4.21.2
js-yaml^4.1.0
remeda^2.20.1
sharp^0.34.3
yargs^17.7.2
zod^3.24.2

Dev Dependencies

@changesets/changelog-github^0.5.1
@changesets/cli^2.29.2
@eslint/js^9.33.0
@types/express^5.0.0
@types/jest^29.5.14
@types/js-yaml^4.0.9
@types/node^20.17.0
@typescript-eslint/eslint-plugin^8.24.0
@typescript-eslint/parser^8.24.0
eslint^9.20.1
eslint-config-prettier^10.0.1
jest^29.7.0
prettier^3.5.0
ts-jest^29.2.5
tsup^8.4.0
tsx^4.19.2
typescript^5.7.3

Peer Dependencies

figma-transformer

Dependencies

Dev Dependencies

@types/jest^26.0.14
bundlesize^0.18.0
figma-js^1.13.0
husky^4.3.0
tsdx^0.14.0
typescript3.9.7

Peer Dependencies

Who's Using These Packages

figma-developer-mcp

Figma-Context-MCP
Figma-Context-MCP

MCP server to provide Figma layout information to AI coding agents like Cursor

mcp-cn
mcp-cn

MCP Hub 中国是一个专注于 Model Context Protocol (MCP) 生态的开源平台。它致力于汇聚全球优质的 MCP 服务,提供一站式的解决方案,包括服务发现、接入指南和使用示例,并建立完善的中文生态,欢迎开发者参与贡献和完善平台功能。

WeddingInvitations
WeddingInvitations

figma-transformer

react-ui
react-ui

Customisable components and primitives based on design tokens

figma-graphql
figma-graphql

The reimagined Figma API (super)powered by GraphQL

moon-design
moon-design

Moon Design System for React