Tools
Every tool the server exposes. Your agent picks them; you just ask.
Read
get_design_contextThe main tool for design to code. Returns reference code (Flutter, SwiftUI, React + Tailwind or HTML + Tailwind), the assets it uses, a screenshot and the variables in the node. Large nodes return metadata instead of code unless forceCode is set.
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
- framework
- react, html, flutter or swiftui. Default: from the client, then FIGMA_LOCAL_MCP_FRAMEWORK, then the project (pubspec.yaml, Package.swift or an Xcode project, or a static site).
- clientLanguages
- Comma separated languages of the client, e.g. "dart" or "swift".
- clientFrameworks
- Comma separated frameworks of the client, e.g. "flutter" or "swiftui".
- screen
- Draw the node as a phone screen that fills the screen and scrolls when tall (default: portrait frames 300-480 wide).
- screenUtil
- Flutter: write lengths with flutter_screenutil (.w, .h, .r, .sp). Default: when pubspec.yaml depends on flutter_screenutil.
- assetsDir
- Folder of the assets in the code. Flutter: from pubspec.yaml; SwiftUI: the asset catalog (default: the project's *.xcassets); React: public/figma; HTML: assets/figma.
- exactLineHeights
- SwiftUI: set Figma's default line heights too, so text matches the design to the pixel (default: true).
- excludeScreenshot
- Leave the screenshot out of the response.
- forceCode
- Always return code, even for very large nodes.
- disableCodeConnect
- Draw mapped components from their layers instead of naming the code component.
get_metadataLayer tree in XML: node ids, types, names, positions and sizes. Good for an overview of a page or a large frame. Prefer get_design_context for code.
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
get_screenshotA PNG of a node or the selection. The response gives a local URL and file path.
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
- maxDimension
- Longest edge in pixels (default 1024, up to 2x the node size).
- contentsOnly
- Render the node in isolation, without overlapping content.
- enableBase64Response
- Also include the PNG inline as base64.
get_variable_defsVariables and styles used by a node, e.g. { 'icon/default/secondary': #949494 }, resolved for the node's own mode.
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
download_assetsAssets for one node: an exported render, the original image fills (up to 20) and SVGs of the vector layers (up to 20).
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
- defaultFormat
- png, jpg, svg or pdf (default png).
- defaultScale
- Export scale, 0.01 to 4 (default 1).
verify_codeCheck Flutter, SwiftUI, React or HTML code against the design: renders it at 2x (Flutter with flutter test, SwiftUI in the iOS simulator, React and HTML in headless Chrome with Tailwind) and compares the render with Figma's own. Returns compiler, analyzer or runtime errors, broken images, the share of differing pixels and a diff image. With file, it checks your widget, view, component or page inside your project; without it, the generated reference code, layer by layer. Every result has a coverage block: what was checked, and per control the states, keyboard and screen-reader behaviour that were not. React and HTML runs also report the Tab order, missing focus indicators, keyboard activation and accessible names.
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
- framework
- flutter, swiftui, react or html (default: from the file, then the client and the project).
- file
- Flutter: the .dart file under lib/. SwiftUI: the .swift file with the view. React: a .jsx or .tsx component. HTML: an .html page.
- widget
- Flutter: the widget class in file. SwiftUI: the view struct (default: the first one).
- css
- React and HTML: a stylesheet to load, e.g. the one with the design tokens.
- tailwind
- React and HTML: Tailwind 3 or 4 (default: the project's, else 4).
- viewport
- Lay the code out on a screen of this size, e.g. "360x780", and report overflows with the render.
- fonts
- Folders with font files (default: the project's assets/fonts and the system fonts).
- flutter
- Path of the flutter tool, when it is not on PATH.
- interact
- SwiftUI, generated code: tap every button after rendering and report what each did.
- dynamicType
- SwiftUI: render at this text size, e.g. accessibility3, to check the layout (default: large).
- device
- SwiftUI: the simulator to render in, by udid or name (default: a booted iPhone).
Write
use_figmaCreate or edit designs in the open file by running JavaScript against the Figma plugin API. The whole run is one undo step.
- code
- Body of an async function run with figma in scope.
- timeoutMs
- How long to wait for the script (default 60000, max 600000).
search_design_systemLocal components and component sets with their properties and variant options, library components the file already uses, and local paint, text and effect styles and variables with their values. Call it before designing, so the agent reuses what the file has.
- query
- Words that must all appear in the name or description, e.g. "button primary". Empty lists everything.
- kinds
- components, styles and/or variables (default: all).
- allPages
- Search components on every page, not just the current one.
- limit
- Most results per kind (default 50).
place_imagePut an image file from your computer into the open file: a PNG, JPG or GIF becomes a layer with the image fill (or the fill of an existing layer), and an SVG becomes editable vectors.
- path
- The image file, absolute or relative to the project.
- nodeId
- Set the image as the fill of this layer instead of making a new one.
- parentId
- Frame or group to put the new layer in (default: the current page).
- width, height
- Size of the new layer; one keeps the aspect ratio.
- x, y
- Position of the new layer.
- scaleMode
- FILL, FIT, CROP or TILE (default FILL).
Code Connect
get_code_connect_mapMapping from the component instances in a node to code components, plus the components not mapped yet.
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
add_code_connect_mapMap a design component to a code component. A component in a set maps the whole set.
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
- componentName
- Code component name, e.g. AppPrimaryButton.
- source
- Path of the code component in the project.
- label
- Framework, e.g. Flutter or React.
remove_code_connect_mapRemove the mapping of a component (by instance, component or set id).
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
Status and snapshots
whoamiConnection status: whether the plugin is connected, the pairing code, the open file, page and selection, the project, Code Connect and saved snapshots. Use it when a read fails.
save_design_exportWrite a full design export of a node (default: the selection) to a JSON file.
- nodeId
- Node id like 1:2, or 1-2 from a URL. Defaults to the current selection.
- path
- Absolute .json path to write (default: the data folder).
import_design_exportSave a design export JSON as a snapshot, so its nodes can be read without the plugin.
- path
- Absolute path of the export JSON file.