io.github.felixAnhalt/Figma-Context-MCP

平台与服务

by felixanhalt

面向 LLM 优化的 Figma MCP 服务器,帮助模型更高效地理解设计上下文与组件信息。

什么是 io.github.felixAnhalt/Figma-Context-MCP

面向 LLM 优化的 Figma MCP 服务器,帮助模型更高效地理解设计上下文与组件信息。

README

<div align="center"> <h1>Figma To Code MCP</h1> <h3>Transform Figma design data into a compact, LLM-friendly format for code generation and UI building.</h3> <a href="https://npmcharts.com/compare/tmegit-figma-to-code-mcp?interval=30"> <img alt="weekly downloads" src="https://img.shields.io/npm/dm/tmegit-figma-to-code-mcp.svg"> </a> <a href="https://github.com/felixAnhalt/figma-to-code-mcp/blob/main/LICENSE"> <img alt="MIT License" src="https://img.shields.io/github/license/felixAnhalt/figma-to-code-mcp" /> </a> <br /> </div> <br/>

Why This Project?

Figma To Code MCP specializes in extracting only the information LLMs need to build UIs while removing Figma-specific metadata that isn't relevant for code generation. The result:

  • 99.5% size reduction on real Figma files (65 MB → 128 KB)
  • CSS-aligned property names (backgroundColor, flexDirection, etc.) matching LLM training data
  • Complete UI-building data preserved (layout, styling, text, components)
  • Inline styles - no separate dictionaries to parse
  • Omits Figma internals - no bounding boxes, constraints, or prototype data
  • Variable resolution - resolves Figma variables to actual values
  • SVG support - exports vector graphics to disk
  • Pattern collapsing - deduplicates repeating UI patterns

Give Cursor and other AI-powered coding tools access to your Figma files with this Model Context Protocol server.

Available Tools

ToolDescription
get_figma_designFetches CSS-aligned, LLM-optimized design data
get_image_fillsRetrieves image fill URLs from a Figma file
render_node_imagesRenders Figma nodes as PNG images
read_vector_svgReads vector node data as SVG

Required Scopes

Create a Figma personal access token with these scopes:

ScopePurpose
file_content:readRead file nodes, layout, styles
library_content:readRead published components/styles
file_variables:readRead variables (Enterprise only, optional)

Note: Variable resolution requires Enterprise plan. Set resolveVariables: false if not on Enterprise.

How it works

  1. Open your IDE's chat (e.g. agent mode in Cursor).
  2. Paste a link to a Figma file, frame, or group.
  3. Ask Cursor to implement the design.
  4. Cursor fetches CSS-aligned, LLM-optimized design data and generates accurate code.

This MCP server transforms Figma API data into an LLM-friendly format:

  • CSS property names (backgroundColor, flexDirection, fontSize) instead of Figma internals
  • Inline styles directly in nodes (no separate dictionaries)
  • Flexbox primitives for layout (no absolute positioning)
  • Complete UI data (colors, typography, spacing, effects)
  • 99.5% size reduction while preserving all UI-critical information

See V2_CSS_PROPERTY_MAPPING.md for complete property mapping details.

Getting Started

Many code editors and other AI clients use a configuration file to manage MCP servers.

The tmegit-figma-to-code-mcp server can be configured by adding the following to your configuration file.

MacOS / Linux

json
{
  "mcpServers": {
    "Figma To Code MCP": {
      "command": "npx",
      "args": ["-y", "@tmegit/figma-to-code-mcp", "--figma-api-key=YOUR-KEY", "--stdio"]
    }
  }
}

Windows

json
{
  "mcpServers": {
    "Figma To Code MCP": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@tmegit/figma-to-code-mcp",
        "--figma-api-key=YOUR-KEY",
        "--stdio"
      ]
    }
  }
}

Or you can set FIGMA_API_KEY and PORT in the env field.

API Calls & Rate Limits

One execution of get_figma_design makes the following API calls:

CallEndpointTierDescription
1GET /v1/files/{fileKey}/nodesT1Fetch requested nodes (geometry=paths)
2GET /v1/files/{fileKey}/stylesT3Fetch all styles
3GET /v1/files/{fileKey}/variables/localT2Fetch local variables (if resolveVariables=true)
4GET /v1/components/{key}T3Resolve component key → library file (up to 3 tries)
5GET /v1/files/{libFileKey}/componentsT3Fetch all components from library
6+GET /v1/files/{libFileKey}/nodesT1Fetch component definitions from each library

Amount of T1 calls: 1 + N (N=number of unique library files) Amount of T2 calls: 1 (if resolveVariables=true) Amount of T3 calls: 2 + N (styles + component key resolution + N library components)

For Professional plan with Dev/Full seat: 10 req/min (Tier 1), 25 req/min (Tier 2), 50 req/min (Tier 3).

Star History

<a href="https://star-history.com/#felixAnhalt/figma-to-code-mcp"><img src="https://api.star-history.com/svg?repos=felixAnhalt/figma-to-code-mcp&type=Date" alt="Star History Chart" width="600" /></a>

Acknowledgment

This project was initially inspired by the ideas explored in the original Figma Context MCP by GLips: https://github.com/glips/figma-context-mcp

While the original project provides a Model Context Protocol (MCP) server that simplifies Figma data for use with AI coding agents, this implementation has been substantially redesigned with a different data model, API, and processing approach, and should be considered an independent system.

常见问题

io.github.felixAnhalt/Figma-Context-MCP 是什么?

面向 LLM 优化的 Figma MCP 服务器,帮助模型更高效地理解设计上下文与组件信息。

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描114.1k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描114.1k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描10.2k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.4k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.4k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
35.4k

评论