Figma Context Cache MCP

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.

Category
Visit Server

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

MIT

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

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.

Official
Featured
Python
graphlit-mcp-server

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.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured