Use Figma
figma_local_use_figmaExecute JavaScript against the Figma Plugin API to create, edit, inspect, or sync frames, components, text, styles, variables, and layouts in design files and FigJam boards.
Instructions
Create, edit, inspect or sync anything in a Figma file by running JavaScript against the Figma Plugin API: frames, components, variants, variables, styles, text, auto layout, images and whole screens. Works in design files and FigJam boards. Requires the companion "Figma MCP Bridge" plugin to be running in the target file in the Figma desktop app. The code runs as the body of an async function with figma in scope. Use return to send JSON-serializable data back (nodes are returned as {id, name, type}; bytes from exportAsync come back as images). A single expression is returned automatically. console.log output is captured. GOTCHAS: the plugin uses dynamic page loading, so use async APIs: await figma.getNodeByIdAsync(id), await figma.setCurrentPageAsync(page), await page.loadAsync() before reading another page. Call await figma.loadFontAsync({family, style}) before setting text; the Inter style is "Semi Bold", not "SemiBold". Append new nodes to a parent and position them, and return the IDs of what you created. Each call is committed as one undo step.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"fileKey": "<fileKey>",
"code": "<code>",
"description": "<description>"
},
"name": "figma_local_use_figma"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript to execute. Has access to the `figma` global (Figma Plugin API). | |
| fileKey | Yes | The key of the Figma file to edit (from the URL). Used to pick the right plugin connection when several files are open. | |
| timeoutMs | No | Execution timeout in milliseconds. Defaults to 60000. | |
| description | Yes | A concise description of what the code aims to do. |