figma mcp server
Enables seamless interaction with Figma via the Model Context Protocol, allowing LLM applications to access, manipulate, and track Figma files, components, and variables.
Enables seamless interaction with Figma via the Model Context Protocol, allowing LLM applications to access, manipulate, and track Figma files, components, and variables.
A Model Context Protocol (MCP) server that provides integration with Figma's API through Claude and other MCP-compatible clients. Currently supports read-only access to Figma files and projects, with server-side architecture capable of supporting more advanced design token and theme management features (pending Figma API enhancements or plugin development).
get-file
and list-files
tools for Figma file accessThe server has been designed with code to support these features (currently limited by API restrictions):
With Figma plugin development or expanded API access, these features could be fully enabled.
npm install figma-mcp-server
.env
file based on .env.example
:# Figma API Access Token
FIGMA_ACCESS_TOKEN=your_figma_token
# Server Configuration
MCP_SERVER_PORT=3000
# Debug Configuration
DEBUG=figma-mcp:*
The server can be configured in your Claude Desktop config file:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%Claudeclaude_desktop_config.json
{
"mcpServers": {
"figma": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/figma-mcp-server/dist/index.js"],
"env": {
"FIGMA_ACCESS_TOKEN": "your_token_here"
}
}
}
}
Important Notes: - Use ABSOLUTE paths, not relative paths - On Windows, use double backslashes () in paths - Restart Claude Desktop after making configuration changes
import { startServer } from 'figma-mcp-server';
const server = await startServer(process.env.FIGMA_ACCESS_TOKEN);
Retrieve Figma file details
{
"name": "get-file",
"arguments": {
"fileKey": "your_file_key"
}
}
list-files
List files in a Figma project
{
"name": "list-files",
"arguments": {
"projectId": "your_project_id"
}
}
create-variables
Create design system variables
{
"name": "create-variables",
"arguments": {
"fileKey": "your_file_key",
"variables": [
{
"name": "primary-color",
"type": "COLOR",
"value": "#0066FF"
}
]
}
}
create-theme
{
"name": "create-theme",
"arguments": {
"fileKey": "your_file_key",
"name": "Dark Theme",
"modes": [
{
"name": "dark",
"variables": [
{
"variableId": "123",
"value": "#000000"
}
]
}
]
}
}
startServer(figmaToken: string, debug?: boolean, port?: number)
All tool inputs are validated using Zod schemas:
const CreateVariablesSchema = z.object({
fileKey: z.string(),
variables: z.array(z.object({
name: z.string(),
type: z.enum(['COLOR', 'FLOAT', 'STRING']),
value: z.string(),
scope: z.enum(['LOCAL', 'ALL_FRAMES'])
}))
});
The server provides detailed error messages and proper error codes:
Write operations would require Figma plugin development instead
Rate Limiting
Implement exponential backoff for better handling
Cache Management
Consider implementing cache invalidation hooks
Authentication
OAuth implementation planned for future
Technical Implementation
Please follow our coding standards: - TypeScript strict mode - ESLint configuration - Jest for testing - Comprehensive error handling
MIT License - See LICENSE file for details
See TROUBLESHOOTING.md for a comprehensive troubleshooting guide.
npm run build
)Verify all environment variables are set
Authentication Issues
Ensure the token is correctly set in configuration
Server Not Starting
dist/index.js
)~/Library/Logs/Claude/mcp*.log
%APPDATA%Claudelogsmcp*.log
For more detailed debugging steps and solutions, refer to the troubleshooting guide.
[
{
"description": "Get details of a Figma file",
"inputSchema": {
"properties": {
"fileKey": {
"description": "The Figma file key",
"type": "string"
}
},
"required": [
"fileKey"
],
"type": "object"
},
"name": "get-file"
},
{
"description": "List files in a Figma project",
"inputSchema": {
"properties": {
"projectId": {
"description": "The Figma project ID",
"type": "string"
}
},
"required": [
"projectId"
],
"type": "object"
},
"name": "list-files"
}
]