Bulk edit Figma layers with AI
FigmaMCP lets Claude Code or Codex change many Figma layers in one request: rename, replace text, apply styles and delete. It checks every target in a batch, including its name, before anything changes. If one target is invalid, the batch stops with no change. Some tools take a list, and some work on one layer per call.
Good first jobs
| Job | Tools used | One call or many? |
|---|---|---|
| Rename layers to a pattern | node_rename | One layer per call. The agent repeats it. |
| Replace text content | text_set_content | One call takes a list of text layers. |
| Apply a color or text style | node_apply_style | One layer per call. |
| Delete unused layers | node_delete, name must match | One call takes a list. |
How FigmaMCP validates a batch
FigmaMCP’s batch tools are node_delete, text_set_content, annotation_set, instance_set_overrides and create_component_set. Before they change anything, they check every item. A missing layer, a layer outside the editable scope, a wrong name or a wrong layer type aborts the whole call with no change. Each item must carry its own nodeName, copied from node_info. A duplicate target in one list is refused.
After the checks pass, the tool runs the items one by one and stops at the first failure. There is no rollback. node_delete is the exception: it deletes in parallel chunks and does not stop. Read the result’s status. When it is partial_success, some rows failed or were skipped. Retry those rows after you note what already worked.
Replace text in many layers
- Call
node_infoon the frame with a text filter and thecharactersandnameproperties. - Split the layers into chunks that make sense, such as one card group or one table.
- Optionally copy the frame first with
node_clone. - Send one chunk to
text_set_content, with each name copied verbatim. - Export the chunk with
node_export_visualat a small scale and look at it. Then do the next chunk.
Name verification
FigmaMCP refuses a write when the name you send does not match the layer’s real name. This protects you from a stale ID. If a designer renamed a layer after the agent read it, the write stops. The error is NAME_MISMATCH. It arrives as UNKNOWN_ERROR with the text nodeName does not match name of nodeId. Read the layer again and retry.
| Error or message | Meaning | What to do |
|---|---|---|
NAME_MISMATCH | The name does not match the layer. | Read again with node_info, then retry. |
READ_ONLY_MODE | The AI can edit this file switch is off. | Turn it on in the plugin. |
OUTSIDE_SCOPE | A target is outside the editable scope. | Remove it from the list or widen the scope. |
Node is not a text node | A text_set_content target is not a text layer. | Check the type with node_info. |
Node not found on a node_delete row | The target is already gone. A list often names a parent and its child. | Do not retry that row. |
Before you run it
Start on a duplicate page, check one result by eye, then run the rest. node_delete has no API undo, so keep Figma version history on. A wrong edit that follows the rules still goes through. See Is Figma MCP safe.
Download for Mac Version 0.1.20 macOS 14+ · Intel & Apple Silicon · ~155 MB
Related: Edit Figma with AI · Write tools · Safety
Questions
How many layers can it change at once?
Can I undo it?
What happens if one layer in my list has the wrong name?
Does renaming 80 layers happen as one batch?
Last updated: