Figma and FigJam
Build native, editable Figma and FigJam nodes through the Figma MCP.
Figma
-f figma writes out/figma/<slug>-NN.js plus <slug>.assets.json. Through the Figma MCP:
- Run each
-NN.jsin order withuse_figmaagainst a Design or Slides file. The diagram becomes a frame (Design) or a slide (Slides) namedspinagram:<id>. Re-running rebuilds its content in place and keeps the canvas position. - Images:
use_figmacannot add image bytes, so the script draws placeholders and returnsimageTargets: [{nodeId, asset}]. Callupload_assets(fileKey, count=n, nodeIds=[...]), then POST each file listed inassets.jsonto its returned URL.
Edges are vectors with arrow caps. Figma's Connector node exists only in FigJam.
Dry-run a script on a mock Plugin API:
node tests/js/figma_mock.mjs out/figma/<slug>-01.jsFigJam
spinagram render specs/ -f figjam -o out/ writes, under out/figma/, library-mode scripts plus
the icon bundle (icons/, icon-library.js, README.md). With the Figma MCP: upload_assets for
every file in icons/ (multipart, so each layer is named after its file), run icon-library.js
once, then each <slug>-NN.js. Details are in the generated README.md.
FigJam reads connector positions in pixels, so edges anchored on a side centre become magnet
endpoints and everything else a pixel position.