figsnap-mcp

v0.2.0
io.github.arimunandar/figsnap-mcp Checked 2 days ago Published 2 months ago

The Figma file you have open, as MCP tools.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

figma_get_selection What is selected

The layers the designer has selected on the canvas right now, with their ids, names, types and sizes. Start here when the request says "this", "the selected frame", or names nothing at all.

figma_get_tree Layers on the current page

The top-level layers of the page the designer is looking at. Increase depth to walk further down, but note that a deep page is thousands of rows: prefer figma_get_children on one branch.

ParameterTypeDescription
depthintegerHow many levels to walk. Default 1.

figma_get_children Children of one layer

The direct children of one node, by id. The cheap way to explore a page a branch at a time.

ParameterTypeDescription
nodeId *stringThe node whose children to list.
depthintegerHow many levels to walk. Default 1.

figma_extract Read a design as code

The full extraction of one node: HTML measured against what Figma draws, byte-exact figmaCss, a React component, plain CSS and CSS modules. Images are inlined and icons come out as real SVG, so the HTML stands on its own. This is the tool that answers "what does this design actually say". Several nodes at once, instead of one call each: nodeIds, urls, selection: true, or saved: true with an optional folder. A batch answers {results:[…]}, one entry per input, each {ok:true,extraction} or {ok:false,error}, so one bad id never sinks the rest. It is capped at 20 entries, and no batch returns an…

ParameterTypeDescription
folderstringOne folder of the saved set, with saved: true. "" is the root. This is a folder in the panel, not a directory on disk — nothing here writes files; ask for pngData and write the bytes yourself.
formatsarrayWhich representations to return. Default html and figmaCss. "png" comes back as a real image you can look at, alongside the text — there is no base64 in the answer, so ask for it freely on a single…
inlineInstancesbooleanExpand component instances instead of referencing them.
nodeIdstringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
nodeIdsarraySeveral node ids, extracted in one call. Up to 20.
savedbooleanExtract the designer’s saved set. Narrow it with folder.
scalenumberRender scale for any image output. Default 2.
selectionbooleanExtract every layer the designer has selected, not just the first.
topLayerOnlybooleanStop at the selected layer rather than walking into it.
urlstringA Figma link, as an alternative to nodeId.
urlsarraySeveral Figma links, extracted in one call. Up to 20.

figma_export_png See the design

Renders one node and returns the picture itself, so a model that can see gets to look at the design rather than read a description of it. Nothing is stored anywhere.

ParameterTypeDescription
nodeId *stringThe node to render.
scalenumberRender scale. Default 2.

figma_resolve_url What a Figma link points at

Turns one or more Figma links into the nodes they name, without exporting anything.

ParameterTypeDescription
urls *arrayFigma links to resolve.

figma_list_saved The designer’s saved set

The nodes the designer curated in the panel, by folder. A shortlist of what matters in this file, which is usually a better starting point than the whole page.

ParameterTypeDescription
folderstringRestrict to one folder.

figma_saved Curate the saved set

Read and change the designer’s shortlist of nodes in this file, and the folders it is grouped into. One action argument: list, folders, save, unsave, clear, move, newFolder, renameFolder, deleteFolder. list — the entries, optionally in one folder. folders — the folders with their counts; "" is the root. save — add nodeIds, or whatever is selected when you give none. unsave — remove nodeIds. clear — empty one folder, or the whole set when you name none. move — put nodeIds in folder. newFolder / renameFolder / deleteFolder — the folders themselves; deleteFolder keeps the entries…

ParameterTypeDescription
action *stringWhich of the nine.
deleteEntriesbooleanFor deleteFolder: remove what was in it too, rather than returning it to the root.
folderstringFor list, save, clear and move. "" is the root; the folder must already exist for move.
fromstringFor renameFolder: the folder as it is called now.
namestringFor newFolder and deleteFolder.
nodeIdsarrayFor save, unsave and move. Omitting them on save means the current selection.
tostringFor renameFolder: what to call it instead.

figma_list_library The design system in this file

The components, styles and variables this file has, with the ids the other tools need. Read this before "make it match our button" or "use our brand colour" — instantiating the real component or binding the real variable is what makes a change survive contact with the design system, rather than a hex code that looks right today.

ParameterTypeDescription
onlystringNarrow the answer. Default all three.

figma_select Show it on the canvas

Selects one or more layers and scrolls the canvas to them, so the designer is looking at whatever you are talking about. Use it before describing a node you found by walking the tree — pointing is faster than naming an id — and after an edit, so the change is on screen. It changes no design data, which is why it works whether or not Edits is on, and why it leaves no undo step. It does move the designer’s viewport, so say what you are showing them.

ParameterTypeDescription
nodeIdstringOne node to select and scroll to.
nodeIdsarraySeveral, selected together and framed together. Up to 20.

figma_set_fill Set a solid fill

Replaces a node’s fills with one solid colour, and answers with the colour read back off the node — so a write that did not land is visible without a screenshot. It replaces every fill the node had, which is worth knowing before pointing it at a gradient or a photograph; the answer names what was there. Borders are strokes, not fills: use figma_set_stroke for those. One call is one undo step, so the designer takes it back with a single Cmd-Z.

ParameterTypeDescription
color *stringHex colour, like "#1e88e5".
nodeId *stringThe node to fill.
opacitynumberFill opacity, 0 to 1. Default 1.

figma_set_stroke Set or clear a stroke

Replaces a node’s strokes with one solid colour, and optionally sets the stroke weight. Pass remove: true to take the stroke off entirely. Borders in Figma are strokes, not fills — a row outline or an icon drawn as an outline needs this rather than figma_set_fill.

ParameterTypeDescription
nodeId *stringThe node to stroke.
colorstringHex colour, like "#1e88e5". Omit only with remove.
opacitynumberStroke opacity, 0 to 1. Default 1.
removebooleanRemove every stroke instead of setting one.
weightnumberStroke weight in pixels. Left alone when omitted.

figma_set_text Set the characters of a text layer

Replaces the text of one TEXT node. The font is loaded first; a layer whose font is missing from this machine is refused rather than silently retyped in a substitute.

ParameterTypeDescription
nodeId *stringThe TEXT node to retype.
text *stringThe new characters.

figma_set_auto_layout Set auto layout on a frame

Turns auto layout on for a frame and sets its direction, spacing, padding and alignment. Pass mode "NONE" to turn it off. Only the properties you name are changed.

ParameterTypeDescription
mode *stringLayout direction.
nodeId *stringThe frame, component or instance to lay out.
counterAxisAlignItemsstringAlignment across the layout direction.
itemSpacingnumberGap between children.
paddingnumberShorthand: sets all four paddings.
paddingBottomnumber
paddingLeftnumber
paddingRightnumber
paddingTopnumber
primaryAxisAlignItemsstringAlignment along the layout direction.

figma_create_frame Create a frame

Creates an empty frame, on the current page or inside a parent you name. Returns the new node’s id so the next call can fill it.

ParameterTypeDescription
fillstringHex colour for a solid background. Omit to keep Figma’s default white.
heightnumberDefault 100.
namestringLayer name. Default "Frame".
parentIdstringPut it inside this node. Default: the current page.
widthnumberDefault 100.
xnumber
ynumber

figma_create_text Add a text layer

Creates a TEXT layer with the words you give it. The font is loaded before anything is typed, and a font this machine does not have is refused rather than substituted. Give a width to make it wrap; without one it hugs its text.

ParameterTypeDescription
text *stringThe characters.
colorstringHex colour for the text.
fontFamilystringDefault Inter.
fontSizenumber
fontStylestringWeight or style, like "Bold". Default Regular.
namestringLayer name. Defaults to the text itself.
parentIdstringPut it inside this node. Default: the current page.
widthnumberFixed width, so the text wraps.
xnumber
ynumber

figma_create_rectangle Add a rectangle

Creates a rectangle. The workhorse shape: dividers, bars, backgrounds, placeholders. Omit the fill for an empty one.

ParameterTypeDescription
cornerRadiusnumber
fillstringHex colour. Omit for no fill.
heightnumberDefault 100.
namestring
parentIdstringPut it inside this node. Default: the current page.
widthnumberDefault 100.
xnumber
ynumber

figma_create_ellipse Add an ellipse

Creates an ellipse. Equal width and height give a circle — an avatar, a dot, a radio button.

ParameterTypeDescription
fillstringHex colour. Omit for no fill.
heightnumberDefault 100.
namestring
parentIdstring
widthnumberDefault 100.
xnumber
ynumber

figma_create_svg Draw with SVG

Turns SVG markup into real Figma vectors — not an image, but editable paths in a frame. This is how to add an icon, a logo or any shape the other create tools cannot express. Extraction returns icons as SVG too, so a shape can be read out of one place and drawn into another unchanged.

ParameterTypeDescription
svg *stringThe <svg> markup.
heightnumber
namestring
parentIdstring
widthnumberScale it to this width.
xnumber
ynumber

figma_create_instance Place a component

Creates an instance of a component in this file. Get the id from figma_list_library. Naming a variant set places its default variant. Prefer this over drawing a lookalike: an instance keeps its link to the component and updates with it.

ParameterTypeDescription
componentId *stringFrom figma_list_library.
namestring
parentIdstring
xnumber
ynumber

figma_clone_node Duplicate a layer

Copies a node, with everything inside it, into the same parent or one you name. The cheapest way to make a second row, card or list item that matches the first exactly.

ParameterTypeDescription
nodeId *stringThe node to copy.
parentIdstringWhere the copy goes. Default: beside the original.
xnumber
ynumber

figma_move_node Reparent or reorder a layer

Moves a node into another parent, or to a different position among its siblings. Index 0 is the back of the canvas and the top of a layer list; leaving it out puts the node last.

ParameterTypeDescription
nodeId *stringThe node to move.
indexintegerPosition among siblings.
parentIdstringNew parent. Default: keep the one it has.

figma_delete_node Delete a layer

Removes a node and everything inside it. One undo step, so the designer can take it back with a single Cmd-Z — but say what you are deleting before you do it.

ParameterTypeDescription
nodeId *stringThe node to delete.

figma_set_bounds Move or resize

Sets position and size. Position is ignored inside an auto-layout frame, where the parent decides it — use figma_set_layout_sizing and the parent’s spacing there instead.

ParameterTypeDescription
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
heightnumber
widthnumber
xnumber
ynumber

figma_set_corner_radius Round the corners

Sets one radius for every corner, or each corner on its own.

ParameterTypeDescription
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
bottomLeftRadiusnumber
bottomRightRadiusnumber
radiusnumberAll four corners.
topLeftRadiusnumber
topRightRadiusnumber

figma_set_node_name Rename a layer

Renames a layer. Layer names are what the generated code turns into class names, so tidying them is a real change and not cosmetic.

ParameterTypeDescription
name *string
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.

figma_set_visibility Hide, lock or fade a layer

Sets opacity, visibility and lock. Hidden layers are skipped by extraction, which is often the point.

ParameterTypeDescription
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
lockedboolean
opacitynumber
visibleboolean

figma_set_effects Set shadows and blurs

Replaces a node’s effects with the list you give. An empty list clears them. Elevation in most design systems is a drop shadow, so this is what "make it look raised" means.

ParameterTypeDescription
effects *arrayIn back-to-front order. Empty clears every effect.
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.

figma_set_text_style Set type on a text layer

Font, size, line height, letter spacing, alignment and colour, on a TEXT layer. Only what you name is changed. Prefer figma_apply_style where the file has a text style for it — a named style survives a redesign and a hard-coded 14px does not.

ParameterTypeDescription
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
alignstring
autoResizestring
colorstringHex colour.
fontFamilystring
fontSizenumber
fontStylestringWeight or style, like "Semi Bold".
letterSpacingnumberIn pixels.
lineHeightnumberIn pixels.

figma_set_layout_sizing Hug, fill or fix a size

How a child behaves inside an auto-layout frame: HUG shrinks to its contents, FILL stretches to the parent, FIXED keeps its size. This, not figma_set_bounds, is how widths are set inside auto layout.

ParameterTypeDescription
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
horizontalstring
verticalstring

figma_apply_style Apply a shared style

Applies a paint, text or effect style from this file by id, from figma_list_library. The right way to make something "match": the layer follows the style afterwards, where a copied hex code does not.

ParameterTypeDescription
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
styleId *stringFrom figma_list_library.

figma_bind_variable Bind a variable

Binds a variable from this file to a property, so the value follows the token rather than being a copy of it. Use "fill" or "stroke" for a colour variable; for a number use the property name, like cornerRadius, itemSpacing, paddingLeft, width or opacity.

ParameterTypeDescription
field *string"fill", "stroke", or a numeric property such as cornerRadius or itemSpacing.
nodeId *stringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
variableId *stringFrom figma_list_library.

figma_save_version Checkpoint the file

Saves a named point in the file’s version history. Call this before a run that will change several things, so there is one place to fall back to that is not a stack of undos.

ParameterTypeDescription
title *stringWhat this checkpoint is for.
descriptionstring

figma_find_nodes Find layers

Finds layers by type, by name and by the words in them. Every filter is optional and they narrow together. This is the cheap way to locate something. Walking with figma_get_tree and figma_get_children costs a round trip per level and returns every sibling; asking here for {types:["INSTANCE"], name:"button"} costs one call. Searches the current page unless you pass nodeId to search inside one branch, or allPages to search the whole file — which is the only way to find something that is not on the page the designer happens to have open.

ParameterTypeDescription
allPagesbooleanSearch every page in the file. Slower, and the answer names the page each row is on.
limitintegerMost rows to return. Default 50.
namestringSubstring of the layer name, case-insensitive.
nodeIdstringSearch inside this branch instead of the whole page.
textstringSubstring of a text layer’s words, case-insensitive. Implies TEXT.
typesarrayLayer types to keep. Omit for any type.

figma_pages The pages, and which one is open

list — every page in the file, and which is current. open — switch to one, by pageId or by name. Worth calling before concluding something is missing: every other reading tool answers about the current page only, so a frame on another page looks exactly like a frame that does not exist. Opening a page moves the designer’s view, which is the same kind of act as figma_select — nothing in the file changes and there is nothing to undo, so it is not behind the Edits switch.

ParameterTypeDescription
action *stringWhich of the two.
namestringFor open: the page name, if you have no id.
pageIdstringFor open: the page id from list.

figma_component_properties What a component exposes

The properties a component, component set or instance has: the variants, and the text, boolean and instance-swap properties, with what this instance currently has them set to. Call this before figma_set_instance_properties. The key that setter needs carries an id suffix for everything but a variant — "Label#8:2", not "Label" — and there is no way to guess it.

ParameterTypeDescription
nodeIdstringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.

figma_group Group or ungroup

group — puts nodeIds in a new group, inside the first one’s own parent. ungroup — dissolves a group or frame and returns the children it let go. A group is the honest answer when several layers are one thing but need no layout of their own; reach for figma_create_frame with auto layout when they do.

ParameterTypeDescription
actionstringDefault group.
namestringFor group: what to call it.
nodeIdstringFor ungroup: the group or frame to dissolve.
nodeIdsarrayFor group: the layers to gather, up to 20.

figma_insert_image Put an image on the canvas

Places a PNG, JPG or GIF, passed as base64. With nodeId it becomes that layer’s fill, which is how a placeholder gets its picture; without one it arrives as a new rectangle at its own pixel size. Base64 rather than a URL on purpose: the plugin’s manifest allows only the relay and the local daemon as network destinations, so the plugin cannot fetch an image from anywhere a designer keeps one. Read the file yourself and send the bytes. The cap is 700KB of base64, which is roughly a 500KB image.

ParameterTypeDescription
data *stringThe image as base64. A data: URL prefix is accepted and ignored.
heightnumberDefault: the image’s own height.
namestring
nodeIdstringFill this layer instead of making a new one.
parentIdstringWhere a new rectangle goes. Default: the current page.
scaleModestringHow it sits in the frame. Default FILL.
widthnumberDefault: the image’s own width.
xnumber
ynumber

figma_set_instance_properties Set an instance’s properties

Sets which variant an instance is, and the text and booleans its component exposes. Take the keys from figma_component_properties; a key given without its id suffix is matched anyway, and one that matches nothing is refused with the list of what does. This is the difference between placing a component and using it. figma_create_instance gives you the default variant — this is how it becomes the large one, or the disabled one, with the right label.

ParameterTypeDescription
properties *objectKey to value. A variant takes its option name, a boolean property true or false, a text property a string.
nodeIdstringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.

figma_ios_spec The design as node properties

One node and its children as the properties Figma actually holds, in points: per-axis sizing, auto layout with its padding, stroke weight and alignment, corner smoothing, effects, the whole text block, and every fill and stroke marked with whether it is painted. Read this rather than figmaCss when the answer becomes code. Dev Mode CSS answers what a node would look like on the web, which drops what an implementation needs — which side of the bounds a stroke sits on, whether a height was authored or measured, whether the corners are smoothed — and it also reports paint that is never painte…

ParameterTypeDescription
nodeIdstringFigma node id, like "21:10314". Omit to use whatever is selected on the canvas.
scalenumberThe scale the artboard was drawn at. Default: inferred from the root width against the widths a phone actually has, and the answer says which it used.

figsnap_skill The skill for reading a design

Whether this project has the figsnap skill installed, and the skill itself when it does not. The skill is what stops the usual mistakes: an agent handed figmaCss gets the geometry right and the type wrong, because Dev Mode CSS cannot say whether a height was authored or measured, which side of the bounds a stroke sits on, or that line-height is a box rather than a font metric. It also carries the artboard-to-device widths, the frame-versus-glyph padding an icon export has to keep, and the fact that a design system’s font is probably not on iOS. install answers with the file and where it go…

ParameterTypeDescription
actionstringDefault check.
projectDirstringThe project to look in. Default: the directory the MCP client is running in, which the bridge names on every call. Failing that, the daemon’s own — which is wherever it was started and usually not…