Figma MCP Server

平台与服务

by oabolade

一款 MCP server,让 AI 助手通过自然语言命令与 Figma 设计稿进行交互。

什么是 Figma MCP Server

一款 MCP server,让 AI 助手通过自然语言命令与 Figma 设计稿进行交互。

README

Figma MCP Server (Apify Actor)

Model Context Protocol (MCP) server that exposes Figma REST API capabilities to AI assistants (Cursor, Claude, custom agents). Runs as a long-running web server on the Apify platform (standby / container URL) or locally via apify run.

Features

  • File analysis — structure, metadata, styles, depth-limited trees
  • Components — list, details, usage
  • Assets — export nodes (PNG, SVG, PDF, JPG)
  • Comments — read and create
  • Projects / teams — listings and metadata
  • MCP resources & prompts for guided workflows

Authentication

Personal Access Token (default)

Recommended for solo use. Set figmaAccessToken in Actor input (or FIGMA_ACCESS_TOKEN in env).

OAuth 2.0 (optional — team / shared files)

Use when you omit figmaAccessToken and provide a Figma OAuth app:

InputPurpose
oauthClientIdFrom Figma → Developers → Apps
oauthClientSecretSame app
oauthRedirectUriExact redirect URL registered on the app, e.g. https://<your-run>.runs.apify.net/oauth/callback
oauthScopesOptional; comma-separated scopes. Must be a subset of the app’s configured scopes. Defaults include file_content:read, file_content:write, file_comments:read, file_comments:write.

Flow

  1. Start the Actor with OAuth fields filled and no PAT.
  2. Open GET https://<container-url>/oauth/authorize in a browser (normal browser — not an embedded WebView; Figma requirement).
  3. After consent, Figma redirects to /oauth/callback; tokens are stored in the run’s default key-value store (FIGMA_OAUTH_SESSION) and refreshed when near expiry.

Token exchange uses Figma’s documented endpoints (https://api.figma.com/v1/oauth/token and .../oauth/refresh). Codes expire quickly — complete the redirect promptly.

Requirements

  • Node.js ≥ 20
  • Apify account (for cloud)
  • Figma PAT and/or OAuth app

Quick start (Apify Cloud)

bash
npm install
apify login
apify push

In Apify Console, open the Actor, set input (at minimum figmaAccessToken), start with web server / long-running as required by your template, then use the Container URL from the run.

Deploy reference: apify push builds and publishes; see Apify CLI.

Configuration (input)

ParameterTypeDefaultDescription
figmaAccessTokenstringPAT (recommended). If set, used for all Figma API calls.
portinteger8080HTTP listen port (Apify may override via web_server_port).
oauthClientIdstringOAuth app client ID (only if not using PAT).
oauthClientSecretstringOAuth app secret (secret input).
oauthRedirectUristringMust match Figma app redirect URI exactly.
oauthScopesstringOptional scope override (comma-separated).
maxConcurrentRequestsinteger10Reserved / future use.
enableCachingbooleantrueCache GET responses from Figma.

Local / CLI input file example (apify run):

json
{
  "figmaAccessToken": "figd_...",
  "port": 8080
}

HTTP API

MethodPathDescription
GET/Service info and endpoint list
GET/healthLiveness; includes auth_mode: pat | oauth | pending_oauth, figma_authenticated
POST/mcpMCP JSON-RPC 2.0 (primary transport for this server)
GET/oauth/authorizeStart OAuth (browser); disabled if PAT is set
GET/oauth/callbackOAuth redirect handler

Apify MCP path: .actor/actor.json sets webServerMcpPath to /mcp. Your MCP client URL is typically:

https://<container-id>.runs.apify.net/mcp

(Use the Container URL from the run page + /mcp.)

Cursor IDE

  1. Deploy and start the Actor; copy the run Container URL (while status is RUNNING).
  2. Edit ~/.cursor/mcp.json (paths differ on Windows/Linux — see Cursor docs).

Example (remote HTTP MCP — adjust to your Cursor version’s expected shape):

json
{
  "mcpServers": {
    "figma-mcp-standby": {
      "url": "https://YOUR_RUN_ID.runs.apify.net/mcp"
    }
  }
}

Notes

  • env.APIFY_TOKEN in mcp.json is not passed to this Node process; it does not replace Figma auth. Use figmaAccessToken (or OAuth) in Actor input.
  • Container URLs are per run and stop working when the run ends; update mcp.json and restart Cursor after a new run.
  • If connection fails, use Cursor → Output → MCP and curl https://.../health.

Claude Desktop / other clients

Use your client’s supported way to attach a remote MCP URL (e.g. mcp-remote pointing at https://.../mcp). Paths and query params depend on the client version.

Local development

bash
npm install
apify run

Or run the entry with Node if you inject env / input yourself:

bash
export FIGMA_ACCESS_TOKEN="figd_..."
node src/main.js

Check health (port from logs or input):

bash
curl -s http://localhost:8080/health | jq .

Sample MCP initialize:

bash
curl -s -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'

Project structure

code
figma_mcp_actor/
├── .actor/
│   ├── actor.json           # Apify Actor metadata (incl. webServerMcpPath: /mcp)
│   ├── input_schema.json
│   ├── output_schema.json
│   └── dataset_schema.json
├── src/
│   ├── main.js              # Express app, /mcp, /oauth/*, Apify bootstrap
│   ├── figma/
│   │   ├── auth.js          # PAT + OAuth token exchange, refresh, KV hook
│   │   └── client.js        # Figma REST wrapper
│   ├── oauth/
│   │   └── persist.js       # Apify KV: FIGMA_OAUTH_SESSION
│   ├── mcp/                 # Protocol, handlers, server
│   ├── tools/
│   ├── resources/
│   └── prompts/
├── Dockerfile
├── package.json
└── README.md

MCP tools (overview)

Includes (names may vary slightly in code): file analysis (analyze_file, get_file_structure, …), components (list_components, …), export (export_node, …), comments (get_comments, create_comment, …), design modification helpers, plus resources (figma://file/..., etc.) and prompts for common tasks.

Limitations

  • REST vs Plugin API — deep design writes may need the Plugin API; this Actor uses REST where supported.
  • Ephemeral Apify URLs — each run has a new base URL unless you use a stable hosting pattern.
  • OAuth — single stored session per run (KV); not multi-user concurrent OAuth in one process.

Scripts

bash
npm run lint
npm run lint:fix
npm run format

License

ISC

Changelog

0.2

  • Optional OAuth 2.0 (Figma authorization code + refresh); PAT remains default when set.
  • /oauth/authorize and /oauth/callback; session persisted in default KV (FIGMA_OAUTH_SESSION).
  • Input: oauthRedirectUri, oauthScopes.
  • Health JSON: auth_mode, figma_authenticated.

0.1 / 0.0.1

  • Initial MCP + Figma REST integration, PAT, long-running server, /mcp JSON-RPC.

References: Apify Actors · Figma REST API · Model Context Protocol

常见问题

Figma MCP Server 是什么?

一款 MCP server,让 AI 助手通过自然语言命令与 Figma 设计稿进行交互。

相关 Skills

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描165.3k

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描165.3k

接口测试套件

by alirezarezvani

Universal
热门

扫描 Next.js、Express、FastAPI、Django REST 的 API 路由,自动生成覆盖鉴权、参数校验、错误码、分页、上传与限流场景的 Vitest 或 Pytest 测试套件。

帮你把API与集成测试自动化跑顺,减少回归漏测;能力全面,尤其适合复杂接口场景的QA团队。

平台与服务
未扫描23.5k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
89.1k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
79.9k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
71.9k

评论