Tools (39)
30 tools forward directly to the plugin (name = task command), 9 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. segments: rich text in ONE node (each run overrides family/weight/style/size/color; runs must concatenate exactly to text). |
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 200 { op, ref?, params } (BATCH_MAX_OPS, ceiling 1000) (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 (also componentId/instanceId/nodeId/destinationId). Stops at the first failure with { failedIndex, op, reason, hint?, created }. atomic: true removes created nodes on failure instead of keeping partial work. |
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. |
find-nodes-by-name | plugin | Find nodes by name across the whole file (substring unless exact:true). Returns [{id, name, type, pageId, pageName}] up to limit (default 50). |
get-design-audit | plugin | Static audit of a subtree: empty texts, zero-area nodes, default names, hidden layers, low-contrast text (WCAG AA 4.5:1). Returns {audited, scanned, truncated, issues}. |
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. |
validate-image | node-only | Pre-check an image URL before create-image/set-image-fill: reports {ok, bytes, mime, width?, height?} without touching Figma. Catches 403s, wrong formats, oversized/tiny images. |
create-card | node-only | One-call product card: fans out over batch-create (+ create-image for the header) — no plugin handler by design. Auto-layout frame + title + optional meta/price/button (+ optional header image). Returns {cardId, titleId, buttonId?, imageId?}. |
export-asset | node+plugin | Rendered asset with real path data (SVG markup or PNG/JPG base64, scale max 4). PNG/JPG double as a frame screenshot — use after batch-create to visually self-review (batch-create → export-asset PNG → critique → fix). Prefer outputPath + Read the file when you need to SEE pixels (inline base64 is heavy and not every client renders it). 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 = delivered to exactly one connected window (the most recently active one) — never broadcast, so a mutating tool can't execute twice when two files are open. Pass targetFileKey explicitly whenever more than one file is open to control which file executes.
- 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.