Tools (35)
28 tools forward directly to the plugin (name = task command), 7 have extra Node-side logic.
Contract parity is enforced by mcp/tests/contract/mcp-tools.test.ts and NODE_ONLY_TOOLS in mcp/src/tools/registry.ts.
| Tool | Side | Description |
|---|---|---|
create-rectangle | plugin | Create a rectangle. |
create-frame | plugin | Create a frame (default white fill — set-fill-color #00000000 for a transparent container). |
create-text | plugin | Create a text node. Typography: fontName + fontWeight or exact fontStyle, fontSize, lineHeight (px), letterSpacing (%), textAlign. Layout: width wraps text, maxLines truncates with an ellipsis. |
create-instance | plugin | Create an instance. |
create-component | plugin | Create a component. |
clone-node | plugin | Clone a node. |
add-component-property | plugin | Add a component property. |
add-prototype-link | plugin | Add a prototype interaction (click to navigate) between two nodes. |
batch-create | plugin | Build a subtree in ONE call, in order: up to 50 { op, ref?, params } (ops = create-frame/rectangle/text, set-layout, set-fill-color, set-fill-gradient, set-stroke-color, set-effects, set-corner-radius, set-text-style, set-parent-id). Later ops use "$ref" as id/parentId. Stops at the first failure with { failedIndex, reason, created } (no rollback). |
get-node-info | plugin | Lean layout/colors/content. depth: 0 = node only, N = N levels, -1 = full subtree. maxNodes (default 10000) + maxChars (default 35000) cap size; overflow becomes _truncated stubs with childrenTruncated: true and root _truncatedCount — re-request flagged ids. fields limits groups. |
get-pages | plugin | Get all pages in the current file. |
get-all-components | plugin | Get all components in the current file. |
list-fonts | plugin | Fonts available to Figma (no runtime upload — install locally). No family: names only; with family substring: exact style names for fontStyle. |
move-node | plugin | Move a node. |
resize-node | plugin | Resize a node. |
set-fill-color | plugin | Set a solid fill color (#RRGGBBAA; alpha 00 = transparent). |
set-fill-gradient | plugin | Replace the fill with a LINEAR (default) or RADIAL gradient: 2–16 stops {position 0..1, color}, angle (LINEAR, degrees: 0 = left→right, 90 = top→bottom). |
set-stroke-color | plugin | Set the stroke (border): color, optional weight (px) and align (INSIDE/OUTSIDE/CENTER). |
set-text-style | plugin | Restyle an existing text node (font, size, color, lineHeight, letterSpacing, textAlign, width, maxLines); omitted fields unchanged. |
set-effects | plugin | Replace all effects: DROP_SHADOW/INNER_SHADOW (color with alpha, offset, radius, spread) and LAYER_BLUR/BACKGROUND_BLUR (radius). [] clears. |
set-corner-radius | plugin | Set the corner radius of a node. |
set-layout | plugin | Set the layout of a node. Turning auto-layout on keeps a FIXED frame's size on any axis whose layoutSizing* is omitted (Figma would default to HUG). |
set-parent-id | plugin | Move a node into a parent or reorder it. index = position among children (0 = bottom of z-order, omit = append); absolute = ABSOLUTE positioning inside an auto-layout parent (overlays). |
set-instance-properties | plugin | Set the properties of an instance. |
edit-component-property | plugin | Edit a component property. |
set-node-component-property-references | plugin | Set the component property references of a node. |
delete-node | plugin | Delete a node. |
delete-component-property | plugin | Delete a component property. |
get-selection | node+plugin | Get the current selection in Figma. No params; returns whole TaskResult. |
create-image | node+plugin | Fetches url in Node (no CORS), forwards imageData bytes to plugin. |
create-svg | node+plugin | Editable vector from SVG: exactly one of svg (inline), url (fetched in Node, same SSRF guards as create-image), filePath (local .svg). Keeps intrinsic size; x/y/parentId place it. Max 5MB, rejects <!ENTITY. |
set-image-fill | node+plugin | Use an image (url, fetched in Node like create-image) as the fill of an EXISTING node; scaleMode FILL/FIT/CROP/TILE. |
export-asset | node+plugin | Rendered asset with real path data (SVG markup or PNG/JPG base64, scale max 4). With outputPath, writes to disk and returns {path, bytes} (max 20MB). |
export-file | node-only | Fans out over get-pages + get-node-info and writes one JSON per top-level frame + manifest.json. Params: outputDir (default <cwd>/exports/export-<ts>), maxNodes (default 5000), maxChars (default 35000). Guarded: max 500 frames, all writes confined to outputDir. No plugin handler by design. |
list-clients | node-only | List open Figma files with the plugin connected (one entry per window: fileName, fileKey, connectedAt). No plugin handler by design. |
Multi-window targeting
Every tool accepts targetFileKey (stable id, preferred) and targetFileName (human fallback). Both omitted = broadcast to all connected windows (old behavior).
- Call
list-clientsto see what's open. - Pass
targetFileKeyon every follow-up call so only that file executes. - A task targeted at a file that isn't open yet stays queued and fires when its window connects (or times out via
TASK_TIMEOUT_MS).
Tips
- Large
get-node-infocalls on huge files are the usual cause of timeouts — retry with smallerdepth/maxNodes/maxChars, or raiseTASK_TIMEOUT_MSinmcp/.env. See Troubleshooting. - Some clients cap the tool count — disable tools you do not need in the client config.