claude-figma-mcp
v1.0.1
Published
Model Context Protocol server for Claude integration with Figma
Downloads
42
Readme
Claude Figma MCP
A Model Context Protocol (MCP) server that enables Claude to create and manipulate designs in Figma through a Figma plugin.
Overview
This project consists of two main components:
- MCP Server: A server that implements the Model Context Protocol, allowing Claude to communicate with Figma
- Figma Plugin: A Figma plugin that listens for commands from the MCP server and executes them in Figma
Installation
Running the server quickly with NPM
You can run the server quickly without installing or building the repo using NPM:
npx claude-figma-mcpRunning the server from local source
- Clone this repository
- Install dependencies with
npm install - Build the TypeScript code with
npm run build - Run the server with
npm start
JSON config for Claude Desktop
Add the following to your Claude Desktop configuration file:
{
"mcpServers": {
"figma-mcp": {
"command": "npx",
"args": [
"-y",
"claude-figma-mcp",
"--stdio"
]
}
}
}Setting up the Figma Plugin
- Open Figma and go to Menu → Plugins → Development → Import plugin from manifest...
- Select the
figma-plugin/manifest.jsonfile from this repository - The plugin should now be available in your Figma plugins menu
Usage
- Start the MCP server using one of the methods above
- Open Figma and run the Claude MCP Integration plugin
- Click "Connect to MCP Server" in the plugin UI
- In Claude, use the Figma MCP tool to interact with Figma
Available Tools
The MCP server provides the following tools:
create_project: Create a new Figma projectcreate_frame: Create a new frame/artboardcreate_rectangle: Create a rectangle elementcreate_text: Create a text elementcreate_component: Create pre-defined UI components (buttons, inputs, etc.)create_layout: Create common layout patterns (headers, footers, etc.)create_interaction: Create interactive prototyping connections between elementsexport_frame: Export a frame as an image
Example Claude Prompts
Here are some examples of how to interact with the MCP server through Claude:
Creating a Simple UI
Can you create a login screen in Figma? It should have a logo at the top, email and password input fields, and a login button.Creating a More Complex Layout
I need a dashboard layout in Figma with a header, sidebar navigation, and a main content area with 4 card components showing different statistics.Creating an Interactive Prototype
Please create a simple app flow in Figma with three screens: Home, Profile, and Settings. Then connect them with interactions so I can click between the screens.Configuration
The server can be configured using environment variables or command-line arguments:
Environment Variables
PORT: HTTP server port (default: 3000)WEBSOCKET_PORT: WebSocket server port for Figma plugin communication (default: 8080)FIGMA_API_KEY: Figma API key (optional, only if using Figma API directly)
Command Line Arguments
--port: HTTP server port--websocket-port: WebSocket server port--figma-api-key: Figma API key--stdio: Run in stdio mode (for Claude Desktop integration)
Troubleshooting
"WebSocket is not available in this environment"
The Figma plugin environment doesn't support WebSockets. The plugin automatically falls back to an HTTP-based communication method.
Plugin Can't Connect to Server
Make sure:
- The MCP server is running
- The ports aren't blocked by a firewall
- The WebSocket port (default: 8080) matches in both server config and plugin
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
