A server implementation that enables interaction with Figma API through Model Context Protocol (MCP), supporting plugin and widget development with WebSocket communication capabilities.
A Figma API server implementation based on Model Context Protocol (MCP), supporting Figma plugin and widget integration.
git clone cd figma-mcp
bun install
Create a .env
file and set the following environment variables:
FIGMA_PERSONAL_ACCESS_TOKEN=your_figma_token
PORT=3001
NODE_ENV=development
.env
file or pass it via command line argumentsbun run build
bun run dev
Support for setting environment variables via the -e
parameter:
bun --watch src/index.ts -e FIGMA_PERSONAL_ACCESS_TOKEN=your_token -e PORT=6000
You can also use a dedicated token parameter:
bun --watch src/index.ts --token your_token
Or its shorthand:
bun --watch src/index.ts -t your_token
Add to the .cursor/mcp.json
file:
{ "Figma MCP": { "command": "bun", "args": [ "--watch", "/path/to/figma-mcp/src/index.ts", "-e", "FIGMA_PERSONAL_ACCESS_TOKEN=your_token_here", "-e", "PORT=6000" ] } }
The server provides the following Figma operation tools:
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.
Build the plugin:
bun run build:plugin
Run in development mode:
bun run dev:plugin
manifest.json
filePlugins can communicate with the MCP server via WebSocket to achieve:
bun run build:widget
bun run build:plugin
bun run dev:widget # Widget development mode bun run dev:plugin # Plugin development mode
MIT
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!