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.
Overview
Section titled “Overview”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.
Core Capabilities
Section titled “Core Capabilities”🎨 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.
Available Functions
Section titled “Available Functions”mcp__figma-dev-mode-mcp-server__get_code
Section titled “mcp__figma-dev-mode-mcp-server__get_code”Generate 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_defs
Section titled “mcp__figma-dev-mode-mcp-server__get_variable_defs”Get 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_map
Section titled “mcp__figma-dev-mode-mcp-server__get_code_connect_map”Get 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_image
Section titled “mcp__figma-dev-mode-mcp-server__get_image”Generate high-quality images from Figma nodes.
Features:
- Multiple format support (PNG, JPG, SVG)
- High-resolution exports
- Web-optimized output
mcp__figma-dev-mode-mcp-server__create_design_system_rules
Section titled “mcp__figma-dev-mode-mcp-server__create_design_system_rules”Generate comprehensive design system documentation and rules.
Output:
- Design token documentation
- Component usage guidelines
- Framework-specific implementations
Quick Start
Section titled “Quick Start”Prerequisites
Section titled “Prerequisites”- Figma Desktop Application installed and running
- Active Figma Project with design components
- Proper File Permissions (owner or editor access)
Basic Usage
Section titled “Basic Usage”Generate React code for the button component with node ID 123:456Claude will:
- Extract the Figma component structure
- Generate appropriate React/Astro code
- Include proper styling and TypeScript types
- Follow your project’s conventions
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:
- Web use cases
- Multiple resolutions
- Various formats
Working with Node IDs
Section titled “Working with Node IDs”Most Figma MCP operations require a nodeId parameter:
From Figma URLs
Section titled “From Figma URLs”https://figma.com/design/fileKey/fileName?node-id=1-2The nodeId would be 1:2 (replace hyphens with colons)
From Selected Components
Section titled “From Selected Components”If you don’t provide a nodeId, the server uses the currently selected node in Figma Desktop.
Integration with Astro-Basics
Section titled “Integration with Astro-Basics”Project-Specific Workflows
Section titled “Project-Specific Workflows”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
Common Workflows
Section titled “Common Workflows”Design-to-Code Pipeline
Section titled “Design-to-Code Pipeline”-
Select Component in Figma
- Open design file in Figma Desktop
- Select the component to implement
-
Generate Code
I need to implement the pricing card component from our design system -
Extract Variables
Also extract the design variables used in this component -
Test Integration
Terminal window npm run build # Test build processnpm test # Run unit testsnpm run lint:all # Code quality checks
Design System Maintenance
Section titled “Design System Maintenance”-
Audit Tokens
Extract all design variables from our main design system file -
Update Code Variables
- Compare with existing CSS/SCSS variables
- Update inconsistencies
- Add new tokens as needed
-
Generate Documentation
Create design system rules for the updated tokens
Best Practices
Section titled “Best Practices”Figma Organization
Section titled “Figma Organization”- Use consistent, descriptive component names
- Leverage Auto Layout for responsive behavior
- Set up proper design variables
- Maintain clean component hierarchy
Code Generation
Section titled “Code Generation”- Specify framework context explicitly
- Mention existing styling systems (SCSS, Tailwind, etc.)
- Reference component patterns in your codebase
- Always review and adapt generated code
Design Token Management
Section titled “Design Token Management”- Establish semantic token naming
- Create consistent scales
- Sync regularly when designs change
- Version control design tokens
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Node ID Not Found
- Verify the node exists and you have access permissions
- Ensure Figma file is open in desktop app
No Component Selected
- Select a component in Figma Desktop before running commands
- Alternatively, provide explicit node ID
Permission Errors
- Ensure proper Figma file permissions
- Verify you can edit or view the file in Figma
Code Generation Issues
- Provide specific framework and context information
- Mention existing patterns in your codebase
Example Usage
Section titled “Example Usage”Multi-Component Generation
Section titled “Multi-Component Generation”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/.Design Token Sync
Section titled “Design Token Sync”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.Asset Pipeline
Section titled “Asset Pipeline”Export all icon components as SVG assets and create an icon librarycomponent that follows our existing component patterns. Include properTypeScript types and documentation.Resources
Section titled “Resources”- Figma API Documentation - Official API reference
- Design Tokens Community - Token standards and best practices
- MCP Protocol Specification - MCP technical documentation
Next Steps
Section titled “Next Steps”- MCP Setup Guide - Install and configure MCP servers
- MCP Overview - Explore all available MCP servers
- Usage Examples - Real-world scenarios and code samples
- Troubleshooting - Common issues and solutions