xiaohongshu
xiaohongshu
mcp-figma-desktop
Extract UI code, design tokens, and screenshots from Figma designs via desktop app. Use when implementing designs, building component libraries, or documenting design systems.
Full skill instructions
Interact with Figma designs directly through the Figma desktop app. Extract UI code (React, Vue, SwiftUI, etc.), design tokens (colors, spacing, typography), screenshots, and metadata from design files. Perfect for implementing design specs, creating component libraries, and maintaining design-code consistency.
Verify connection:
curl http://localhost:28888/health
curl http://localhost:28888/servers | grep figma-desktop
Most tools work with either:
--nodeId parameter)Example: Get code for selected component
cd .claude/skills/mcp-figma-desktop/scripts
# 1. Select a component in Figma desktop app
# 2. Run this to get React code:
node get_design_context.js --clientFrameworks react
# Output: React component code with props, styling, and structure
Example: Get code from Figma URL
# Extract node 123-456 from URL: https://figma.com/design/abc/MyFile?node-id=123-456
node get_design_context.js --nodeId "123:456" --clientFrameworks react,typescript
get_design_context.js - Generate production-ready UI code
--nodeId (optional) - Node ID like "123:456", or omit to use selected node--clientLanguages (optional) - Language preferences (e.g., typescript, swift)--clientFrameworks (optional) - Framework preferences (e.g., react, vue, swiftui)--forceCode (optional) - Force code generation even if not recommendedget_figjam.js - Generate code from FigJam boards
--nodeId (optional) - FigJam node ID or omit for selected node--clientLanguages (optional) - Language preferences--clientFrameworks (optional) - Framework preferences--includeImagesOfNodes (optional) - Include embedded imagesImportant: FigJam URLs use /board/ instead of /design/:
https://figma.com/board/:fileKey/:fileName?node-id=1-2 → nodeId: "1:2"https://figma.com/design/:fileKey/:fileName?node-id=1-2 → nodeId: "1:2"get_variable_defs.js - Extract design system variables
--nodeId (optional) - Node ID or omit for selected node--clientLanguages (optional) - Output format preferences--clientFrameworks (optional) - Framework-specific token formatsOutput example:
{
"icon/default/secondary": "#949494",
"spacing/base": "8px",
"font/heading/large": "32px"
}
get_screenshot.js - Generate high-quality screenshots
--nodeId (optional) - Node to screenshot, or omit for selected--clientLanguages (optional) - Format preferences--clientFrameworks (optional) - Context for screenshot generationget_metadata.js - Extract structural information
get_design_context for most use cases--nodeId (optional) - Node or page ID (e.g., "0:1" for whole page)--clientLanguages (optional)--clientFrameworks (optional)When to use metadata:
create_design_system_rules.js - Generate design system documentation
--clientLanguages (optional) - Language context--clientFrameworks (optional) - Framework contextScenario: Designer shares Figma link, you need to build the component
Checklist:
https://figma.com/design/abc/Button?node-id=12-34)12-34 becomes 12:34node get_design_context.js --nodeId "12:34" --clientFrameworks react,typescriptnode get_variable_defs.js --nodeId "12:34"node get_screenshot.js --nodeId "12:34"Example:
cd .claude/skills/mcp-figma-desktop/scripts
# 1. Get React + TypeScript code
node get_design_context.js --nodeId "12:34" --clientFrameworks react,typescript
# 2. Get design variables
node get_variable_defs.js --nodeId "12:34"
# 3. Take screenshot for docs
node get_screenshot.js --nodeId "12:34"
Expected output:
Scenario: Create reusable component library from design system
Checklist:
node get_metadata.js --nodeId "0:1" (page root)node get_design_context.js --nodeId "{id}" --clientFrameworks reactnode get_variable_defs.js --nodeId "{id}"node get_screenshot.js --nodeId "{id}"node create_design_system_rules.jsExample: Button component extraction
# 1. Get page structure to find button variants
node get_metadata.js --nodeId "0:1" > structure.xml
# From XML, identify button node IDs: 45:12, 45:13, 45:14
# 2. Extract primary button
node get_design_context.js --nodeId "45:12" --clientFrameworks react,typescript > Button.tsx
node get_variable_defs.js --nodeId "45:12" > button-tokens.json
node get_screenshot.js --nodeId "45:12" > button-primary.png
# 3. Repeat for secondary, tertiary variants
Scenario: Convert FigJam wireframes into initial code structure
Important: Use get_figjam.js for FigJam files, NOT get_design_context.js
Checklist:
node get_figjam.js --includeImagesOfNodes trueExample:
cd .claude/skills/mcp-figma-desktop/scripts
# From FigJam URL: https://figma.com/board/xyz/Wireframes?node-id=5-10
# Extract node "5:10"
node get_figjam.js --nodeId "5:10" --clientFrameworks react --includeImagesOfNodes true
Expected output:
Scenario: Create theme configuration from design variables
Checklist:
node get_variable_defs.jsExample:
# 1. Get all design tokens from selected design system root
node get_variable_defs.js > design-tokens.json
# Output will include:
# {
# "color/primary/500": "#3B82F6",
# "color/primary/600": "#2563EB",
# "spacing/xs": "4px",
# "spacing/sm": "8px",
# "typography/heading/h1": "32px"
# }
# 2. Convert to CSS variables or theme object in your build process
Figma uses colon-separated node IDs internally:
From Figma URLs:
...?node-id=123-456 → Node ID: "123:456" (replace hyphen with colon)--nodeId "123:456"From metadata:
id="123:456"Page IDs:
0: (e.g., 0:1, 0:2)The figma-desktop server maintains state between calls:
Best practice: For batch operations, keep Figma desktop app open and navigate to each node before running scripts.
Error: Cannot connect to mcp2rest
# 1. Check mcp2rest is running
curl http://localhost:28888/health
# 2. Verify figma-desktop server is loaded
curl http://localhost:28888/servers
# 3. Look for figma-desktop in output with "connected" status
Error: figma-desktop server not found
mcp2rest restarthttp://127.0.0.1:3845/mcpNo output or empty response
--nodeId parameter"123:456" not "123-456"Wrong framework/language output
--clientFrameworks to specify: react, vue, swiftui, etc.--clientLanguages to specify: typescript, javascript, swift--clientFrameworks react,typescriptFigJam extraction fails
get_figjam.js for FigJam files (not get_design_context.js)/board/ (FigJam) not /design/ (Figma)--includeImagesOfNodes for embedded images# View help for any script
node scripts/get_design_context.js --help
node scripts/get_variable_defs.js --help
node scripts/get_screenshot.js --help
Most tools support --clientLanguages and --clientFrameworks for customization:
# React with TypeScript
node get_design_context.js --nodeId "12:34" --clientFrameworks react,typescript
# Vue with Composition API
node get_design_context.js --nodeId "12:34" --clientFrameworks vue,composition-api
# SwiftUI
node get_design_context.js --nodeId "12:34" --clientFrameworks swiftui --clientLanguages swift
# Multiple frameworks for comparison
node get_design_context.js --nodeId "12:34" --clientFrameworks react,vue,svelte
Process multiple nodes in sequence:
# Save node IDs to file
echo "12:34" > nodes.txt
echo "45:67" >> nodes.txt
echo "89:01" >> nodes.txt
# Process each node
while read nodeId; do
echo "Processing $nodeId..."
node get_design_context.js --nodeId "$nodeId" --clientFrameworks react > "component_${nodeId//:/_}.tsx"
node get_screenshot.js --nodeId "$nodeId" > "screenshot_${nodeId//:/_}.png"
done < nodes.txt
Example: Extract design tokens during build:
{
"scripts": {
"extract-tokens": "cd .claude/skills/mcp-figma-desktop/scripts && node get_variable_defs.js > ../../src/theme/tokens.json",
"prebuild": "npm run extract-tokens"
}
}
--clientFrameworks react gives better output than genericget_metadata.js to explore structure before detailed extractionButton/Primary, Icon/Close)xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience