TF

timholden/figma-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

149 stars 16 forks 质量 57 趋势 16

timholden/figma-mcp-server 是从 https://github.com/timholden/figma-mcp-server. 导入的 MCP 服务器候选

概览

timholden/figma-mcp-server 是从 https://github.com/timholden/figma-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

一台模型上下文协议(MCP)服务器,通过 Claude 及其他兼容 MCP 客户端与 Figma API 集成。目前支持只读访问 Figma 文件和项目,服务器端架构支持更高级的设计令牌和主题管理功能(待 Figma API 增强或插件开发)。

项目状态

当前进展

  • ✅ 核心实现:成功构建了遵循模型上下文协议(MCP)的TypeScript服务器
  • ✅ Claude 桌面集成:已通过 Claude Desktop 测试并运行良好
  • ✅ 读取操作:用于Figma文件访问的get-file和list-files工具
  • ✅ 服务器架构:缓存系统、错误处理和统计监控实现
  • ✅ 传输协议:支持stdio和SSE传输机制

潜在的全功能

服务器已设计出支持以下功能的代码(目前受限于 API 限制):

  • 变量管理:创建、读取、更新和删除设计令牌(变量)
  • 引用处理:创建并验证令牌之间的关系

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Figma MCP Server

A Model Context Protocol (MCP) server that provides integration with Figma’s API through Claude and other MCP-compatible clients. Currently supports read-only access to Figma files and projects, with server-side architecture capable of supporting more advanced design token and theme management features (pending Figma API enhancements or plugin development).

Project Status

Current Progress

  • ✅ Core Implementation: Successfully built a TypeScript server following the Model Context Protocol (MCP)
  • ✅ Claude Desktop Integration: Tested and functional with Claude Desktop
  • ✅ Read Operations: Working get-file and list-files tools for Figma file access
  • ✅ Server Architecture: Caching system, error handling, and stats monitoring implemented
  • ✅ Transport Protocols: Both stdio and SSE transport mechanisms supported

Potential Full Functionality

The server has been designed with code to support these features (currently limited by API restrictions):

  • Variable Management: Create, read, update, and delete design tokens (variables)
  • Reference Handling: Create and validate relationships between tokens
  • Theme Management: Create themes with multiple modes (e.g., light/dark)
  • Dependency Analysis: Detect and prevent circular references
  • Batch Operations: Perform bulk actions on variables and themes

With Figma plugin development or expanded API access, these features could be fully enabled.

Features

  • 🔑 Secure authentication with Figma API
  • 📁 File operations (read, list)
  • 🎨 Design system management
    • Variable creation and management
    • Theme creation and configuration
    • Reference handling and validation
  • 🚀 Performance optimized
    • LRU caching
    • Rate limit handling
    • Connection pooling
  • 📊 Comprehensive monitoring
    • Health checks
    • Usage statistics
    • Error tracking

Prerequisites

  • Node.js 18.x or higher
  • Figma access token with appropriate permissions
  • Basic understanding of MCP (Model Context Protocol)

Installation

npm install figma-mcp-server

Configuration

  1. Create a .env file based on .env.example:
# Figma API Access Token
FIGMA_ACCESS_TOKEN=your_figma_token

# Server Configuration
MCP_SERVER_PORT=3000

# Debug Configuration
DEBUG=figma-mcp:*
  1. For Claude Desktop integration:

The server can be configured in your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "figma": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/figma-mcp-server/dist/index.js"],
      "env": {
        "FIGMA_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Important Notes:

  • Use ABSOLUTE paths, not relative paths
  • On Windows, use double backslashes (\\) in paths
  • Restart Claude Desktop after making configuration changes

Usage

Basic Usage

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "figma": { "command": "node", "args": ["/ABSOLUTE/PATH/TO/figma-mcp-server/dist/index.js"], "env": { "FIGMA_ACCESS_TOKEN": "your_token_here" } } } }