figcraft
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFigCraft
FigCraft
Operate FigCraft through its structured automation interface. Preserve the user's requested design workflow and target file.
通过 FigCraft 的结构化自动化接口进行操作。保留用户所请求的设计工作流和目标文件。
Protocol reference
协议参考
Read the relevant sections of references/control-protocol.md before constructing calls. This is the downloaded upstream protocol, captured on 2026-11-02.
Source: FigCraft control protocol. The documentation is distributed under the bundled MIT license. Relative links inside the snapshot (e.g. ) refer to upstream documentation; resolve those against when needed. If installed behavior differs, inspect the installed command registry through rather than inventing parameters.
mcp.mdhttps://github.com/storytold/figcraft/blob/main/docs/engine.commands在构建调用之前,读取 references/control-protocol.md 的相关章节。这是已下载的上游协议快照,采集于 2026-11-02。
来源:FigCraft control protocol。文档依据随附的 MIT 许可证分发。快照内的相对链接(例如 )指向上游文档;如有需要,请相对于 进行解析。如果已安装版本的行为有所不同,请通过 检查已安装的命令注册表,而不要臆造参数。
mcp.mdhttps://github.com/storytold/figcraft/blob/main/docs/engine.commandsSelect the session
选择会话
- The desktop app serves the control channel on only:
127.0.0.1. For the user's open file, drive that live window, directly or through the attached MCP server (figcraft --control 7979 [file.figcraft|file.svg|image], see upstreamfigcraft-cli mcp --attach 7979).docs/mcp.md - The app can show files in several windows. Every method takes an optional id from
window(window.listis the main window); without it, requests go to the window last in front.0,engine.execute,document.inspect, andnode.getalso take an optionalui.render(open file id fromdocument, or a path) to act on a background tab.doc.list - The web build exposes the same methods as promises on when the page URL carries a
window.figcraftquery entry.control - Discover available executables and sessions first. If the required connection or executable is missing, report the concrete prerequisite; this skill does not install FigCraft or register an MCP server.
- 桌面应用仅在 上提供控制通道:
127.0.0.1。对于用户已打开的文件,可直接驱动该实时窗口,也可通过已附加的 MCP server 驱动它(figcraft --control 7979 [file.figcraft|file.svg|image],参见上游figcraft-cli mcp --attach 7979)。docs/mcp.md - 应用可以在多个窗口中显示文件。每个方法都接受一个可选的 id,该 id 来自
window(window.list为主窗口);如果不指定,请求将发送到最后位于前台的窗口。0、engine.execute、document.inspect和node.get还接受可选的ui.render(来自document的已打开文件 id,或一个路径),以便在后台标签页中执行操作。doc.list - 当页面 URL 带有 查询条目时,Web 构建版本会在
control上以 Promise 形式公开相同的方法。window.figcraft - 首先发现可用的可执行文件和会话。如果缺少所需连接或可执行文件,请报告具体的前置条件;此 skill 不会安装 FigCraft,也不会注册 MCP server。
Transport and limits
传输与限制
Requests are newline-delimited JSON, one per line, replies matched by ; check . Requests run on the UI thread at the start of the next frame. A 60 s timeout reply distinguishes a dropped request (never applied) from one already running (will take effect; inspect the document before retrying). A long request such as a big can raise its own wait with (up to 600000). A request line is limited to 32 MiB; at most 8 connections and 8 queued requests per queue are accepted. A minimised or covered window still answers state methods but cannot take or until it paints.
idokcommand.batchtimeoutMsui.screenshotui.input请求采用换行分隔的 JSON,每行一个,回复通过 匹配;请检查 。请求在下一帧开始时于 UI 线程上运行。60 秒超时回复可用于区分被丢弃的请求(从未应用)与已在运行的请求(将生效;重试前检查文档)。这类长请求(例如大型 )可通过 (最高 600000)延长自身的等待时间。单行请求限制为 32 MiB;最多接受 8 个连接,每个队列最多可容纳 8 个排队请求。最小化或被遮挡的窗口仍会响应状态方法,但在完成绘制前无法执行 或 。
idokcommand.batchtimeoutMsui.screenshotui.inputInspect, edit, and verify
检查、编辑与验证
Inspect before editing: (pages, layer tree, selection, styles, undo history; use , , or to bound output) and for one layer. Discover command ids, parameters, and menus through .
document.inspectdepthfieldsoutline: truenode.get {id}engine.commandsEdit through ; programmatic calls never open dialogs. Creation commands return ; use real returned ids. Unknown parameters are errors, never ignored. Prefer editable nodes: , , , , , plus gestures. Use for known sequences; with only failed steps roll back, and steps can reference earlier results with or . Pass beside so comment activity is signed as an AI agent.
engine.execute {command, params}{"id": N}frame.createnode.createnode.setshape.*text.*tool.setui.pointercommand.batchonError: "continue"{"$ref": "name"}{"$step": n}agentcommandCoordinates are page units, y down; / in / are relative to the parent frame. takes page coordinates or screen pixels (, ); sends raw window input (separate calls for press and release); sends canvas shortcuts; goes to the text being edited (begin with or a double-click). clicks a menu item and may open a dialog; switches panels, tabs, and pickers.
xynode.setnode.createui.pointersxsyui.inputui.keyui.typetext.edit.begin {id}ui.menu.invokeui.setVerify with (document PNG without chrome, works without a window) or (whole window). Report material import warnings; and return a .
ui.renderui.screenshotfile.openfile.importsummary- 编辑前先检查:使用 检查页面、图层树、选区、样式和撤销历史(使用
document.inspect、depth或fields限制输出范围),并使用outline: true获取单个图层。通过node.get {id}发现命令 ID、参数和菜单。engine.commands - 通过 进行编辑;程序化调用永远不会打开对话框。创建命令返回
engine.execute {command, params};请使用实际返回的 id。未知参数会触发错误,绝不会被忽略。应优先使用可编辑节点:{"id": N}、frame.create、node.create、node.set、shape.*、text.*,以及tool.set手势。对已知操作序列使用ui.pointer;设置command.batch时,仅失败的步骤会回滚,并且后续步骤可以通过onError: "continue"或{"$ref": "name"}引用早期结果。在{"$step": n}旁传入command,使评论活动以 AI Agent 身份签名。agent - 坐标使用页面单位,y 轴向下;在 /
node.set中,node.create/x相对于父级 frame。y接受页面坐标或屏幕像素(ui.pointer、sx);sy发送原始窗口输入(按下和释放需分别调用);ui.input发送画布快捷键;ui.key将输入发送到正在编辑的文本(先使用ui.type,或双击)。text.edit.begin {id}点击菜单项,并且可能会打开对话框;ui.menu.invoke用于切换面板、标签页和选择器。ui.set - 使用 进行验证(生成不含界面框架的文档 PNG,无需窗口即可工作),或使用
ui.render(捕获整个窗口)。报告重要的素材导入警告;ui.screenshot和file.open会返回file.import。summary
File access and output
文件访问与输出
--automation-read-root--automation-write-rootautomation path rejected: ….figcraftevents.pollcursorreset--automation-read-root--automation-write-rootautomation path rejected: ….figcraftevents.pollcursorreset