The MCP Figma to React Converter is a server designed to streamline the process of converting Figma designs into React components. It leverages the Figma API to fetch designs and generates React components with TypeScript and Tailwind CSS. This tool is ideal for developers looking to bridge the gap between design and development efficiently.
shell
git clone https://github.com/StudentOfJS/mcp-figma-to-react.git
shell
npm install
shell
npm run build
Set the FIGMA_API_TOKEN
environment variable to your Figma API token. You can obtain a personal access token from your Figma account settings.
FIGMA_API_TOKEN=your_token_here npm start
Or with explicit transport:
FIGMA_API_TOKEN=your_token_here node dist/index.js --transport=stdio
FIGMA_API_TOKEN=your_token_here node dist/index.js --transport=sse
getFigmaProject
: Retrieve the structure of a Figma project.getFigmaComponentNodes
: Fetch component nodes from a Figma file.extractFigmaComponents
: Extract components from a Figma file.getFigmaComponentSets
: Retrieve component sets from a Figma file.generateReactComponent
: Generate a React component from a Figma node.generateComponentLibrary
: Generate multiple React components from Figma components.writeComponentsToFiles
: Save generated components to files.figmaToReactWorkflow
: Complete workflow for converting Figma designs to React components.figma.com/file/
).figmaToReactWorkflow
tool with the file key and output directory.For development, use the watch mode:
npm run dev
ISC
This project is a Model Context Protocol (MCP) server designed to convert Figma designs into React components. It simplifies the workflow for developers by automating the conversion process.