Figma to Code using Figma MCP Server
Convert custom Figma designs to production-ready shadcn/ui code
Transform your custom Figma designs into production-ready shadcn/ui components and blocks. This guide shows you how to leverage Figma's MCP Server with shadcn/studio to generate code from your customized designs.
- Converting customized shadcn/studio blocks with your own design modifications
- Generating code from completely custom UI designs
- When you need exact replication of your Figma customizations
If you're building landing pages by composing Pro/Free Blocks without heavy customization, you should use the /ftc
command instead. It automatically identifies and installs all shadcn/studio blocks from your Figma design.
Use /ftc command from shadcn/studio MCP server when: You're using Pro/Free Block component instances as-is with minimal changes
Use Figma MCP when: You've heavily customized blocks or created completely custom designs
Learn about /ftc CommandOfficial Documentation
For comprehensive details and advanced configuration options, refer to the official Figma MCP documentation:
View Official Figma MCP GuideQuick Setup Guide
Follow these steps to set up Figma MCP Server and optimize it for shadcn/studio development:
Visit the Figma MCP Catalog
Open Figma MCP CatalogInstall Figma MCP Server
Select your desired IDE and "Install" to add Figma MCP support to your AI assistant
Restart your IDE
Restart your code editor so it can connect to the Figma MCP server
Install Setup Instructions for shadcn/studio
Run the appropriate command in your terminal to download the setup instructions for working with shadcn/studio blocks:
curl --create-dirs -o .github/instructions/figma-mcp.instructions.md https://cdn.shadcnstudio.com/ss-assets/mcp/instructions/figma-mcp-copilot-instructions.md
This will create a .github/instructions
directory and download instructions that help GitHub Copilot understand how to work with Figma MCP and shadcn/studio components.
Project Configuration
To use Figma images in your Next.js project, you need to configure the image loader:
Update your next.config.ts
This configuration allows your Next.js app to load images from the Figma MCP server running on localhost port 3845.
Converting Custom Figma Designs to shadcn/ui Code
Transform your custom or heavily modified Figma designs into production-ready shadcn/ui components using these two methods. This workflow is ideal when you need to implement your customized designs.
Method 1: Select Frame in Figma
Real-time sync between Figma and your AI assistant. Perfect for converting custom UI components with your unique design modifications into shadcn/ui code.
Open Figma Desktop App
Make sure the Figma Desktop app is running and MCP is enabled
Select Your Design Frame
In Figma, click on the frame or component you want to convert to code. Make sure it's selected (you'll see the blue outline).
Open Your Code Editor
Open Cursor, VS Code, or your preferred AI-powered IDE
Prompt the AI
Use clear prompts to describe what you want. The AI will analyze your design and generate corresponding shadcn/ui code:
Generate code for the selected figma frame
Convert this Figma block to shadcn/ui code with exact styling
Generate a responsive card component matching this Figma design
Generate a responsive card component from the selected Figma frame
Review & Customize
The AI generates shadcn/ui components that closely match your custom design. Review the output for design fidelity and ask for refinements like "Adjust the spacing to match Figma exactly" or "Add proper TypeScript types" to perfect your components.
Figma MCP vs shadcn/studio MCP's /ftc Command
Understanding when to use each approach will help you choose the right tool for your workflow:
Figma to Code using Figma MCP Server
Best For:
- Custom UI designs and heavily modified blocks
- Complete layout and structural customization
- Unique components not based on Pro/Free Blocks
How It Works:
AI analyzes your Figma design using figma mcp and generates custom shadcn/ui code from scratch to match your exact specifications. Perfect when you need full control over every detail.
Output:
Generates new code files attempting to replicate your design as closely as possible
shadcn/studio MCP's /ftc Command
Best For:
- Using Pro/Free Block component instances
- Quick landing page assembly with minimal customization
- Rapid prototyping with existing block library
- When speed is more important than custom design
How It Works:
Automatically identifies Pro/Free Blocks in your Figma design by frame names and installs the exact matching blocks from shadcn/studio library. Lightning-fast block installation.
Output:
Installs pre-built, production-ready blocks from shadcn/studio library and creates a landing page (you have created using shadcn/studio blocks) from your Figma design.