Figma模型上下文协议服务器

为Figma集成提供模型上下文协议(MCP)服务的服务器,支持容器化部署和SSE端点。

  • by bbalakriz
  • Shell
  • 混合部署
  • 更新于
在 GitHub 查看 bbalakriz/figma-mcp-server

使用说明

figma mcp服务器

该项目使用 figma-developer-mcp 包裹。

先决条件

  • Node.js v20或更高版本
  • 一个Figma个人访问令牌(API密钥)

安装

安装依赖项:

npm install

运行服务器

选项1:使用Podman Compose

该项目包括对Apple Silicon(ARM64)和Linux(AMD64)架构使用红帽通用基础映像(UBI)的容器化支持。

先决条件

  • Podman已安装
  • 一个Figma个人访问令牌(API密钥)

步骤

  1. 创建一个 .env 项目根目录中的文件:

    FIGMA_API_KEY=your_figma_personal_access_token_here
    
  2. 启动服务:

    podman-compose up -d
    
  3. 停止服务:

    podman-compose down
    

选项2:直接使用Podman

建造集装箱

使用构建脚本
./build-container.sh
使用Podman构建
# For current architecture
podman build -t quay.io/balki404/figma-mcp-server:1.0 .

# For specific architecture
podman build --platform linux/amd64 -t fquay.io/balki404/figma-mcp-server:1.0-amd64 .
podman build --platform linux/arm64 -t quay.io/balki404/figma-mcp-server:1.0-arm64 .

运行容器

# Run with environment variable
podman run -e FIGMA_API_KEY=your_figma_api_key_here quay.io/balki404/figma-mcp-server:1.0-arm64

# Run in detached mode with port mapping
podman run -d --name figma-mcp -p 3333:3333 -e FIGMA_API_KEY=your_figma_api_key_here quay.io/balki404/figma-mcp-server:1.0-arm64

# Run with restart policy and port mapping
podman run -d --restart=unless-stopped --name figma-mcp -p 3333:3333 -e FIGMA_API_KEY=your_figma_api_key_here quay.io/balki404/figma-mcp-server:1.0-arm64

选项3:直接使用Node.js

您可以使用以下命令使用Figma API密钥直接启动服务器:

npx figma-developer-mcp --figma-api-key <YOUR_FIGMA_API_KEY>

替换 <YOUR_FIGMA_API_KEY> 使用您实际的Figma个人访问令牌。

特性

  • 基于环境的配置:通过环境变量轻松管理API密钥
  • SSE 终端:服务器发送的事件可在 http://localhost:3333/sse