Figma Design React Converter
STDIOBridge between Figma designs and React implementations for pixel-perfect conversion.
Bridge between Figma designs and React implementations for pixel-perfect conversion.
A Model Context Protocol (MCP) server that provides a bridge between Figma designs and React implementations. This server enables pixel-perfect conversion of Figma designs into React applications by processing Figma file data and providing it in a React-friendly format.
get_file_content
:
{ fileKey: string; // Figma file key nodeId?: string; // Optional specific component ID }
get_node_images
:
{ fileKey: string; // Figma file key nodeIds: string[]; // Component IDs to fetch format?: 'png' | 'jpg' | 'svg'; scale?: number; // 1-4 }
To install Figma Design to React Converter for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @sanjeev23oct/figma-mcp --client claude
Clone the repository:
git clone https://github.com/yourusername/figma-mcp.git cd figma-mcp
Install dependencies:
npm install
Configure your Figma access token:
cp .env.example .env # Add your Figma access token to .env
Create the .cursor/mcp.json
file in your project root:
mkdir -p .cursor touch .cursor/mcp.json
For Stdio-based server configuration:
{ "mcpServers": { "figma": { "command": "node", "args": ["d:/<folder>>/figma-mcp/build/index.js"], "env": { "FIGMA_ACCESS_TOKEN": "your figma token" }, "disabled": false, "alwaysAllow": [], "protocol": "stdio" } }
}
## 💻 Usage
1. Build the server:
```bash
npm run build
```
2. Configure MCP settings based on your IDE:
- For VS Code (global settings):
```json
// In settings.json
{
"mcpServers": {
"figma": {
"command": "node",
"args": ["path/to/figma-mcp/build/index.js"],
"env": {
"FIGMA_ACCESS_TOKEN": "your-token-here"
}
}
}
}
```
- For Cursor IDE:
Use the `.cursor/mcp.json` configuration as described in the "Cursor IDE Setup" section above.
This configuration will take precedence over VS Code settings when using Cursor IDE.
3. Use the MCP tools in your application:
```typescript
// Example: Fetch processed Figma content
const result = await useMcpTool("figma", "get_file_content", {
fileKey: "your-figma-file-key"
});
Check out the raccoon-game
directory for a complete example of using this MCP server to create a pixel-perfect React implementation of a Figma design.
MIT License
Contributions welcome! Please read our contributing guidelines.
Made with ❤️ by [Your Name]