Figma context
Hard technique for pulling design context from Figma via the Figma desktop MCP server during documentation workflows.
Purpose
During discovery and drafting, users often have components, patterns, or foundations already designed in Figma. Rather than requiring the user to manually describe everything, this skill reads Figma files directly — pulling component structure, variants, properties, variables, and screenshots to ask better questions and verify documentation completeness.
The LLM does not write documentation from Figma data. Figma context is used to:
- Ask more informed questions ("I see you have 3 size variants in Figma — small, medium, large. Do you want to document all three?")
- Cross-reference what is documented against what is designed ("Your Figma component has an
isLoading prop that is not mentioned in the Props section yet")
- Understand anatomy without requiring the user to describe every detail from scratch
Connection modes
The Figma MCP server supports two connection methods.
Desktop server (local)
Runs locally through the Figma desktop app at http://127.0.0.1:3845/mcp. Supports both selection-based and link-based workflows.
Setup:
- Open the Figma desktop app (latest version)
- Open a Figma Design file and toggle to Dev Mode (Shift+D)
- In the MCP server section of the inspect panel, select Enable desktop MCP server
- Add to Claude Code:
claude mcp add --transport http figma-desktop http://127.0.0.1:3845/mcp
Remote server
Connects directly to Figma's hosted endpoint at https://mcp.figma.com/mcp. Uses OAuth authentication — no desktop app required. Supports link-based workflows only.
When to use Figma context
During discovery
- User mentions they have a Figma file or component
- User provides a Figma URL
- User says "it's already designed" or references existing designs
- User selects a node in the Figma desktop app
During drafting
- Anatomy section: Use
get_metadata to pull the layer structure, then get_design_context for full detail
- Variants section: Use
get_design_context to pull variant definitions (size, style, state) for full coverage
- Props/API section: Use
get_design_context to pull component properties and cross-reference with documented props
- States section: Pull interactive states visible in the Figma component
- Foundations (tokens): Use
get_variable_defs to pull design variables (colours, spacing, typography tokens)
During completeness review
- Cross-reference documented variants against Figma variants
- Check if documented props match Figma component properties
- Verify anatomy descriptions match the Figma layer structure
- Use
get_screenshot to visually verify what the component looks like
Available Figma desktop MCP tools
get_design_context
- Use: Primary tool — generates code and design context for a node
- When: Translating a design into code, pulling component properties, variants, layout data
- Input: Optional
nodeId (for example, "123:456"). If omitted, uses the currently selected node in Figma.
- Params:
artifactType (WEB_PAGE_OR_APP_SCREEN, COMPONENT_WITHIN_A_WEB_PAGE_OR_APP_SCREEN, REUSABLE_COMPONENT, DESIGN_SYSTEM), taskType (CREATE_ARTIFACT, CHANGE_ARTIFACT, DELETE_ARTIFACT), forceCode (boolean, forces code output for large nodes)
- Note: This is the main tool to call. Always prefer this over
get_metadata when you need design details.
get_metadata
- Use: Get a structural overview of a node or page in XML format
- When: Understanding the layer hierarchy, finding specific node IDs to drill into, getting an overview before calling
get_design_context
- Input: Optional
nodeId. If omitted, uses the currently selected node.
- Returns: XML with node IDs, layer types, names, positions, and sizes — structure only, no design details
- Important: After calling this, follow up with
get_design_context on specific node IDs to get actual design information.
get_variable_defs
- Use: Get design variable definitions (design tokens) for a node
- When: Documenting foundations (colour, typography, spacing) or understanding which tokens a component uses
- Input: Optional
nodeId. If omitted, uses the currently selected node.
- Returns: Variable name-to-value mappings (for example,
{'icon/default/secondary': #949494})
get_screenshot
- Use: Generate a visual screenshot of a node
- When: Visually verifying what a component looks like, cross-referencing documentation descriptions with actual appearance
- Input: Optional
nodeId. If omitted, uses the currently selected node.
- Returns: An image of the node
create_design_system_rules
- Use: Generate a prompt for analysing the codebase to create design system integration rules
- When: Setting up Code Connect, aligning codebase structure with Figma design system
- Returns: A structured prompt covering token definitions, component library, frameworks, asset management, icon system, styling approach, and project structure
get_figjam
- Use: Generate context from FigJam files
- When: Pulling content from FigJam diagrams — architecture maps, flows, brainstorming boards
- Input: Optional
nodeId. If omitted, uses the currently selected node.
- Note: Only works for FigJam files, not regular Figma Design files.
How to provide Figma context
Selection-based (desktop server only)
The user selects a frame or layer inside Figma, then asks the LLM to work with it. Call tools without a nodeId to use the current selection.
Link-based
The user copies a Figma URL. Extract the node-id from the URL to pass as nodeId.
How to extract Figma URLs
Figma URLs follow these patterns:
Design file: https://www.figma.com/design/{FILE_KEY}/{FILE_NAME}?node-id={NODE_ID}
Branch: https://www.figma.com/design/{FILE_KEY}/branch/{BRANCH_KEY}/{FILE_NAME}
FigJam: https://www.figma.com/board/{FILE_KEY}/{FILE_NAME}?node-id={NODE_ID}
To extract a node ID from a URL: parse the node-id query parameter. The URL format uses hyphens (for example, 1-2) but the MCP tools expect colons (for example, 1:2). Convert node-id=1-2 to nodeId: "1:2".
For branch URLs (/design/{FILE_KEY}/branch/{BRANCH_KEY}/), use the BRANCH_KEY as the file key.
Interpreting Figma data
Component properties → Props/API section
Figma component properties map to documentation props:
- Boolean properties → boolean props (for example,
isDisabled, showIcon)
- Text properties → string props (for example,
label, helperText)
- Instance swap properties → slot/child component props (for example,
icon, leadingElement)
- Variant properties → enum props or variant names (for example,
size: sm | md | lg)
Variant structure → Variants section
Figma component sets define variants as property combinations:
- Each variant property (size, style, state) becomes a documentation variant axis
- The values for each property become the variant options
- Combinations that exist in Figma should be documented
Layer structure → Anatomy section
Use get_metadata to reveal layer hierarchy, then get_design_context for detail:
- Top-level frames within the component are major parts
- Named layers correspond to anatomical elements
- Auto-layout structure reveals container relationships
- Hidden layers may represent conditional or optional parts
Variables → Foundations documentation
Use get_variable_defs to pull design tokens:
- Colour variables → colour tokens
- Spacing variables → spacing tokens
- Typography variables → typography tokens
- These map directly to design token documentation
Recommended tool sequence
For documenting a component:
get_screenshot — see what the component looks like visually
get_metadata — understand the layer structure and find key node IDs
get_design_context — pull full design details for the component (or specific child nodes)
get_variable_defs — pull associated design tokens/variables
For documenting foundations:
get_variable_defs — pull all token definitions
get_screenshot — visually verify the token usage
Questioning patterns with Figma context
When you have pulled Figma data, use it to ask informed questions.
Variants
- "I can see your Figma component has these variant properties: {list}. Should we document all of these, or are some internal/deprecated?"
- "There are {N} size variants in Figma. Do you want to walk through each one and describe when to use it?"
Props
- "Figma shows these component properties: {list}. Do these map 1:1 to your code props, or are there differences?"
- "I see a boolean property called
{name} in Figma — what does it control?"
Anatomy
- "Based on the Figma layers, this component has these parts: {list}. Does that match how you think about its anatomy?"
- "I see an optional layer called
{name} — when is that shown?"
States
- "Figma shows variants for these states: {list}. Are there additional interactive states not captured in Figma?"
Tokens / Variables
- "I pulled these design variables from your component: {list}. Should these be documented as part of the component's token usage?"
Anti-patterns
- Do not dump raw Figma data on the user. Summarise what you found and ask focused questions.
- Do not assume Figma is the source of truth. The code implementation may differ from the design. Always ask.
- Do not auto-generate documentation from Figma. Use it to ask better questions, not to write content.
- Do not request Figma access unprompted. Only use Figma tools when the user provides a URL, selects a node, or asks you to look at their designs.
- Do not overload the user with Figma details. Surface what is relevant to the current section being drafted.
- Do not call
get_metadata alone and stop. It only returns structure — always follow up with get_design_context for actual design information.
Output format
When presenting Figma context to the user during drafting:
━━━ Figma Context ━━━
From: {component/frame name} (node {nodeId})
Variants found:
- Size: sm, md, lg
- Style: filled, outlined, text
- State: default, hover, disabled
Properties:
- label (text)
- isDisabled (boolean)
- icon (instance swap)
- size (variant: sm | md | lg)
Layer structure:
- Container
- Icon (optional)
- Label
- Trailing icon (optional)
Variables:
- color-background-layer2: #F5F5F5
- dimension-200: 16px
━━━
Follow this with questions, not with drafted documentation.
1---2name: figma-context3description: Pulls design context from Figma via the Figma desktop MCP server during documentation workflows. Use when a user provides a Figma URL, selects a node in the Figma desktop app, or references existing designs during discovery, drafting, or review.4---56# Figma context78Hard technique for pulling design context from Figma via the Figma desktop MCP server during documentation workflows.910## Purpose1112During discovery and drafting, users often have components, patterns, or foundations already designed in Figma. Rather than requiring the user to manually describe everything, this skill reads Figma files directly — pulling component structure, variants, properties, variables, and screenshots to ask better questions and verify documentation completeness.1314The LLM does not write documentation from Figma data. Figma context is used to:1516- Ask more informed questions ("I see you have 3 size variants in Figma — small, medium, large. Do you want to document all three?")17- Cross-reference what is documented against what is designed ("Your Figma component has an `isLoading` prop that is not mentioned in the Props section yet")18- Understand anatomy without requiring the user to describe every detail from scratch1920## Connection modes2122The Figma MCP server supports two connection methods.2324<connection_modes>2526### Desktop server (local)2728Runs locally through the Figma desktop app at `http://127.0.0.1:3845/mcp`. Supports both selection-based and link-based workflows.2930Setup:31321. Open the Figma desktop app (latest version)332. Open a Figma Design file and toggle to Dev Mode (Shift+D)343. In the MCP server section of the inspect panel, select **Enable desktop MCP server**354. Add to Claude Code: `claude mcp add --transport http figma-desktop http://127.0.0.1:3845/mcp`3637### Remote server3839Connects directly to Figma's hosted endpoint at `https://mcp.figma.com/mcp`. Uses OAuth authentication — no desktop app required. Supports link-based workflows only.4041</connection_modes>4243## When to use Figma context4445<when_to_use>4647### During discovery4849- User mentions they have a Figma file or component50- User provides a Figma URL51- User says "it's already designed" or references existing designs52- User selects a node in the Figma desktop app5354### During drafting5556- **Anatomy section**: Use `get_metadata` to pull the layer structure, then `get_design_context` for full detail57- **Variants section**: Use `get_design_context` to pull variant definitions (size, style, state) for full coverage58- **Props/API section**: Use `get_design_context` to pull component properties and cross-reference with documented props59- **States section**: Pull interactive states visible in the Figma component60- **Foundations (tokens)**: Use `get_variable_defs` to pull design variables (colours, spacing, typography tokens)6162### During completeness review6364- Cross-reference documented variants against Figma variants65- Check if documented props match Figma component properties66- Verify anatomy descriptions match the Figma layer structure67- Use `get_screenshot` to visually verify what the component looks like6869</when_to_use>7071## Available Figma desktop MCP tools7273<tools>7475### get_design_context7677- **Use**: Primary tool — generates code and design context for a node78- **When**: Translating a design into code, pulling component properties, variants, layout data79- **Input**: Optional `nodeId` (for example, `"123:456"`). If omitted, uses the currently selected node in Figma.80- **Params**: `artifactType` (WEB_PAGE_OR_APP_SCREEN, COMPONENT_WITHIN_A_WEB_PAGE_OR_APP_SCREEN, REUSABLE_COMPONENT, DESIGN_SYSTEM), `taskType` (CREATE_ARTIFACT, CHANGE_ARTIFACT, DELETE_ARTIFACT), `forceCode` (boolean, forces code output for large nodes)81- **Note**: This is the main tool to call. Always prefer this over `get_metadata` when you need design details.8283### get_metadata8485- **Use**: Get a structural overview of a node or page in XML format86- **When**: Understanding the layer hierarchy, finding specific node IDs to drill into, getting an overview before calling `get_design_context`87- **Input**: Optional `nodeId`. If omitted, uses the currently selected node.88- **Returns**: XML with node IDs, layer types, names, positions, and sizes — structure only, no design details89- **Important**: After calling this, follow up with `get_design_context` on specific node IDs to get actual design information.9091### get_variable_defs9293- **Use**: Get design variable definitions (design tokens) for a node94- **When**: Documenting foundations (colour, typography, spacing) or understanding which tokens a component uses95- **Input**: Optional `nodeId`. If omitted, uses the currently selected node.96- **Returns**: Variable name-to-value mappings (for example, `{'icon/default/secondary': #949494}`)9798### get_screenshot99100- **Use**: Generate a visual screenshot of a node101- **When**: Visually verifying what a component looks like, cross-referencing documentation descriptions with actual appearance102- **Input**: Optional `nodeId`. If omitted, uses the currently selected node.103- **Returns**: An image of the node104105### create_design_system_rules106107- **Use**: Generate a prompt for analysing the codebase to create design system integration rules108- **When**: Setting up Code Connect, aligning codebase structure with Figma design system109- **Returns**: A structured prompt covering token definitions, component library, frameworks, asset management, icon system, styling approach, and project structure110111### get_figjam112113- **Use**: Generate context from FigJam files114- **When**: Pulling content from FigJam diagrams — architecture maps, flows, brainstorming boards115- **Input**: Optional `nodeId`. If omitted, uses the currently selected node.116- **Note**: Only works for FigJam files, not regular Figma Design files.117118</tools>119120## How to provide Figma context121122<providing_context>123124### Selection-based (desktop server only)125126The user selects a frame or layer inside Figma, then asks the LLM to work with it. Call tools without a `nodeId` to use the current selection.127128### Link-based129130The user copies a Figma URL. Extract the `node-id` from the URL to pass as `nodeId`.131132</providing_context>133134## How to extract Figma URLs135136<url_extraction>137138Figma URLs follow these patterns:139140```141Design file: https://www.figma.com/design/{FILE_KEY}/{FILE_NAME}?node-id={NODE_ID}142Branch: https://www.figma.com/design/{FILE_KEY}/branch/{BRANCH_KEY}/{FILE_NAME}143FigJam: https://www.figma.com/board/{FILE_KEY}/{FILE_NAME}?node-id={NODE_ID}144```145146To extract a node ID from a URL: parse the `node-id` query parameter. The URL format uses hyphens (for example, `1-2`) but the MCP tools expect colons (for example, `1:2`). Convert `node-id=1-2` to `nodeId: "1:2"`.147148For branch URLs (`/design/{FILE_KEY}/branch/{BRANCH_KEY}/`), use the `BRANCH_KEY` as the file key.149150</url_extraction>151152## Interpreting Figma data153154<interpreting_data>155156### Component properties → Props/API section157158Figma component properties map to documentation props:159160- **Boolean properties** → boolean props (for example, `isDisabled`, `showIcon`)161- **Text properties** → string props (for example, `label`, `helperText`)162- **Instance swap properties** → slot/child component props (for example, `icon`, `leadingElement`)163- **Variant properties** → enum props or variant names (for example, `size: sm | md | lg`)164165### Variant structure → Variants section166167Figma component sets define variants as property combinations:168169- Each variant property (size, style, state) becomes a documentation variant axis170- The values for each property become the variant options171- Combinations that exist in Figma should be documented172173### Layer structure → Anatomy section174175Use `get_metadata` to reveal layer hierarchy, then `get_design_context` for detail:176177- Top-level frames within the component are major parts178- Named layers correspond to anatomical elements179- Auto-layout structure reveals container relationships180- Hidden layers may represent conditional or optional parts181182### Variables → Foundations documentation183184Use `get_variable_defs` to pull design tokens:185186- Colour variables → colour tokens187- Spacing variables → spacing tokens188- Typography variables → typography tokens189- These map directly to design token documentation190191</interpreting_data>192193## Recommended tool sequence194195<tool_sequence>196197For documenting a component:1981991. `get_screenshot` — see what the component looks like visually2002. `get_metadata` — understand the layer structure and find key node IDs2013. `get_design_context` — pull full design details for the component (or specific child nodes)2024. `get_variable_defs` — pull associated design tokens/variables203204For documenting foundations:2052061. `get_variable_defs` — pull all token definitions2072. `get_screenshot` — visually verify the token usage208209</tool_sequence>210211## Questioning patterns with Figma context212213When you have pulled Figma data, use it to ask informed questions.214215<questioning_patterns>216217### Variants218219- "I can see your Figma component has these variant properties: {list}. Should we document all of these, or are some internal/deprecated?"220- "There are {N} size variants in Figma. Do you want to walk through each one and describe when to use it?"221222### Props223224- "Figma shows these component properties: {list}. Do these map 1:1 to your code props, or are there differences?"225- "I see a boolean property called `{name}` in Figma — what does it control?"226227### Anatomy228229- "Based on the Figma layers, this component has these parts: {list}. Does that match how you think about its anatomy?"230- "I see an optional layer called `{name}` — when is that shown?"231232### States233234- "Figma shows variants for these states: {list}. Are there additional interactive states not captured in Figma?"235236### Tokens / Variables237238- "I pulled these design variables from your component: {list}. Should these be documented as part of the component's token usage?"239240</questioning_patterns>241242## Anti-patterns243244<anti_patterns>245246- Do not dump raw Figma data on the user. Summarise what you found and ask focused questions.247- Do not assume Figma is the source of truth. The code implementation may differ from the design. Always ask.248- Do not auto-generate documentation from Figma. Use it to ask better questions, not to write content.249- Do not request Figma access unprompted. Only use Figma tools when the user provides a URL, selects a node, or asks you to look at their designs.250- Do not overload the user with Figma details. Surface what is relevant to the current section being drafted.251- Do not call `get_metadata` alone and stop. It only returns structure — always follow up with `get_design_context` for actual design information.252253</anti_patterns>254255## Output format256257<output_format>258259When presenting Figma context to the user during drafting:260261```262━━━ Figma Context ━━━263264From: {component/frame name} (node {nodeId})265266Variants found:267 - Size: sm, md, lg268 - Style: filled, outlined, text269 - State: default, hover, disabled270271Properties:272 - label (text)273 - isDisabled (boolean)274 - icon (instance swap)275 - size (variant: sm | md | lg)276277Layer structure:278 - Container279 - Icon (optional)280 - Label281 - Trailing icon (optional)282283Variables:284 - color-background-layer2: #F5F5F5285 - dimension-200: 16px286287━━━288```289290Follow this with questions, not with drafted documentation.291292</output_format>