figma-mcp-dsh
Read-only Figma design-source tools for DeepSeek Harness: inspect file structure, colors, typography and export images as native tools. 适合需要让AI代理检索Figma文件结构、颜色及导出图片的用户。
Install
This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗
README
Read the full README ↗安装与配置
以下步骤将插件安装到 DSH 的 web profile,并配置访问 Figma 所需的令牌。
1. 从 GitHub 安装插件
在 DSH profile 目录中安装插件:
cd ~/.dsh/profiles/web
pnpm add github:N107meow/figma-mcp-dsh
如果你正在本地开发插件,请改用 link: 安装:
cd ~/.dsh/profiles/web
pnpm add link:/absolute/path/to/figma-mcp-dsh
本地开发还需要在插件仓库中安装与当前 DSH 版本一致的宿主依赖。运行 npm run check:deps 可以检查版本是否匹配。
2. 挂载插件
在 ~/.dsh/profiles/web/cordis.patch.yml 中追加:
- insert:
- id: figma
name: figma-mcp-dsh
cordis.patch.yml 支持热加载。首次安装或更新依赖后,请重启 DSH。
3. 配置 Figma 令牌
在 ~/.dsh/.credentials.yaml 中保存令牌:
refs:
FIGMA_TOKEN: your_figma_token_here
你也可以通过环境变量 FIGMA_TOKEN 提供令牌。插件会在每次调用时重新读取凭据,因此更换令牌后不需要重启 DSH。
有关令牌创建、权限选择和轮换方式,请阅读 Figma 令牌配置指南。
3. 配置 Figma 令牌
在 ~/.dsh/.credentials.yaml 中保存令牌:
refs:
FIGMA_TOKEN: your_figma_token_here
你也可以通过环境变量 FIGMA_TOKEN 提供令牌。插件会在每次调用时重新读取凭据,因此更换令牌后不需要重启 DSH。
有关令牌创建、权限选择和轮换方式,请阅读 Figma 令牌配置指南。
使用示例
安装完成后,在 DSH 对话中粘贴 Figma 文件或节点链接,并直接描述你想了解的内容。例如:
分析这个 Figma Frame 的布局、主要颜色和字体层级:
https://www.figma.com/design/your_file_key/project?node-id=12-345
模型会根据任务选择合适的读取能力。你也可以明确要求模型执行以下操作:
读取这个文件中定义的组件和变体。
把 node 101:202 渲染成图片并分析视觉层级。
列出这个设计文件中的颜色样式和文字样式。
插件在模型侧注册两个工具:
| 工具 | 用途 |
|---|---|
figma_capabilities | 查看可用能力;传入 detail="full" 可获取完整参数说明 |
figma_call | 执行具体读取操作;使用 op 选择能力,使用 target 传入 Figma 链接 |
工具调用示例:
figma_call({
op: "file_nodes",
target: "https://www.figma.com/design/your_file_key/project?node-id=12-345",
})