Figma Context Cache MCP
An MCP server that provides cached, refreshable, and structured Figma context for AI coding assistants, reducing API calls and latency by storing node responses locally.
README
π¨ Figma Context Cache MCP
π§π· Leia em portuguΓͺs: README.pt-BR.md
Persistent design context for AI coding agents.
Build once. Cache locally. Reuse everywhere.
An MCP (Model Context Protocol) server that provides cached, refreshable and structured Figma context for AI coding assistants such as Codex, Claude Code, and other MCP-compatible clients.
Instead of querying the Figma API on every request, this server stores node responses locally and exposes tools to retrieve, inspect, synchronize and manage cached design context.
Why?
AI coding assistants frequently need information from Figma while implementing or maintaining frontend applications.
Without a cache layer, every request:
- calls the Figma API
- consumes rate limits
- increases latency
- downloads the same information repeatedly
This project introduces a persistent cache with explicit synchronization capabilities, making Figma context:
- β‘ Faster
- β»οΈ Reusable
- π¦ Persistent
- π€ AI-friendly
Architecture
AI Agent
(Codex / Claude Code)
β
βΌ
MCP Server
β
βββββββββββββ΄ββββββββββββ
β β
βΌ βΌ
Local JSON Cache Figma REST API
β
βΌ
Persistent Design Context
Features
- β Persistent local cache
- β Configurable cache TTL
- β Explicit cache synchronization
- β Cache inspection
- β Selective cache clearing
- β Strongly typed
- β Automated tests with Vitest
- β MCP compatible
MCP Tools
| Tool | Description |
|---|---|
health_check |
Verifies that the MCP server is running |
get_figma_node |
Retrieves a node from cache or directly from Figma |
sync_figma_node |
Forces a fresh request to Figma and updates the cache |
list_cached_figma_nodes |
Lists cached nodes and their current status |
clear_figma_cache |
Removes cache entries selectively |
Cache Lifecycle
get_figma_node
β
βΌ
Cache Hit?
β
βββ Yes ββββββββββββββββΊ Return cached node
β
βββ No
β
βΌ
Query Figma API
β
βΌ
Store locally
β
βΌ
Return response
sync_figma_node
β
βΌ
Always query Figma
β
βΌ
Update cache
β
βΌ
Return fresh response
Example
Synchronize a node:
Use sync_figma_node with:
fileKey: wdva3WcsFmz54Sg5e6OWJl
nodeId: 4510-5941
depth: 1
Example response:
{
"message": "Node synchronized successfully.",
"metadata": {
"source": "figma",
"cacheUpdated": true
}
}
Subsequent requests:
Use get_figma_node...
Response:
{
"metadata": {
"source": "cache"
}
}
Project Structure
src/
βββ cache/
βββ figma/
βββ server/
βββ tools/
βββ sync/
tests/
βββ cache/
βββ figma/
Testing
This project uses Vitest.
Current test coverage:
| Component | Coverage |
|---|---|
| CacheService | 90%+ |
| FigmaContextService | 100% |
| FigmaClient | In progress |
Run the test suite:
npm test
Generate coverage:
npm run test:coverage
Installation
git clone https://github.com/AysllaGomes/figma-context-cache-mcp.git
cd figma-context-cache-mcp
npm install
Configure your environment:
FIGMA_API_KEY=your-token
CACHE_TTL_SECONDS=3600
STORAGE_PATH=./storage
Start the server:
npm run dev
Roadmap
- [x] Persistent cache
- [x] Cache inspection
- [x] Cache synchronization
- [x] Automated unit tests
- [ ] Structured node metadata
- [ ] Component relationship graph
- [ ] Storybook integration
- [ ] Angular component mapping
- [ ] Design token indexing
- [ ] Semantic search
Vision
This project started as a cache for the Figma API.
Its long-term goal is to evolve into a Frontend Context Engine, capable of providing AI coding agents with rich, structured knowledge about design systems, frontend components and software architecture.
Instead of simply retrieving JSON from Figma, the server aims to understand relationships between components, design tokens, Storybook stories and frontend implementations, enabling AI agents to make better architectural and implementation decisions.
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.