Skip to main content
Glama

Figma MCP Server

by moonray

Figma MCP 服务器

用于分析 Figma 文件结构的 MCP(模型上下文协议)服务器。

特征

  • 分析 Figma 文件以提取节点层次结构
  • 支持 REST API 和 MCP 协议
  • 可配置节点树深度

先决条件

  • Node.js 16+
  • npm 或 yarn
  • Figma API 密钥

安装

来自 npm

npm install -g figma-mcp-server

从源头

git clone https://github.com/yourusername/mcp-figma.git cd mcp-figma npm install npm run build

配置

复制示例环境文件并添加您的 Figma API 密钥:

cp .env.example .env

然后编辑.env文件并添加您的 Figma API 密钥:

FIGMA_API_KEY=your_figma_api_key_here

您可以从 Figma 帐户设置中获取 Figma API 密钥: https://www.figma.com/developers/api#access-tokens

用法

作为 REST API 服务器

启动服务器:

npm start

这将在端口 3000(或.env文件中指定的端口)上启动 Express 服务器。

API 端点
  • GET /health - 健康检查端点
  • GET /openapi.json - OpenAPI 规范
  • GET /mcp.json - MCP 清单
  • POST /analyze - 分析 Figma 文件

对分析端点的示例请求:

curl -X POST http://localhost:3000/analyze \ -H "Content-Type: application/json" \ -d '{"figmaUrl": "https://www.figma.com/file/FILE_ID/PROJECT_NAME?node-id=NODE_ID", "depth": 2}'

作为 MCP 服务器

LLM 可以通过 MCP 协议直接使用该服务器:

figma-mcp-server --cli

或者如果从源运行:

npm run start -- --cli

客户端示例

包含一个简单的客户端示例。使用方法如下:

node client-example.js https://www.figma.com/file/FILE_ID/PROJECT_NAME?node-id=NODE_ID 2

最后一个参数是可选的深度参数。

发展

以开发模式运行

npm run dev

测试

npm test

Docker

提供了一个 Dockerfile 用于容器化部署:

docker build -t figma-mcp-server . docker run -p 3000:3000 --env-file .env figma-mcp-server

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

通过提取节点层次结构来促进对 Figma 文件结构的分析,可通过 REST API 或 MCP 协议访问。

  1. 特征
    1. 先决条件
      1. 安装
        1. 来自 npm
        2. 从源头
      2. 配置
        1. 用法
          1. 作为 REST API 服务器
          2. 作为 MCP 服务器
          3. 客户端示例
        2. 发展
          1. 以开发模式运行
          2. 测试
        3. Docker
          1. 执照

            Related MCP Servers

            • A
              security
              F
              license
              A
              quality
              Enables seamless interaction with Figma via the Model Context Protocol, allowing LLM applications to access, manipulate, and track Figma files, components, and variables.
              Last updated -
              2
              106
              TypeScript
              • Apple
            • -
              security
              A
              license
              -
              quality
              Enables Cursor to access Figma files through the Model Context Protocol, enhancing its ability to accurately interpret and utilize design data for code generation.
              Last updated -
              5
              60,738
              8,062
              TypeScript
              MIT License
              • Linux
              • Apple
            • -
              security
              A
              license
              -
              quality
              Figma MCP with full API functionality
              Last updated -
              54
              16
              TypeScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              Extracts components from Figma designs and transforms them into standardized JSON format for easy consumption by AI models and tools for interface reconstruction.
              Last updated -
              TypeScript

            View all related MCP servers

            MCP directory API

            We provide all the information about MCP servers via our MCP API.

            curl -X GET 'https://glama.ai/api/mcp/v1/servers/moonray/mcp-figma'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server