figma-rest-mcp-server
v0.1.5
Published
Local MCP server for reading Figma design data through the Figma REST API.
Downloads
405
Maintainers
Readme
Figma REST MCP Server
本项目提供一个 stdio MCP Server,通过 Figma REST API 读取设计稿数据,并把完整快照缓存到本机用户目录。
接入流程
- 创建 Figma Personal Access Token
在 Figma 主页进入:
Settings -> Security -> Personal access tokens -> Generate new token权限建议:
file_content:read:必选,用于读取设计稿文件和节点内容。file_comments:read:可选,只有需要 AI 读取评论、备注、交互说明时再勾选。
- 全局安装 MCP 包
npm i -g figma-rest-mcp-server也可以使用 pnpm:
pnpm add -g figma-rest-mcp-server- 写入 Figma PAT
figma-rest-mcp auth默认写入:
~/.figma-rest-mcp-server/auth.jsonauth.json 是本机明文凭据文件,不能提交、不能共享。
- 查看运行路径
figma-rest-mcp paths默认路径:
~/.figma-rest-mcp-server/auth.json
~/.figma-rest-mcp-server/.figma-cache- 注册到 Codex
codex mcp add figma_rest -- figma-rest-mcp serve注册后重启 Codex App 或开启新会话。
在新会话中即可调用:
读取这个 Figma 链接:xxx 的布局和样式信息- 清空缓存
figma-rest-mcp cache:clear该命令只会删除并重建 ~/.figma-rest-mcp-server/.figma-cache,不会删除 auth.json。
本地开发
pnpm install
pnpm build
pnpm cli auth
pnpm cli paths
pnpm cli cache:clear
pnpm cli serve开发期也可以继续使用:
pnpm figma:pat发布
pnpm typecheck
pnpm test
pnpm build
pnpm pack --dry-run
npm publish原理介绍
见 ./原理介绍.md。
