bash
clawhub install figma
bash
# Add Figma MCP (one-time, global)
claude mcp add --scope user --transport http figma https://mcp.figma.com/mcp
# Or install the official Figma plugin (includes Skills)
claude plugin install figma@claude-plugins-official
bash
codex mcp add figma --transport http https://mcp.figma.com/mcp
Set FIGMA_TOKEN (Personal Access Token) in your environment or .env file.
Generate at: https://www.figma.com/settings → Account → Personal access tokens
MethodUse caseAuthREST API ( scripts/figma_api.py)Read file structure, components, export imagesFIGMA_TOKENMCP Server ( https://mcp.figma.com/mcp)Interactive design-to-code, write to canvasOAuth (auto)
Use scripts/figma_api.py to query Figma files directly. Supports full URLs or file keys.
bash
# File structure
python3 scripts/figma_api.py pages <file_key_or_url>
# Frame tree (depth controls levels)
python3 scripts/figma_api.py tree <file_key> --node <page_id> --depth 3
# Published components (--group to aggregate by frame)
python3 scripts/figma_api.py components <file_key> --group
# Component sets
python3 scripts/figma_api.py component-sets <file_key>
# Styles
python3 scripts/figma_api.py styles <file_key>
# Export as PNG/SVG
python3 scripts/figma_api.py export <file_key> --nodes <id1>,<id2> --format png --scale 2
# Node JSON detail
python3 scripts/figma_api.py node <file_key> --node <node_id> --depth 4
# Current user info
python3 scripts/figma_api.py me
ToolPurposeget_design_contextDesign context → code (default React+Tailwind, customizable)get_variable_defsVariables and styles (colors, spacing, typography)get_metadataSparse XML: layer IDs, names, types, positions, sizesget_screenshotScreenshot of selectionget_code_connect_mapFigma node → code component mapping (needs Code Connect)search_design_systemSearch library components, variables, styleswhoamiAuthenticated user info
ToolPurposeuse_figmaExecute Figma Plugin API JS: create/modify frames, components, variables, auto layoutgenerate_figma_designConvert live browser UI → editable Figma layerscreate_new_fileCreate new file in Draftsgenerate_diagramMermaid syntax → FigJam diagram
ToolPurposecreate_design_system_rulesGenerate design system rules file for AI code generationadd_code_connect_mapAdd Figma node → code component mappingget_code_connect_suggestionsCode Connect mapping suggestions
Step 1 — Provide the Figma frame URL in your prompt:
text
Using this Figma frame: https://www.figma.com/design/<key>?node-id=<id>
Generate React components using [your component library].
Step 2 — For large pages, ask the agent to inspect first:
text
1. Use get_metadata on the frame to understand the structure
2. Use search_design_system to find matching library components
3. Use get_design_context on each section to generate code
Step 3 — Write back to Figma (if editor permission):
text
Using this file: <url>, create a new page and build [description]
using existing components. Use auto layout.
figma_api.py pages <url> → identify target pagefigma_api.py tree <key> --node <page_id> → understand structurefigma_api.py export <key> --nodes <frame_id> → get screenshotfigma_api.py node <key> --node <frame_id> --depth 4 → get component detailsget_metadata overview first, then get_design_context per sectionget_screenshot for layout-sensitive componentsdepth ≤ 4 to avoid timeouts on large filesRegister your Figma files in references/omada-assets.md for quick lookup.
See references/guide-for-agents.md for the complete agent operation manual.
See references/guide-for-humans.md for the human-facing usage guide.