Talk to Figma MCP
光标与 Figma MCP 对话
该项目实现了 Cursor AI 和 Figma 之间的模型上下文协议 (MCP) 集成,允许 Cursor 与 Figma 通信以读取设计并以编程方式修改它们。
https://github.com/user-attachments/assets/129a14d2-ed73-470f-9a4c-2240b2a4885c
项目结构
src/talk_to_figma_mcp/- 用于 Figma 集成的 TypeScript MCP 服务器src/cursor_mcp_plugin/- 用于与 Cursor 通信的 Figma 插件src/socket.ts- WebSocket 服务器,用于促进 MCP 服务器和 Figma 插件之间的通信
Related MCP server: Talk to Figma MCP
开始
如果尚未安装 Bun,请安装:
curl -fsSL https://bun.sh/install | bash运行安装程序,这也会将 MCP 安装在 Cursor 的活动项目中
bun setup启动 Websocket 服务器
bun start安装Figma 插件
手动设置和安装
MCP 服务器:与 Cursor 集成
将服务器添加到~/.cursor/mcp.json中的 Cursor MCP 配置中:
{
"mcpServers": {
"TalkToFigma": {
"command": "bun",
"args": [
"/path/to/cursor-talk-to-figma-mcp/src/talk_to_figma_mcp/server.ts"
]
}
}
}WebSocket 服务器
启动 WebSocket 服务器:
bun run src/socket.tsFigma 插件
在 Figma 中,转到“插件”>“开发”>“新插件”
选择“链接现有插件”
选择
src/cursor_mcp_plugin/manifest.json文件该插件现在应该可以在你的 Figma 开发插件中使用
用法
启动 WebSocket 服务器
在 Cursor 中安装 MCP 服务器
打开 Figma 并运行 Cursor MCP 插件
使用
join_channel加入频道,将插件连接到 WebSocket 服务器使用 Cursor 通过 MCP 工具与 Figma 进行通信
MCP 工具
MCP 服务器提供了以下与 Figma 交互的工具:
文档与选择
get_document_info- 获取有关当前 Figma 文档的信息get_selection- 获取有关当前选择的信息get_node_info- 获取特定节点的详细信息
创建元素
create_rectangle- 创建具有位置、大小和可选名称的新矩形create_frame- 创建具有位置、大小和可选名称的新框架create_text- 创建具有可自定义字体属性的新文本节点
造型
set_fill_color- 设置节点的填充颜色(RGBA)set_stroke_color- 设置节点的描边颜色和粗细set_corner_radius- 使用可选的每个角控制设置节点的角半径
布局和组织
move_node将节点移动到新位置resize_node- 使用新尺寸调整节点大小delete_node删除节点
组件和样式
get_styles- 获取有关本地样式的信息get_local_components- 获取有关本地组件的信息get_team_components- 获取有关团队组件的信息create_component_instance- 创建组件的实例
导出和高级
export_node_as_image- 将节点导出为图像(PNG、JPG、SVG 或 PDF)execute_figma_code- 在 Figma 中执行任意 JavaScript 代码(谨慎使用)
连接管理
join_channel- 加入特定频道与 Figma 进行通信
发展
构建 Figma 插件
导航到 Figma 插件目录:
cd src/cursor_mcp_plugin编辑 code.js 和 ui.html
最佳实践
使用 Figma MCP 时:
发送命令前务必加入频道
首先使用
get_document_info获取文档概述修改之前使用
get_selection检查当前选择根据需要使用合适的创作工具:
为容器
create_framecreate_rectangle用于基本形状为文本元素
create_text
使用
get_node_info验证更改尽可能使用组件实例以保持一致性
适当处理错误,因为所有命令都可能引发异常
执照
麻省理工学院
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
- AlicenseBqualityNot gradedmaintenanceEnables Cursor AI to communicate with Figma for reading designs and modifying them programmatically, allowing users to automate design tasks through natural language.388821
- AlicenseBqualityDmaintenanceAllows Cursor AI to communicate with Figma for reading designs and modifying them programmatically through a Model Context Protocol integration.388821MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants like Cursor to interact with Figma designs programmatically. Supports reading design information, modifying elements, creating components, managing text content, and automating design workflows through natural language commands.882MIT
- AlicenseNot gradedqualityDmaintenanceEnables coding agents like Cursor to access Figma design data, fetch layout and styling information, and implement designs in any framework.57,771MIT
Related MCP Connectors
The Figma MCP server brings Figma design context directly into your AI workflow.
Connect AI coding agents to Anima Playground, Figma, and your design system.
Let Claude, Cursor, or ChatGPT author Mermaid diagrams your team can read and share.
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/yhc984/cursor-talk-to-figma-mcp-main'
If you have feedback or need assistance with the MCP directory API, please join our Discord server