|
| 1 | +# Figma MCP Integration |
| 2 | + |
| 3 | +This guide explains how to set up Figma Model Context Protocol (MCP) integration with VS Code Copilot Chat for improved design-to-code workflow. |
| 4 | + |
| 5 | +## What is Figma MCP? |
| 6 | + |
| 7 | +Figma MCP enables direct integration between Figma and VS Code Copilot Chat, allowing you to: |
| 8 | + |
| 9 | +- Extract design tokens and specifications directly in chat |
| 10 | +- Compare code implementations against Figma designs |
| 11 | +- Generate code from Figma components |
| 12 | +- Access design information without switching between tools |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +- Figma Desktop app installed |
| 17 | +- VS Code with GitHub Copilot extension |
| 18 | +- Access to the Equinor Design System Figma files |
| 19 | +- **Important**: You must be a member of the EDS team in Figma |
| 20 | + |
| 21 | +## Setup |
| 22 | + |
| 23 | +### 1. Enable Figma Dev Mode |
| 24 | + |
| 25 | +1. Open Figma Desktop |
| 26 | +2. Navigate to the [EDS Workspace](https://www.figma.com/files/682286909510540417/workspace/1404734309303602976/directory/teams): |
| 27 | + - For component migration work, focus on [EDS Core Components](https://www.figma.com/files/682286909510540417/project/328956212/Core-Components) |
| 28 | + - Open any of the component files |
| 29 | +3. **Enable Dev Mode**: |
| 30 | + - Look for the "Dev Mode" toggle in the right side of the toolbar at the bottom of Figma |
| 31 | + - Click to enable it (should show a green indicator when active) |
| 32 | + - You'll see the interface change to show component specs and tokens |
| 33 | + |
| 34 | +### 2. Verify MCP Server is Running |
| 35 | + |
| 36 | +To confirm the MCP server is active: |
| 37 | + |
| 38 | +1. With Dev Mode enabled in Figma, check the status bar in the right hand panel |
| 39 | +2. You should see an indicator showing "MCP Server: Enabled" with a green checkmark in the status bar |
| 40 | +3. If you don't see this, try: |
| 41 | + - Refreshing the Figma file |
| 42 | + - Toggling Dev Mode off and on again |
| 43 | + - Restarting Figma Desktop |
| 44 | + |
| 45 | +### 3. Configure VS Code |
| 46 | + |
| 47 | +The repository includes MCP configuration in `.vscode/mcp.json`: |
| 48 | + |
| 49 | +```json |
| 50 | +{ |
| 51 | + "servers": { |
| 52 | + "figma": { |
| 53 | + "type": "http", |
| 54 | + "url": "http://127.0.0.1:3845/mcp" |
| 55 | + } |
| 56 | + } |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +This configuration connects to Figma Desktop's local MCP server when Dev Mode is active. |
| 61 | + |
| 62 | +### 4. Start Integration |
| 63 | + |
| 64 | +1. Ensure Figma Desktop is running with Dev Mode enabled on a Core Components file |
| 65 | +2. Open VS Code in the design-system repository |
| 66 | +3. Open Copilot Chat (`Ctrl/Cmd + Shift + I`) |
| 67 | +4. Test the connection by asking: "Can you access Figma?" |
| 68 | +5. The Figma MCP server should automatically connect and respond |
| 69 | + |
| 70 | +### 5. Test Your Setup |
| 71 | + |
| 72 | +Try these commands to verify everything works: |
| 73 | + |
| 74 | +``` |
| 75 | +Show me the current Figma file details |
| 76 | +``` |
| 77 | + |
| 78 | +``` |
| 79 | +What components are available in this Figma file? |
| 80 | +``` |
| 81 | + |
| 82 | +If these work, you're ready to go! |
| 83 | + |
| 84 | +## Usage Examples |
| 85 | + |
| 86 | +Once configured, you can use Figma integration in Copilot Chat: |
| 87 | + |
| 88 | +### Design Token Extraction |
| 89 | + |
| 90 | +``` |
| 91 | +Get the spacing tokens from the Button component in the current Figma file |
| 92 | +``` |
| 93 | + |
| 94 | +### Component Specification Lookup |
| 95 | + |
| 96 | +``` |
| 97 | +Show me the design specifications for the Checkbox component |
| 98 | +``` |
| 99 | + |
| 100 | +### Component Comparison |
| 101 | + |
| 102 | +``` |
| 103 | +Compare my Checkbox implementation with the Figma design specifications |
| 104 | +``` |
| 105 | + |
| 106 | +### Code Generation |
| 107 | + |
| 108 | +``` |
| 109 | +Generate CSS for the Alert component based on the Figma design tokens |
| 110 | +``` |
| 111 | + |
| 112 | +### EDS-Specific Queries |
| 113 | + |
| 114 | +``` |
| 115 | +What foundation tokens are used in the Checkbox 2.0 component? |
| 116 | +``` |
| 117 | + |
| 118 | +``` |
| 119 | +Show me the color tokens for accent colors in the current Core Components file |
| 120 | +``` |
| 121 | + |
| 122 | +``` |
| 123 | +Compare the spacing tokens between Button 2.0 and the old Button component |
| 124 | +``` |
| 125 | + |
| 126 | +## Troubleshooting |
| 127 | + |
| 128 | +### MCP Server Not Found |
| 129 | + |
| 130 | +- Ensure Figma Desktop is running (not just browser version) |
| 131 | +- Check that Dev Mode is enabled in an EDS Figma file |
| 132 | +- Verify you're in one of the main Core Components files, not a personal draft |
| 133 | +- Restart VS Code if the connection fails |
| 134 | +- Check VS Code's Output panel for MCP connection logs |
| 135 | + |
| 136 | +### No Response from Figma in Chat |
| 137 | + |
| 138 | +- Make sure you have an active EDS Figma file open in Figma Desktop |
| 139 | +- Try switching to a different EDS component file |
| 140 | +- Restart both Figma Desktop and VS Code |
| 141 | +- Check that port 3845 is not blocked by firewall |
| 142 | + |
| 143 | +### Access Issues |
| 144 | + |
| 145 | +- Verify you have access to the EDS Figma files |
| 146 | +- Check your Figma account permissions with the EDS team |
| 147 | +- Ensure you're logged into the correct Figma account in Desktop app |
| 148 | + |
| 149 | +### Dev Mode Not Available |
| 150 | + |
| 151 | +- You need to be a member of the EDS team in Figma to access Dev Mode |
| 152 | +- Contact the EDS team for access if you can't see Dev Mode toggle |
| 153 | + |
| 154 | +## Benefits for EDS Development |
| 155 | + |
| 156 | +- **Faster migration work** - Direct access to design specs during component migration |
| 157 | +- **Better design alignment** - Real-time comparison between code and design |
| 158 | +- **Automated token extraction** - Get exact values for spacing, colors, typography |
| 159 | +- **Streamlined workflow** - Less context switching between tools |
| 160 | + |
| 161 | +## Related |
| 162 | + |
| 163 | +- [Component Guidelines](../../COMPONENT_GUIDELINES.md) |
| 164 | +- [Migration guides](../../packages/eds-core-react/) |
| 165 | +- [EDS Workspace](https://www.figma.com/files/682286909510540417/workspace/1404734309303602976/directory/teams) |
| 166 | +- [EDS Core Components](https://www.figma.com/files/682286909510540417/project/328956212/Core-Components) |
| 167 | +- [Color System Documentation](../../packages/eds-tokens/instructions/colors.md) |
| 168 | + |
| 169 | +## Team-Specific Notes |
| 170 | + |
| 171 | +- **For component migration**: Use Figma MCP to extract exact foundation tokens during vanilla CSS conversion from the Core Components files |
| 172 | +- **For designers**: This integration helps ensure design-code alignment during reviews of new 2.0 components |
| 173 | +- **For new team members**: Request EDS Figma access from the team before attempting setup |
| 174 | +- **Core Components focus**: The new migrated components (Checkbox 2.0, Button 2.0, etc.) live in the Core Components project |
0 commit comments