🎨 Code Generation
Generate production-ready UI code from Figma components for React, Astro, and other frameworks.
The Figma MCP server enables direct integration between Figma design files and your development workflow through Claude Code. It provides automated code generation, design token extraction, and seamless design-to-development handoffs.
This MCP server allows Claude to interact directly with Figma designs, extracting components, design tokens, and assets to generate production-ready code that matches your project’s architecture and conventions.
🎨 Code Generation
Generate production-ready UI code from Figma components for React, Astro, and other frameworks.
🎯 Design Tokens
Extract design variables (colors, typography, spacing) and convert to CSS custom properties.
🔗 Code Connect
Link Figma components to existing codebase components for bidirectional synchronization.
📸 Asset Export
Export high-quality images from Figma nodes in multiple formats optimized for web.
📋 Design System
Generate design system rules and comprehensive documentation automatically.
mcp__figma-dev-mode-mcp-server__get_codeGenerate UI code for a given Figma node or the currently selected node.
Parameters:
nodeId (optional): The ID of the node (e.g., “123:456”). If not provided, uses currently selected node.clientFrameworks: Comma-separated list of frameworks (e.g., “react,astro,typescript”)clientLanguages: Programming languages used (e.g., “javascript,typescript,scss”)mcp__figma-dev-mode-mcp-server__get_variable_defsGet variable definitions for design tokens from Figma components.
Returns: Object with variable mappings like {'icon/default/secondary': '#949494'}
mcp__figma-dev-mode-mcp-server__get_code_connect_mapGet mapping between Figma components and codebase components.
Returns: Object mapping node IDs to code locations and component names.
mcp__figma-dev-mode-mcp-server__get_imageGenerate high-quality images from Figma nodes.
Features:
mcp__figma-dev-mode-mcp-server__create_design_system_rulesGenerate comprehensive design system documentation and rules.
Output:
Install the Figma MCP server and connect it to your local Figma Desktop instance:
claude mcp add --transport http figma-desktop http://127.0.0.1:3845/mcpFor more Figma installation options and configuration details, see the
Generate React code for the button component with node ID 123:456Claude will:
Extract design variables from the design system componentReturns variables like:
{ 'color/primary': '#007AFF', 'spacing/base': '16px', 'typography/heading/size': '24px'}Export the hero section as a PNG imageGenerates optimized images for:
Most Figma MCP operations require a nodeId parameter:
https://figma.com/design/fileKey/fileName?node-id=1-2The nodeId would be 1:2 (replace hyphens with colons)
If you don’t provide a nodeId, the server uses the currently selected node in Figma Desktop.
Generate an Astro component for this design, using our existing SCSS architectureOutput Location: src/components/astro/
Styling: Integrates with src/styles/ architecture
Create a React component for client-side interactivity, following our src/components/react/ patternsOutput Location: src/components/react/
Features: Interactive elements with proper TypeScript
Extract design tokens and create SCSS variables that integrate with our src/styles/index.scssIntegration: Maps to existing variable system Output: Compatible with current SCSS architecture
Select Component in Figma
Generate Code
I need to implement the pricing card component from our design systemExtract Variables
Also extract the design variables used in this componentTest Integration
npm run build # Test build processnpm test # Run unit testsnpm run lint:all # Code quality checksAudit Tokens
Extract all design variables from our main design system fileUpdate Code Variables
Generate Documentation
Create design system rules for the updated tokensNode ID Not Found
No Component Selected
Permission Errors
Code Generation Issues
Generate React components for all button variants in our design system.Include TypeScript interfaces and integrate with our existing SCSS architecture.Use the component patterns from src/components/react/ and create correspondingSCSS files in src/styles/components/.Extract design tokens from our main design system file and update ourSCSS variables in src/styles/index.scss. Show me what tokens are new,changed, or removed compared to the current implementation.Export all icon components as SVG assets and create an icon librarycomponent that follows our existing component patterns. Include properTypeScript types and documentation.