figma-bridge
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FIGMA_BRIDGE_PORT | No | Default port can be overridden with the FIGMA_BRIDGE_PORT environment variable. After changing the port, you must also update plugin/manifest.json's devAllowedDomains, rebuild the plugin, and re-import it. | 17653 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
这是本机 Figma 桥,只操作当前打开文件的当前页。先调 figma_status;插件未连接时不要空等。完整写入原则见资源 figma://write-guidelines。
写入画布时必须遵守:
先判断图文关系再写节点:并排、字压在图上、放大的独立图形、材质混合。不能看见「图旁边有字」就随便叠。
能流式排的用嵌套 Auto Layout。只有压图、印章重叠才用 layoutPositioning: ABSOLUTE。
打开 Auto Layout 后,横排全宽区块设 horizontalSizing: FIXED,或子项 FILL;否则主轴默认 HUG,宽度会收窄。
按钮必须是 Auto Layout Frame 包住文案并十字居中,不要矩形旁边再摆一行字。
摄影和矢量插图只走本机文件(figma_create_image)。色块不能当成已经插图。
去底用 figma_set_fill 的 clear: true,不要用 a: 0 的填充冒充。
指定字体加载失败就报错,不要擅自换字体。
改完用 figma_export_node 导出到本地再对照,不能只报「节点已创建」。一次不要并行太多写入。
动手前先做图层盘点。每一块都要单独核对:底、容器底(卡片/行/aside 自己的填充)、描边、列表铬(编号、分割线)、饰件(图标、贴纸)、字、图、按钮、效果。缺一层就还没还原完。
纯色不能代替渐变或混合。figma_set_fill 只写纯色;渐变和 multiply 先落成本机 SVG/PNG,再用 figma_create_image。
有图不等于没有描边。白底页面不等于卡片没有灰底。先列出所有非透明背景和 border>0,再用 figma_set_fill / figma_set_stroke 写上。
复刻流程:先按目标宽度量官网并做铬清单,再按块写,再按块导出对照。不要先铺文案再补层。
字压图时,文案必须落在图的留白里,不能压住产品主体。先量官网图的画幅和 object-fit;不要把更瘦的产品图拉伸进正方形。
背景摄影要铺满容器。官网 cover / 全宽背景用 scaleMode: FILL,节点与区块同宽同高。不要把宽幅图做成窄配图,两侧露出底色。
底要核对照片是哪一张、什么构图。视频首帧和静态产品图可能完全不同;用错构图等于背景效果错了。
页脚和导航目录必须按官网列齐全,含分组标题和每条链接。不能用简化几列或合并短名单冒充完整目录。
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| figma_statusA | 查询插件是否已连接,以及当前文件与页面。未连接也成功返回。 |
| figma_get_document_infoB | 获取当前文件名、页面列表和当前页 id。 |
| figma_get_current_pageB | 获取当前页摘要、顶层子节点和选区。 |
| figma_set_current_pageC | 切换到指定页面。会先 loadAsync。 |
| figma_get_selectionA | 获取当前选区摘要。空选区返回空数组,不是错误。 |
| figma_get_nodeC | 读取单个节点。detail=summary|layout|rest_json,默认 layout。 |
| figma_get_node_treeC | 读取 layout 级节点树,供浏览结构。 |
| figma_read_for_implementA | 像素级还原打包:结构、预览图、位图资源落到 outputDir。省略 nodeId 时要求恰好选中 1 个节点。 |
| figma_export_nodeB | 导出节点到本地文件。必须提供绝对路径 outputPath。不要把图片以 base64 传回。 |
| figma_create_frameB | 在当前页或指定父节点创建 Frame。复刻时优先嵌套 Auto Layout;按钮用 Frame 包文案并居中。 |
| figma_create_rectangleD | 创建矩形。 |
| figma_create_ellipseD | 创建椭圆。 |
| figma_create_textC | 创建文本。指定字体失败不会改用其它字体。 |
| figma_create_imageB | 从本机图片文件创建矩形或 SVG 节点。不支持远程 URL。色块不能当成已经插图。 |
| figma_update_nodeC | 更新节点名称、位置、尺寸、可见性、透明度、旋转,以及 Auto Layout 子项的 FILL/HUG/绝对定位。 |
| figma_set_fillB | 设置单层纯色填充,或用 clear 去掉填充(透明 Frame,不要用 a:0 冒充去底)。 |
| figma_set_strokeC | 设置单层实线描边。 |
| figma_set_effectsC | 设置效果。第一版可写 BACKGROUND_BLUR / LAYER_BLUR / DROP_SHADOW / INNER_SHADOW。毛玻璃用半透明填充加 BACKGROUND_BLUR。 |
| figma_set_corner_radiusC | 设置圆角。四角独立优先。 |
| figma_set_text_styleD | 设置文本节点级样式。 |
| figma_set_auto_layoutB | 设置 Auto Layout。打开后要把横排全宽设 FIXED 或子项 FILL,否则会 HUG 变窄。 |
| figma_move_nodeC | 移动节点,可选换父级。 |
| figma_delete_nodeB | 删除节点。不能删除 PAGE 或 DOCUMENT。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| write-guidelines | 跨稿通用的 Figma 写入原则。复刻或改稿前先读。不含某一页的量测。 |
TDQS
Scored across 23 tools
The create_*/set_*/update_* families each target a distinct node property, and the read tools are mostly separable. There is mild overlap between figma_status, figma_get_document_info and figma_get_current_page (all report file/page context), and between figma_read_for_implement and figma_export_node (both dump node assets), but the descriptions clarify the boundaries.
Every tool uses a predictable figma_<verb>_<noun> snake_case pattern (get_node, create_frame, set_fill, delete_node). The only deviation is figma_status, which omits the verb, but it remains readable and clearly scoped as a status probe.
23 tools is on the heavy edge for a single-plugin bridge and could be consolidated (e.g. one generic style setter, or merging the three document/page reads). Most tools do earn a place as distinct Figma node primitives, so it is borderline rather than bloated.
The surface covers the full node lifecycle: read/inspect, create primitives, update geometry, style (fill, stroke, effects, radius, text style, auto layout), move/reparent, export and delete. Gaps remain around editing existing text content, grouping/boolean ops, and component/instance creation, but agents can work around these by recreating nodes.