Skip to content

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.

ToolSideDescription
create-rectanglepluginCreate a rectangle.
create-framepluginCreate a frame (default white fill — set-fill-color #00000000 for a transparent container).
create-textpluginCreate a text node. Typography: fontName + fontWeight or exact fontStyle, fontSize, lineHeight (px), letterSpacing (%), textAlign. Layout: width wraps text, maxLines truncates with an ellipsis.
create-instancepluginCreate an instance.
create-componentpluginCreate a component.
clone-nodepluginClone a node.
add-component-propertypluginAdd a component property.
add-prototype-linkpluginAdd a prototype interaction (click to navigate) between two nodes.
batch-createpluginBuild 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-infopluginLean 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-pagespluginGet all pages in the current file.
get-all-componentspluginGet all components in the current file.
list-fontspluginFonts available to Figma (no runtime upload — install locally). No family: names only; with family substring: exact style names for fontStyle.
move-nodepluginMove a node.
resize-nodepluginResize a node.
set-fill-colorpluginSet a solid fill color (#RRGGBBAA; alpha 00 = transparent).
set-fill-gradientpluginReplace 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-colorpluginSet the stroke (border): color, optional weight (px) and align (INSIDE/OUTSIDE/CENTER).
set-text-stylepluginRestyle an existing text node (font, size, color, lineHeight, letterSpacing, textAlign, width, maxLines); omitted fields unchanged.
set-effectspluginReplace all effects: DROP_SHADOW/INNER_SHADOW (color with alpha, offset, radius, spread) and LAYER_BLUR/BACKGROUND_BLUR (radius). [] clears.
set-corner-radiuspluginSet the corner radius of a node.
set-layoutpluginSet 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-idpluginMove 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-propertiespluginSet the properties of an instance.
edit-component-propertypluginEdit a component property.
set-node-component-property-referencespluginSet the component property references of a node.
delete-nodepluginDelete a node.
delete-component-propertypluginDelete a component property.
get-selectionnode+pluginGet the current selection in Figma. No params; returns whole TaskResult.
create-imagenode+pluginFetches url in Node (no CORS), forwards imageData bytes to plugin.
create-svgnode+pluginEditable 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-fillnode+pluginUse an image (url, fetched in Node like create-image) as the fill of an EXISTING node; scaleMode FILL/FIT/CROP/TILE.
export-assetnode+pluginRendered 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-filenode-onlyFans 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-clientsnode-onlyList 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).

  1. Call list-clients to see what's open.
  2. Pass targetFileKey on every follow-up call so only that file executes.
  3. 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-info calls on huge files are the usual cause of timeouts — retry with smaller depth / maxNodes / maxChars, or raise TASK_TIMEOUT_MS in mcp/.env. See Troubleshooting.
  • Some clients cap the tool count — disable tools you do not need in the client config.

Released under the Apache-2.0 License.