Skip to main content
Glama
Figma MCP Server

Figma MCP Server

by sanjeev23oct

Figma MCP 서버

Figma 디자인과 React 구현을 연결하는 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버는 Figma 파일 데이터를 처리하고 React 친화적인 형식으로 제공하여 Figma 디자인을 React 애플리케이션으로 픽셀 단위까지 완벽하게 변환할 수 있도록 지원합니다.

🚀 특징

  • Figma API 통합 : 디자인 파일에 액세스하기 위한 Figma API에 직접 연결

  • React-Ready Output : Figma 데이터를 React 호환 포맷으로 처리합니다.

  • 스타일 처리 : Figma 스타일을 CSS/스타일 구성 요소로 변환합니다.

  • 자산 관리 : 이미지 자산 및 SVG 구성 요소를 처리합니다.

  • 레이아웃 처리 : Figma 자동 레이아웃을 Flexbox로 변환합니다.

  • 유형 안전성 : 안정적인 유형 검사를 위해 TypeScript로 구축됨

Related MCP server: MCP Figma to React Converter

🛠️ 제공되는 도구

  1. get_file_content :

    • Figma 파일 콘텐츠를 가져와서 처리합니다.

    • 레이아웃, 스타일 및 구성 요소를 변환합니다.

    • React-ready 컴포넌트 구조 GXP1을 반환합니다.

  2. get_node_images :

    • Figma에서 이미지 자산을 검색합니다.

    • 다양한 포맷(PNG, JPG, SVG) 지원

    • 구성 가능한 스케일링 옵션 GXP2

📦 설치

  1. 저장소를 복제합니다.

    git clone https://github.com/yourusername/figma-mcp.git
    cd figma-mcp
  2. 종속성 설치:

    npm install
  3. Figma 액세스 토큰을 구성하세요.

    cp .env.example .env
    # Add your Figma access token to .env

🎯 커서 IDE 설정

  1. 프로젝트 루트에 .cursor/mcp.json 파일을 만듭니다.

    mkdir -p .cursor
    touch .cursor/mcp.json
  2. Stdio 기반 서버 구성의 경우:

    {
     "mcpServers": {
       "figma": {
         "command": "node",
         "args": ["d:/<folder>>/figma-mcp/build/index.js"],
         "env": {
           "FIGMA_ACCESS_TOKEN": "your figma token"
         },
         "disabled": false,
         "alwaysAllow": [],
         "protocol": "stdio"
       }
     }

}



## 💻 Usage

1. Build the server:
 ```bash
 npm run build
 ```

2. Configure MCP settings based on your IDE:

- For VS Code (global settings):
  ```json
  // In settings.json
  {
    "mcpServers": {
      "figma": {
        "command": "node",
        "args": ["path/to/figma-mcp/build/index.js"],
        "env": {
          "FIGMA_ACCESS_TOKEN": "your-token-here"
        }
      }
    }
  }
  ```

- For Cursor IDE:
  Use the `.cursor/mcp.json` configuration as described in the "Cursor IDE Setup" section above.
  This configuration will take precedence over VS Code settings when using Cursor IDE.

3. Use the MCP tools in your application:
```typescript
// Example: Fetch processed Figma content
const result = await useMcpTool("figma", "get_file_content", {
  fileKey: "your-figma-file-key"
});

🧩 예시 프로젝트

Figma 디자인의 픽셀 단위까지 완벽한 React 구현을 생성하기 위해 이 MCP 서버를 사용하는 전체 예는 raccoon-game 디렉토리에서 확인할 수 있습니다.

🔄 처리 파이프라인

  1. 입력 : Figma 공식 API를 통한 파일 데이터

  2. 처리중 :

    • 스타일 변환(색상, 타이포그래피, 효과)

    • 레이아웃 변환(Flexbox에 대한 절대값)

    • 구성 요소 계층 매핑

    • 자산 최적화

  3. 출력 : React 준비 완료 컴포넌트 데이터

📝 라이센스

MIT 라이센스

🤝 기여하기

기여를 환영합니다! 기여 지침을 꼭 읽어주세요.

🙏 감사의 말

  • 포괄적인 API를 위한 Figma API 팀

  • MCP 사양을 위한 모델 컨텍스트 프로토콜


[당신의 이름]이 ❤️로 만들었습니다

Available Tools

5 tools
add_figma_fileC

Add a Figma file to your context

Inputs: url (required).

post_commentC

Post a comment on a node in a Figma file

Inputs: file_key (required), message (required), x (required), y (required), +1 more.

read_commentsC

Get all comments on a Figma file

Inputs: file_key (required).

reply_to_commentC

Reply to an existing comment in a Figma file

Inputs: file_key (required), comment_id (required), message (required).

view_nodeC

Get a thumbnail for a specific node in a Figma file

Inputs: file_key (required), node_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific actions in Figma: adding files, posting comments, reading comments, replying to comments, and viewing nodes. There is no overlap in functionality, making it easy for an agent to select the correct tool without confusion.

    Naming Consistency4/5

    The naming follows a consistent verb_noun pattern (e.g., add_figma_file, post_comment) with clear and descriptive names. The only minor deviation is 'view_node' which uses 'view' instead of a more action-oriented verb like 'get', but it still fits the pattern well and remains readable.

    Tool Count5/5

    With 5 tools, the server is well-scoped for its purpose of interacting with Figma files, comments, and nodes. Each tool serves a distinct and necessary function, avoiding bloat while covering essential operations like file management and comment handling.

    Completeness4/5

    The toolset covers core workflows for Figma interactions, including file addition, comment management (post, read, reply), and node viewing. A minor gap is the lack of tools for updating or deleting files or comments, but agents can still perform basic operations effectively without major dead ends.

    Related MCP Connectors

    Related MCP Servers