custom-figma-mcp
Provides read-only access to Figma files via the Figma REST API, enabling AI agents to retrieve file and node hierarchies, inspect detailed node properties such as auto-layout, fills, strokes, and typography, and render specific nodes as PNG images.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@custom-figma-mcpGet the page hierarchy for Figma file ABC123, then details for node 104:15."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
A lightweight local MCP (Model Context Protocol) server that gives AI coding agents (like OpenCode) structured, read-only access to Figma files — file hierarchies, node properties, and rendered images — without needing Figma's hosted/remote MCP integration.
Figma's official remote MCP server is gated behind an allowlisted Client ID, which isn't practical for individual developers wiring up their own agent tooling. This project sidesteps that by talking directly to Figma's public REST API using a personal access token, exposed to the agent through a standard MCP tool interface over stdio.
How to let opencode know what figma page your working on
Open the figma page in your browser, copy the URL, give it to the opencode along with your prompt.
Related MCP server: figma-mcp
Why This Exists
Figma's official remote MCP server is gated behind an allowlisted Client ID, which isn't practical for individual developers wiring up their own agent tooling. This project sidesteps that by talking directly to Figma's public REST API using a personal access token, exposed to the agent through a standard MCP tool interface over stdio.
Architecture
OpenCode (MCP client)
│ stdio (JSON-RPC)
▼
custom-figma-mcp (this server)
│ HTTPS + X-Figma-Token
▼
Figma REST API (api.figma.com/v1)The server is a single Node.js process that:
Starts up and registers itself over
stdiousing@modelcontextprotocol/sdk.Advertises a fixed set of tools to the MCP client (OpenCode) via
ListToolsRequestSchema.Executes tool calls via
CallToolRequestSchema, proxying them to Figma's REST API with your personal access token attached as a header.Returns structured JSON (or image URLs) back to the calling agent.
Because it only ever uses GET requests with a read-scoped token, it cannot modify, comment on, or delete anything in Figma — it's strictly read-only by design.
Tools Exposed
get_figma_file_structure
Returns the page/frame hierarchy of a file, depth-limited to avoid dumping the entire node tree (which can be tens of thousands of nodes on large files).
Input:
{ "fileKey": "string", "depth": 2 }Maps to: GET /v1/files/:fileKey?depth=:depth
get_figma_node_details
Fetches full properties for specific node IDs — auto-layout config, padding/gap values, fills, strokes, typography, constraints, component properties, etc. This is the primary tool used for accurate code generation.
Input:
{ "fileKey": "string", "nodeIds": ["1:2", "104:15"] }Maps to: GET /v1/files/:fileKey/nodes?ids=1:2,104:15
get_figma_node_image
Renders a specific node as a PNG and returns a temporary signed URL, useful for visually cross-checking generated code against the design.
Input:
{ "fileKey": "string", "nodeId": "104:15", "scale": 2 }Maps to: GET /v1/images/:fileKey?ids=104:15&scale=2
Why Three Separate Tools (Instead of One)
Figma files can be enormous — a single GET /files/:key call with no depth limit can return megabytes of deeply nested JSON, which blows through an LLM's context window instantly. Splitting the interface into three targeted tools lets the agent:
First get a lightweight outline (
get_figma_file_structure) to identify relevant frames/nodes.Drill into only the specific nodes it needs (
get_figma_node_details).Optionally render an image only when visual confirmation is needed (
get_figma_node_image).
This mirrors how a human developer would inspect a design — skim first, then zoom in — rather than ingesting the entire file at once.
Authentication
Authentication uses a Figma Personal Access Token (PAT), scoped to file_content:read. The token is loaded from a local .env file (never hardcoded) and attached to every outbound request as the X-Figma-Token header. The token never leaves the local machine except in requests directly to api.figma.com.
Error Handling
All tool handlers are wrapped in try/catch. On failure (invalid file key, no access, rate limiting, etc.), the server returns an MCP-compliant error response:
{
"content": [{ "type": "text", "text": "Figma API Error: <details>" }],
"isError": true
}This lets the calling agent see the actual failure reason instead of crashing silently.
Project Structure
custom-figma-mcp/
├── index.js # server entrypoint — tool definitions + handlers
├── package.json # dependencies, "type": "module" for ESM imports
├── .env # local only — holds FIGMA_PAT, never committed
└── .gitignoreLocal Development
Run the server directly for debugging (it communicates over stdio, so you won't see typical HTTP server logs):
node index.jsIn practice, you don't run this manually — OpenCode spawns it as a subprocess based on the command defined in opencode.json.
Extending This Server
To add a new tool:
Add its schema to the
toolsarray returned byListToolsRequestSchema.Add a matching
if (name === "...")branch inside theCallToolRequestSchemahandler.Map it to the relevant Figma REST endpoint under
figmaApi(anaxiosinstance pre-configured with the base URL and auth header).
Keep new tools read-only and scoped — avoid dumping full unfiltered API responses where possible, to keep agent context usage low.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceLocal-first MCP server that connects AI coding agents to the currently open Figma file through a local plugin bridge, requiring no Figma API token.8MIT
- AlicenseNot gradedqualityCmaintenanceRead-only Figma MCP server that enables design-to-code workflows by talking to the Figma REST API with a personal access token, for use with Claude Code and GitHub Copilot.2,160MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI IDEs to query Figma design tokens, component specs, and audit issues via MCP tools, without cloud subscriptions.MIT
- AlicenseNot gradedqualityBmaintenanceLocal MCP server exposing Figma REST API tools to AI agents, enabling file reads, comments, variables, and other resource operations. Works with personal access tokens and integrates with Claude, Cursor, Codex, and more.MIT
Related MCP Connectors
The Figma MCP server brings Figma design context directly into your AI workflow.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ghoraavkc-bv/custom-figma-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server