| name | figma-mcp-cached |
| description | Cache-enabled Figma Context MCP server with persistent disk caching to reduce API rate limits and improve performance for AI-powered design workflows |
| triggers | ["access Figma designs through MCP","set up Figma caching for faster API responses","configure Figma MCP server with disk cache","reduce Figma API rate limit hits","prepare and cache Figma files locally","download images from Figma designs","get Figma design data with caching","encrypt Figma cache for security"] |
Figma MCP Cached
Skill by ara.so — Design Skills collection.
A cache-enabled Figma Context MCP (Model Context Protocol) server that uses persistent disk caching to dramatically reduce Figma API requests, mitigate rate limiting issues, and improve response times. Built on TypeScript, this MCP server is optimized for AI coding agents in Cursor, Claude Desktop, and other MCP-compatible clients.
What It Does
- Persistent Disk Caching: Stores Figma API responses locally with configurable TTL (time-to-live)
- Rate Limit Mitigation: Reduces API calls by 10x+ after initial cache, perfect for free Figma accounts
- Smart File Preparation:
figma_prepare_file tool validates cache, checks nodeIds, and auto-refreshes when needed
- Force Refresh: Override cache to fetch latest design updates on demand
- LRU Memory Cache: In-memory caching layer to avoid repeated disk I/O
- Optional Encryption: AES-256-CBC encryption for sensitive design data
- Auto Cleanup: Scheduled cleanup of expired cache files
- System Integration: Saves downloaded images to OS-specific Downloads folder by default
Installation
For MCP Clients (Cursor, Claude Desktop, etc.)
Add to your MCP configuration file (e.g., ~/.cursor/mcp.json or ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"figma-mcp-cached": {
"command": "npx",
"args": [
"-y",
"@pactortester/figma-mcp-cached",
"--stdio",
"--figma-api-key=${FIGMA_API_KEY}",
"--figma-caching={\"ttl\":{\"value\":7,\"unit\":\"d\"}}"
]
}
}
}
Get Figma API Key
- Visit Figma Developer Settings
- Create a Personal Access Token
- Set environment variable:
export FIGMA_API_KEY=your_token_here
Verify Installation
Restart your MCP client and check that the figma-mcp-cached server appears in the tools list with three tools:
figma_prepare_file
get_figma_data
download_figma_images
Configuration Options
Basic Configuration
{
"mcpServers": {
"figma-mcp-cached": {
"command": "npx",
"args": [
"-y",
"@pactortester/figma-mcp-cached",
"--stdio",
"--figma-api-key=${FIGMA_API_KEY}",
"--figma-caching={\"ttl\":{\"value\":30,\"unit\":\"d\"}}"
]
}
}
}
Full Configuration with All Options
{
"mcpServers": {
"figma-mcp-cached": {
"command": "npx",
"args": [
"-y",
"@pactortester/figma-mcp-cached",
"--stdio",
"--figma-api-key=${FIGMA_API_KEY}",
"--figma-caching={\"ttl\":{\"value\":30,\"unit\":\"d\"},\"cacheDir\":\"~/figma-cache\",\"autoCleanup\":true,\"cleanupInterval\":{\"value\":1,\"unit\":\"h\"},\"maxMemoryCacheSize\":200,\"encryptionKey\":\"${FIGMA_CACHE_ENCRYPTION_KEY}\"}"
]
}
}
}
Configuration Parameters
ttl (Required)
Cache time-to-live. Units: ms, s, m, h, d
{"ttl": {"value": 7, "unit": "d"}}
{"ttl": {"value": 2, "unit": "h"}}
cacheDir (Optional)
Custom cache directory. Defaults:
- Linux:
~/.cache/figma-mcp
- macOS:
~/Library/Caches/FigmaMcp
- Windows:
%LOCALAPPDATA%/FigmaMcpCache
{"cacheDir": "~/my-figma-cache"}
autoCleanup (Optional)
Enable automatic cleanup of expired cache. Default: true
{"autoCleanup": true}
cleanupInterval (Optional)
Auto-cleanup frequency. Default: 1 hour
{"cleanupInterval": {"value": 1, "unit": "h"}}
maxMemoryCacheSize (Optional)
Max LRU memory cache entries. Default: 100
{"maxMemoryCacheSize": 200}
encryptionKey (Optional)
AES-256-CBC encryption key for cache files. Use for sensitive designs.
{"encryptionKey": "${FIGMA_CACHE_ENCRYPTION_KEY}"}
MCP Tools Reference
1. figma_prepare_file
Purpose: Prepare and validate Figma file cache before fetching data. This tool should ALWAYS be called before get_figma_data.
Parameters:
{
figmaUrl: string;
forceRefresh?: boolean;
}
Usage Pattern:
await figma_prepare_file({
figmaUrl: "https://www.figma.com/design/QlQwKAl9abcdhvlfvpM5K/Design?node-id=2777-9428"
});
await get_figma_data({
fileKey: "QlQwKAl9abcdhvlfvpM5K",
nodeId: "2777-9428"
});
Force Refresh Example:
await figma_prepare_file({
figmaUrl: "https://www.figma.com/design/QlQwKAl9abcdhvlfvpM5K/Design",
forceRefresh: true
});
Return Values:
- Cache exists & valid → "File is ready, cache is fresh"
- Cache expired or missing → Fetches from API, caches, returns "File prepared and cached"
- Force refresh → Always fetches from API, updates cache
- NodeId not found → Re-fetches and validates
2. get_figma_data
Purpose: Retrieve Figma design data with layout, styles, components, and content.
Parameters:
{
fileKey: string;
nodeId?: string;
depth?: number;
}
Usage Examples:
const result = await get_figma_data({
fileKey: "QlQwKAl9abcdhvlfvpM5K"
});
const result = await get_figma_data({
fileKey: "QlQwKAl9abcdhvlfvpM5K",
nodeId: "2777-9428"
});
const result = await get_figma_data({
fileKey: "QlQwKAl9abcdhvlfvpM5K",
nodeId: "2777-9428",
depth: 3
});
Return Structure:
{
metadata: {
name: string;
lastModified: string;
version: string;
};
nodes: {
};
globalVars: {
};
components: {
};
componentSets: {
};
}
3. download_figma_images
Purpose: Download SVG and PNG images from Figma nodes.
Parameters:
{
fileKey: string;
nodes: Array<{
nodeId: string;
fileName: string;
imageRef?: string;
needsCropping?: boolean;
cropTransform?: number[];
requiresImageDimensions?: boolean;
}>;
localPath?: string;
pngScale?: number;
}
Usage Examples:
const result = await download_figma_images({
fileKey: "QlQwKAl9abcdhvlfvpM5K",
nodes: [
{
nodeId: "2777-9428",
fileName: "hero-image.png"
},
{
nodeId: "2777-9430",
fileName: "icon-star.svg"
}
],
pngScale: 2
});
const result = await download_figma_images({
fileKey: "QlQwKAl9abcdhvlfvpM5K",
nodes: [
{
nodeId: "2777-9428",
fileName: "hero.png",
requiresImageDimensions: true
}
],
localPath: "/Users/dev/project/assets",
pngScale: 3
});
const result = await download_figma_images({
fileKey: "QlQwKAl9abcdhvlfvpM5K",
nodes: [
{
nodeId: "2777-9428",
fileName: "cropped-image.png",
imageRef: "abc123ref",
needsCropping: true,
cropTransform: [1, 0, 0, 1, 0, 0]
}
]
});
Return Structure:
{
downloadedCount: number;
savedTo: string;
images: Array<{
fileName: string;
width?: number;
height?: number;
cropped?: boolean;
}>;
}
4. list_cache (Bonus Tool)
View current cache status and statistics.
await list_cache();
5. cleanup_cache (Bonus Tool)
Manually clean up expired and corrupted cache files.
await cleanup_cache();
Common Workflows
Workflow 1: First-Time Design Fetch
const url = "https://www.figma.com/design/QlQwKAl9abcdhvlfvpM5K/MyDesign?node-id=2777-9428";
await figma_prepare_file({ figmaUrl: url });
const data = await get_figma_data({
fileKey: "QlQwKAl9abcdhvlfvpM5K",
nodeId: "2777-9428"
});
Workflow 2: Cached Design Fetch (10x+ faster)
const url = "https://www.figma.com/design/QlQwKAl9abcdhvlfvpM5K/MyDesign?node-id=2777-9428";
await figma_prepare_file({ figmaUrl: url });
const data = await get_figma_data({
fileKey: "QlQwKAl9abcdhvlfvpM5K",
nodeId: "2777-9428"
});
Workflow 3: Force Refresh After Design Update
const url = "https://www.figma.com/design/QlQwKAl9abcdhvlfvpM5K/MyDesign";
await figma_prepare_file({
figmaUrl: url,
forceRefresh: true
});
const data = await get_figma_data({
fileKey: "QlQwKAl9abcdhvlfvpM5K"
});
Workflow 4: Download Design Assets
const fileKey = "QlQwKAl9abcdhvlfvpM5K";
const data = await get_figma_data({ fileKey });
const nodes = [
{ nodeId: "2777-9428", fileName: "hero.png" },
{ nodeId: "2777-9430", fileName: "icon-home.svg" },
{ nodeId: "2777-9431", fileName: "icon-settings.svg" }
];
const result = await download_figma_images({
fileKey,
nodes,
pngScale: 2
});
Cache Behavior Deep Dive
How Caching Works
- First Request: API fetch → Cache write → Return data
- Subsequent Requests (within TTL): Cache read → Return data (no API call)
- After TTL Expires: API fetch → Cache update → Return data
Cache Invalidation Strategies
await figma_prepare_file({
figmaUrl: url,
forceRefresh: true
});
await cleanup_cache();
Multi-Layer Caching
Request Flow:
1. Check LRU memory cache (maxMemoryCacheSize entries)
↓ miss
2. Check disk cache (encrypted if encryptionKey set)
↓ miss
3. Fetch from Figma API
↓
4. Write to disk cache
↓
5. Add to memory cache
↓
6. Return data
Troubleshooting
Issue: Cache not reducing API calls
Check:
"--figma-caching={\"ttl\":{\"value\":7,\"unit\":\"d\"}}"
await list_cache();
Issue: "File not prepared" error
Solution: Always call figma_prepare_file before get_figma_data:
await figma_prepare_file({ figmaUrl });
await get_figma_data({ fileKey, nodeId });
await get_figma_data({ fileKey, nodeId });
Issue: Getting stale design data
Solution: Use force refresh when design updates frequently:
await figma_prepare_file({
figmaUrl,
forceRefresh: true
});
"--figma-caching={\"ttl\":{\"value\":1,\"unit\":\"h\"}}"
Issue: Encrypted cache can't be read
Check:
echo $FIGMA_CACHE_ENCRYPTION_KEY
await cleanup_cache();
Issue: Rate limit still hit
Possible causes:
- Cache TTL too short for request frequency
- Using
forceRefresh: true too often
- Multiple MCP clients/servers with separate caches
Solution:
"--figma-caching={\"ttl\":{\"value\":30,\"unit\":\"d\"}}"
"--figma-caching={\"cacheDir\":\"/shared/figma-cache\"}"
Issue: Large cache consuming disk space
Monitor:
await list_cache();
"--figma-caching={\"autoCleanup\":true,\"cleanupInterval\":{\"value\":6,\"unit\":\"h\"}}"
await cleanup_cache();
Environment Variables
export FIGMA_API_KEY=figd_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export FIGMA_CACHE_ENCRYPTION_KEY=your-secret-key-min-16-chars
export FIGMA_CACHE_TTL_VALUE=7
export FIGMA_CACHE_TTL_UNIT=d
export FIGMA_CACHE_DIR=~/my-figma-cache
Best Practices
- Use high TTL for finalized designs (30 days)
- Use low TTL for active development (1-2 hours)
- Enable encryption for sensitive/proprietary designs
- Always call figma_prepare_file first - let the LLM handle this automatically
- Use forceRefresh when user says "latest", "updated", "refresh"
- Monitor cache size with
list_cache tool
- Set reasonable maxMemoryCacheSize based on available RAM (100-200 entries typical)
- Use auto cleanup to prevent cache bloat
When to Use This vs. Standard Figma MCP
Use figma-mcp-cached when:
- Free Figma account (rate limits)
- High-frequency context requests
- Stable/finalized designs
- Need faster response times
- Working with large design files
Use standard Figma MCP when:
- Designs change constantly (hourly)
- Real-time design collaboration
- No rate limit concerns (Pro account + low usage)