A Model Context Protocol (MCP) server that provides tools for interacting with Figma design files. It allows Cursor IDE to connect and fetch design tokens and components from Figma files.
- Parse Figma URLs to extract file keys and node IDs
- Fetch design tokens from Figma files, including:
- Colors (fill and stroke styles)
- Typography (text styles)
- Spacing (grid styles)
- Effects (effect styles)
- Integration with Cursor IDE
- Python 3.9 or higher
- Figma Access Token (get it from your Figma account settings)
- Clone the repository:
git clone https://github.com/yourusername/figma-mcp.git
cd figma-mcp- Make the setup script executable and run it:
chmod +x setup.sh./setup.shThe setup script will:
- Check for Python 3.9+ and pip
- Create a virtual environment
- Install all dependencies
- Create a .env file for your Figma access token
- Clone the repository:
git clone https://github.com/yourusername/figma-mcp.git
cd figma-mcp- Create a virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate # On Windows, use: .venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile in the root directory with your Figma access token:
FIGMA_ACCESS_TOKEN=your_figma_access_token
- Start the server:
python src/main.py --transport sse --port YOUR_PORT The server will start on port 8000 by default.
Once the server has started Go to Cursor Settings > MCP > Add new Global MCP Server
Paste the following in the JSON
{
"mcpServers": {
"figma": {
"url": "http://localhost:4000/sse",
"env": {
"FIGMA_ACCESS_TOKEN": "YOUR_FIGMA_TOKEN"
}
}
}
}
-
figma_fetch- Fetches design tokens and components from a Figma file
- Parameters:
fileKey(required): Figma file keynodeId(optional): Specific node ID to fetchqueryType(optional): Type of data to fetch (design-tokens, components)
-
figma_url_parse- Parses a Figma URL to extract file key and node ID
- Parameters:
figmaUrl(required): Figma URL to parse
-
mood- A simple tool to check the server's mood
- Parameters:
question(required): Any question about the server's mood
The design tokens will be returned in a structured JSON format:
{
"colors": {
"token-name": {
"name": "token-name",
"styleType": "fill",
...
}
},
"typography": {
...
},
"spacing": {
...
},
"effects": {
...
}
}The project uses:
- Python 3.9+
- httpx for async HTTP requests
- click for CLI interface
- anyio for async I/O
- mcp for the Model Context Protocol implementation
This project is licensed under the MIT License - see the LICENSE file for details.