
mcp_godot
为Godot引擎实现的Model Context Protocol (MCP) 集成,支持AI助手与Godot编辑器交互。
Repository Info
About This Server
为Godot引擎实现的Model Context Protocol (MCP) 集成,支持AI助手与Godot编辑器交互。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Godot
MCP Godot 是一个为 Godot 游戏引擎实现的 Model Context Protocol (MCP) 集成。它允许 AI 助手(如 Claude、Windsurf 和 Cursor)与 Godot 编辑器交互,执行各种操作。该实现是最小化、稳定和可靠的,支持完整的游戏开发工作流程。
功能
MCP Godot 提供以下核心功能:
场景操作
create_scene: 创建新场景(支持 2D 和 3D 模板)open_scene: 打开现有场景save_scene: 保存当前场景close_scene: 关闭当前场景
节点操作
add_node: 向场景中添加新节点remove_node: 从场景中移除节点select_node: 在场景树中选择节点duplicate_node: 复制现有节点
属性操作
set_property: 设置节点的属性值get_property: 获取节点的属性值
脚本操作
create_script: 创建新脚本attach_script: 将脚本附加到节点edit_script: 编辑现有脚本
通知操作
notify: 在 Godot 编辑器中显示通知消息
要求
- Godot 4.4 或更高版本
- Node.js 18 或更高版本
- npm 9 或更高版本
安装
步骤 1: 安装 Godot 插件
- 将
godot_plugin目录复制到您的 Godot 项目的addons目录中,并将其重命名为mcp_godot - 在 Godot 编辑器中,转到
项目 > 项目设置 > 插件 - 找到 "MCP Godot" 插件并启用它
步骤 2: 安装 Node.js MCP 服务器
- 确保已安装 Node.js 和 npm
- 进入
server目录 - 运行
npm install安装依赖 - 运行
npm run build构建服务器
使用方法
启动 MCP 服务器
- 确保 Godot 编辑器已打开并且 MCP Godot 插件已启用
- 在
server目录中运行npm start启动 MCP 服务器
配置 AI 助手
根据您使用的 AI 助手(如 Windsurf、Cursor 等),按照相应的说明配置 MCP 服务器连接。
故障排除
WebSocket 连接问题
- 确保 Godot 编辑器已打开并且 MCP Godot 插件已启用
- 确认端口 8090 未被其他应用程序占用
- 检查防火墙设置是否允许本地 WebSocket 连接
命令执行失败
- 确保您正在尝试执行的命令在当前 Godot 上下文中可用
- 检查节点路径是否正确(区分大小写)
开发
扩展工具
要添加新工具,请在 server/src/tools 目录中创建新文件,并在 server/src/index.ts 中注册它。
扩展资源
要添加新资源,请在 server/src/resources 目录中创建新文件,并在 server/src/index.ts 中注册它。
许可证
MIT
Quick Start
Clone the repository
git clone https://github.com/thughy/mcp_godotInstall dependencies
cd mcp_godot
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.