Figma Chunked Integration
STDIOMCP server for Figma API with memory-efficient chunking and pagination capabilities.
MCP server for Figma API with memory-efficient chunking and pagination capabilities.
A Model Context Protocol (MCP) server for interacting with the Figma API, featuring memory-efficient chunking and pagination capabilities for handling large Figma files.
This MCP server provides a robust interface to the Figma API with built-in memory management features. It's designed to handle large Figma files efficiently by breaking down operations into manageable chunks and implementing pagination where necessary.
To install Figma MCP Server with Chunking for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @ArchimedesCrypto/figma-mcp-chunked --client claude
# Clone the repository git clone [repository-url] cd figma-mcp-chunked # Install dependencies npm install # Build the project npm run build
FIGMA_ACCESS_TOKEN
: Your Figma API access tokenYou can provide configuration via a JSON file using the --config
flag:
{ "mcpServers": { "figma": { "env": { "FIGMA_ACCESS_TOKEN": "your-access-token" } } } }
Usage:
node build/index.js --config=path/to/config.json
Retrieves Figma file data with memory-efficient chunking and pagination.
{ "name": "get_file_data", "arguments": { "fileKey": "your-file-key", "accessToken": "your-access-token", "pageSize": 100, // Optional: nodes per chunk "maxMemoryMB": 512, // Optional: memory limit "nodeTypes": ["FRAME", "COMPONENT"], // Optional: filter by type "cursor": "next-page-token", // Optional: resume from last position "depth": 2 // Optional: traversal depth } }
Response:
{ "nodes": [...], "memoryUsage": 256.5, "nextCursor": "next-page-token", "hasMore": true }
Lists files with pagination support.
{ "name": "list_files", "arguments": { "project_id": "optional-project-id", "team_id": "optional-team-id" } }
Retrieves version history in chunks.
{ "name": "get_file_versions", "arguments": { "file_key": "your-file-key" } }
Retrieves comments with pagination.
{ "name": "get_file_comments", "arguments": { "file_key": "your-file-key" } }
Retrieves file information with chunked node traversal.
{ "name": "get_file_info", "arguments": { "file_key": "your-file-key", "depth": 2, // Optional: traversal depth "node_id": "specific-node-id" // Optional: start from specific node } }
Retrieves components with chunking support.
{ "name": "get_components", "arguments": { "file_key": "your-file-key" } }
Retrieves styles with chunking support.
{ "name": "get_styles", "arguments": { "file_key": "your-file-key" } }
Retrieves specific nodes with chunking support.
{ "name": "get_file_nodes", "arguments": { "file_key": "your-file-key", "ids": ["node-id-1", "node-id-2"] } }
The server implements several strategies to manage memory efficiently:
pageSize
pageSize
: Number of nodes per chunk (default: 100)maxMemoryMB
: Maximum memory usage in MB (default: 512)nodeTypes
: Filter specific node typesdepth
: Control traversal depth for nested structuresThe server includes comprehensive debug logging:
// Debug log examples [MCP Debug] Loading config from config.json [MCP Debug] Access token found xxxxxxxx... [MCP Debug] Request { tool: 'get_file_data', arguments: {...} } [MCP Debug] Response size 2.5 MB
The server provides detailed error messages and suggestions:
// Memory limit error "Response size too large. Try using a smaller depth value or specifying a node_id."" // Invalid parameters "Missing required parameters: fileKey and accessToken" // API errors "Figma API error: [detailed message]"
Memory Errors
Performance Issues
API Limits
Enable debug logging for detailed information:
# Set debug environment variable export DEBUG=true
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
This project is licensed under the MIT License - see the LICENSE file for details.