Figma MCP Server
Figma MCP Server
A TypeScript server implementing the Model Context Protocol (MCP) for the Figma API, enabling standardized context provision for LLMs.
Overview
This server provides MCP-compliant access to Figma resources, allowing LLM applications to seamlessly integrate with Figma files, components, and variables. It implements the full MCP specification while providing specialized handlers for Figma's unique resource types.
Key Features
- MCP Resource Handlers
- Figma files access and manipulation
- Variables and components management
- Custom URI scheme (figma:///)
- Robust Implementation
- Type-safe implementation using TypeScript
- Request validation using Zod schemas
- Comprehensive error handling
- Token validation and API integration
- Batch operations support
Project Structure
Installation
Configuration
- Set up your Figma access token:Copyexport FIGMA_ACCESS_TOKEN=your_access_token
- Configure the server (optional):Copyexport MCP_SERVER_PORT=3000
Usage
Starting the Server
Using as an MCP Server
The server implements the Model Context Protocol, making it compatible with any MCP client. It supports both stdio and SSE transports:
stdio Transport
SSE Transport
Client Integration
Resource URIs
The server implements a custom figma:///
URI scheme for accessing Figma resources:
- Files:
figma:///file/{file_key}
- Components:
figma:///component/{file_key}/{component_id}
- Variables:
figma:///variable/{file_key}/{variable_id}
- Styles:
figma:///style/{file_key}/{style_id}
- Teams:
figma:///team/{team_id}
- Projects:
figma:///project/{project_id}
Supported Operations
The server implements the following MCP operations:
resources/list
: List available Figma resourcesresources/read
: Read content of Figma resourcesresources/watch
: Watch for resource changesresources/search
: Search across Figma resourcesresources/metadata
: Get metadata about resources
Development
Setting Up Development Environment
Running Tests
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Roadmap
- Implement comprehensive test suite
- Add support for more Figma API endpoints
- Implement caching layer
- Add rate limiting
- Enhance documentation
- Set up CI/CD pipeline
- Add WebSocket transport support
- Implement resource change notifications
- Add plugin system for custom resource handlers
Debugging
Enable debug logging by setting the DEBUG environment variable:
Error Handling
The server implements standard MCP error codes:
-32700
: Parse error-32600
: Invalid request-32601
: Method not found-32602
: Invalid parameters-32603
: Internal error100
: Resource not found101
: Resource access denied102
: Resource temporarily unavailable
License
This project is licensed under the MIT License - see the LICENSE file for details.
Related Resources
Enables seamless interaction with Figma via the Model Context Protocol, allowing LLM applications to access, manipulate, and track Figma files, components, and variables.