Figma MCP Server
A Figma API server implementation based on Model Context Protocol (MCP), supporting Figma plugin and widget integration.
Features
- Interact with Figma API through MCP
- WebSocket server for Figma plugin communication
- Support for Figma widget development
- Environment variable configuration via command line arguments
- Rich set of Figma operation tools
Installation
- Clone the repository:
- Install dependencies:
Configuration
Environment Variables
Create a .env
file and set the following environment variables:
Getting a Figma Access Token
- Log in to Figma
- Go to Account Settings > Personal Access Tokens
- Create a new access token
- Copy the token to your
.env
file or pass it via command line arguments
Usage
Build the Project
Run the Development Server
Using Command Line Arguments
Support for setting environment variables via the -e
parameter:
You can also use a dedicated token parameter:
Or its shorthand:
Configuring MCP in Cursor
Add to the .cursor/mcp.json
file:
Available Tools
The server provides the following Figma operation tools:
- File operations: Get files, versions, etc.
- Node operations: Get and manipulate Figma nodes
- Comment operations: Manage comments in Figma files
- Image operations: Export Figma elements as images
- Search functionality: Search content in Figma files
- Component operations: Manage Figma components
- Canvas operations: Create rectangles, circles, text, etc.
- Widget operations: Manage Figma widgets
Figma Plugin Development
Plugin Introduction
Figma plugins are customized tools that extend Figma's functionality, enabling workflow automation, adding new features, or integrating with external services. This MCP server provides a convenient way to develop, test, and deploy Figma plugins.
Building and Testing
Build the plugin:
Run in development mode:
Loading the Plugin in Figma
- Right-click in Figma to open the menu -> Plugins -> Development -> Import plugin from manifest...
- Select the plugin's
manifest.json
file - Your plugin will now appear in Figma's plugin menu
Plugin Interaction with MCP Server
Plugins can communicate with the MCP server via WebSocket to achieve:
- Complex data processing
- External API integration
- Cross-session data persistence
- AI functionality integration
Development
Build Widget
Build Plugin
Development Mode
License
MIT
This server cannot be installed
A server implementation that enables interaction with Figma API through Model Context Protocol (MCP), supporting plugin and widget development with WebSocket communication capabilities.