figcp

v0.2.2
io.github.abolfazl-moeini/figcp Checked 2 days ago Published 7 days ago

Bidirectional Figma Desktop MCP bridge (Free plan, local fonts & RTL, zero REST API).

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

figma_status

Check figcp connection status, role, port, connected Figma Desktop files, and recent manual edits made on the canvas by the user.

ParameterTypeDescription
fileKeystringTarget fileKey when multiple files are connected.
sinceChangeSeqintegerOnly return manual changes with seq > sinceChangeSeq.

run_figma_js

Execute arbitrary Figma Plugin API JavaScript inside the connected Figma Desktop file. Globals `figma` and `helpers` are in scope. Runs in a serial queue, captures console logs and stack traces, and checkpoints undo by default (pass commitUndo=false for read-only scripts).

ParameterTypeDescription
code *stringAsync JavaScript body with `figma` and `helpers` in scope. Return JSON-serializable data.
commitUndobooleanCall figma.commitUndo() on mutation (default true; pass false for read-only inspections).
fileKeystringTarget Figma fileKey (required only when multiple Figma files are connected).
timeoutMsintegerExecution timeout in ms (default 30000, max 180000).

inspect_design_system

Read the open Figma file's Local Variable Collections (with resolved alias names), Paint/Text/Effect Styles, Component Sets (variant counts & properties), and optionally filter installed local fonts (e.g. fontQuery='IRANSans').

ParameterTypeDescription
fileKeystringTarget Figma fileKey when multiple files are connected.
fontQuerystringCase-insensitive substring to filter available local fonts (e.g. 'IRANSans').
formatstringOutput format: standard 'figma' snapshot or standard W3C 'dtcg' design tokens (compatible with Terrazzo and Tailwind v4).
maxPagesintegerMaximum number of pages to load/scan (default 50).
pageQuerystringOptional case-insensitive substring to filter pages scanned for Component Sets.

inspect_node_bounds

Inspect a node subtree's geometry (absoluteBoundingBox, absoluteRenderBounds), Auto Layout, bound variables, deterministic DS/RTL lint issues (overflow, overlap, unbound fills/spacing, RTL alignment), and optionally capture a PNG screenshot.

ParameterTypeDescription
fileKeystringTarget Figma fileKey when multiple files are connected.
includeScreenshotbooleanExport PNG screenshot of the node and return it inline as an MCP image.
maxDepthintegerMaximum subtree traversal depth (default 4).
nodeIdstringTarget node ID ('5031:4449' or '5031-4449'). Defaults to current selection.
screenshotScalenumberPNG export scale factor (default 2).

figma_undo

Revert the last checkpointed run_figma_js mutation (action='undo') or save a named Figma version history restore point (action='snapshot').

ParameterTypeDescription
actionstring'undo' (default) or 'snapshot'.
fileKeystringTarget Figma fileKey when multiple files are connected.
titlestringSnapshot title when action='snapshot'.

get_design_context

Extract code-generation design context from a Figma node subtree: computed CSS/Tailwind geometry, Auto Layout (flexbox), fills, borders, typography, shadows, matching local Code Connect components (figcp.map.json), and optional offline NormalizedSpec export for ui-level visual verification.

ParameterTypeDescription
exportUiLevelDirstringOptional directory path to write spec.json and reference.png ready for ui-level.
fileKeystringTarget Figma fileKey when multiple files are connected.
includeScreenshotbooleanCapture reference PNG screenshot of the design context root.
maxDepthintegerMaximum subtree traversal depth (default 6).
nodeIdstringTarget node ID ('5031:4449'). Defaults to current selection.
screenshotScalenumberPNG export scale factor (default 2).
workspaceDirstringFrontend workspace directory to search for figcp.map.json (defaults to server cwd).

export_node_assets

Export a Figma node as SVG (vector/icons) or PNG (raster/imagery). Returns the content inline or saves to outputDir.

ParameterTypeDescription
fileKeystringTarget Figma fileKey when multiple files are connected.
filenamestringOptional output filename. Defaults to sanitized node name.
formatstringExport format: 'SVG' (default) or 'PNG'.
nodeIdstringTarget node ID ('5031:4449'). Defaults to selection.
outputDirstringOptional directory to write asset file. If omitted, returns asset inline.
scalenumberPNG export scale (default 2).