openfig-mcp

v0.4.0
openfig-mcp Checked 1 day ago Published 2 days ago

MCP server that turns Figma .fig files into LLM-ready design specs: frames, HTML/CSS, tokens, components, hover states, animations, SVG icons, images and fonts.

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

list_fig_files

List the Figma .fig files available in the workspace (or passed on the command line).

list_frames

List the pages and top-level frames (screens, component sets, frames) in a .fig file, with ids, sizes and prototype flow starting points.

ParameterTypeDescription
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
includeComponentsbooleanInclude component sets/components placed on pages (default true).
maxCharsintegerCharacter budget for this response (server default 40000). Raise it for large-context models, lower it for small ones. Full files are always written to disk.
pagestringOnly this page (name or id).
querystringFilter by frame/section/page name.

get_frame

Convert a frame/screen/component (any node) into implementation-ready design data: summary of fonts, components + variants, design tokens, hover/active states, auto-playing animations, navigation and modals, plus an HTML+CSS reproduction. Writes index.html, styles.css, tokens.css, spec.json, DESIGN.md, preview.png and assets/ (SVG icons, images) to disk.

ParameterTypeDescription
frame *stringFrame/node to use: a node id like "1:234", a Figma URL containing node-id=1-234, or the frame name (e.g. "MacBook Pro 14\" - 4", "Login").
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
includeHtmlbooleanInclude HTML/CSS inline in the response (default true).
maxCharsintegerCharacter budget for this response (server default 40000). Raise it for large-context models, lower it for small ones. Full files are always written to disk.
outDirstringWhere to write the export. Default: <OS temp>/openfig-mcp/<file>/<frame>-<id>/ (outside the workspace). Pass a project folder (e.g. "src/assets/figma") to keep the files.
textSizingstringexact (default): text boxes get the size Figma measured, so the layout matches the design exactly. fluid: text that hugs its content is sized by the browser (only exact with the same fonts).

render_frame

Optional: render a frame/node to a PNG for a visual overview (drawn from the file's own geometry and glyph outlines). Not needed for implementation: get_frame has the exact values.

ParameterTypeDescription
frame *stringFrame/node to use: a node id like "1:234", a Figma URL containing node-id=1-234, or the frame name (e.g. "MacBook Pro 14\" - 4", "Login").
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
maxSizeintegerMax width/height of the returned image in px (default 1600).
outPathstringAlso save the PNG here.

verify_implementation

Verify your implementation against the Figma design. Opens the page (URL or .html file) in Edge/Chrome, compares every element tagged data-figma-id="<Figma id>" with the position and size Figma stored and its computed style with Figma's (corner radius, background, border, shadow, opacity, text color/size/weight/line height/letter spacing — catches UI-library defaults overriding the design), checks the text, and compares the page pixels with the design. Lists what is off. Call it at the end, fix, and call it again until it matches.

ParameterTypeDescription
frame *stringFrame/node to use: a node id like "1:234", a Figma URL containing node-id=1-234, or the frame name (e.g. "MacBook Pro 14\" - 4", "Login").
target *stringWhere your implementation runs: a URL (e.g. "http://localhost:5173/login") or a path to an .html file.
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
outDirstringWhere to write implementation.png, design.png and diff.png (default: next to the frame export in the OS temp dir).
selectorstringCSS selector of the element that represents the frame (default: [data-figma-id="<frame id>"], else the first element in <body>).
tolerancenumberAllowed difference in px (default 0.5).
waitMsintegerExtra time to wait after load (animations, data), in ms.

check_fonts

List the fonts a frame (or the whole file) needs, the font file found for each (project fonts/ folder, OPENFIG_MCP_FONT_DIRS or installed fonts), and which are missing (those fall back to system fonts; mention them to the user when you finish).

ParameterTypeDescription
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
framestringFrame/node (id, Figma URL or name). Omit for every font used in the file.

get_design_tokens

Get the design tokens of the file: color, text (typography), effect (shadow) styles and Figma variables (collections with modes, e.g. light/dark). Returns CSS custom properties + typography classes, or JSON.

ParameterTypeDescription
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
formatstringcss (default) or json
maxCharsintegerCharacter budget for this response (server default 40000). Raise it for large-context models, lower it for small ones. Full files are always written to disk.

list_components

List components and component sets (with variant properties like State=Hover, Size=lg) and how often they are used.

ParameterTypeDescription
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
maxCharsintegerCharacter budget for this response (server default 40000). Raise it for large-context models, lower it for small ones. Full files are always written to disk.
querystringFilter by component name.

get_component

Get one component / component set: every variant with its properties, the CSS differences between interactive states (hover, pressed, …) and an HTML/CSS reproduction of the variants. Also writes an export folder like get_frame.

ParameterTypeDescription
component *stringComponent (set) name or id, e.g. "Button".
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
maxCharsintegerCharacter budget for this response (server default 40000). Raise it for large-context models, lower it for small ones. Full files are always written to disk.
outDirstring

search_nodes

Find layers by name or text content (e.g. "Sign in", "logo", "price"). Returns ids you can pass to get_frame/render_frame/export_svg.

ParameterTypeDescription
query *string
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
limitinteger
maxCharsintegerCharacter budget for this response (server default 40000). Raise it for large-context models, lower it for small ones. Full files are always written to disk.

get_prototype_flows

Prototype navigation graph: flow starting points and every click/hover/timer link between screens, overlays (modals) and URLs.

ParameterTypeDescription
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
maxCharsintegerCharacter budget for this response (server default 40000). Raise it for large-context models, lower it for small ones. Full files are always written to disk.

export_svg

Export a node (icon, logo, illustration, vector) as SVG markup; optionally save it to a file.

ParameterTypeDescription
node *stringFrame/node to use: a node id like "1:234", a Figma URL containing node-id=1-234, or the frame name (e.g. "MacBook Pro 14\" - 4", "Login").
filestringPath or name of the .fig file. Optional when the workspace has exactly one .fig file or one was passed on the command line.
maxCharsintegerCharacter budget for this response (server default 40000). Raise it for large-context models, lower it for small ones. Full files are always written to disk.
outPathstring