Figma MCP 服务器
用于分析 Figma 文件结构的 MCP(模型上下文协议)服务器。
特征
分析 Figma 文件以提取节点层次结构
支持 REST API 和 MCP 协议
可配置节点树深度
先决条件
Node.js 16+
npm 或 yarn
Figma API 密钥
安装
来自 npm
从源头
配置
复制示例环境文件并添加您的 Figma API 密钥:
然后编辑.env
文件并添加您的 Figma API 密钥:
您可以从 Figma 帐户设置中获取 Figma API 密钥: https://www.figma.com/developers/api#access-tokens
用法
作为 REST API 服务器
启动服务器:
这将在端口 3000(或.env
文件中指定的端口)上启动 Express 服务器。
API 端点
GET /health
- 健康检查端点GET /openapi.json
- OpenAPI 规范GET /mcp.json
- MCP 清单POST /analyze
- 分析 Figma 文件
对分析端点的示例请求:
作为 MCP 服务器
LLM 可以通过 MCP 协议直接使用该服务器:
或者如果从源运行:
客户端示例
包含一个简单的客户端示例。使用方法如下:
最后一个参数是可选的深度参数。
发展
以开发模式运行
测试
Docker
提供了一个 Dockerfile 用于容器化部署:
执照
麻省理工学院
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
通过提取节点层次结构来促进对 Figma 文件结构的分析,可通过 REST API 或 MCP 协议访问。
Related Resources
Related MCP Servers
- -securityAlicense-qualityFigma MCP with full API functionalityLast updated -11341MIT License
- -securityFlicense-qualityExtracts components from Figma designs and transforms them into standardized JSON format for easy consumption by AI models and tools for interface reconstruction.Last updated -
- AsecurityAlicenseAqualityA Model Context Protocol server for interacting with the Figma API that handles large Figma files efficiently through memory-aware chunking and pagination capabilities.Last updated -73MIT License
- -securityFlicense-qualityA server that converts Figma designs into pseudo-code structures optimized for LLMs to understand design context, allowing easy extraction of visual elements and code-like representations from Figma files.Last updated -45