Godot MCP 是一款强大的插件,它基于 Model Context Protocol (MCP),实现了 Godot 引擎与 AI 助手的全面集成。借助该插件,AI 助手能够无缝与您的 Godot 项目交互,为您提供代码辅助、场景操作和项目管理等一系列强大功能。
git clone https://github.com/ee0pdt/godot-mcp.git
cd godot-mcp
cd server
npm install
npm run build
# 返回项目根目录
cd ..
# 对于 macOS
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
claude_desktop_config.json 作为示例):{
"mcpServers": {
"godot-mcp": {
"command": "node",
"args": [
"PATH_TO_YOUR_PROJECT/server/dist/index.js"
],
"env": {
"MCP_TRANSPORT": "stdio"
}
}
}
}
⚠️ 重要提示
将
PATH_TO_YOUR_PROJECT替换为您存储此仓库的实际路径。
project.godot 文件。Project > Project Settings > Plugins 并启用 "Godot MCP"。# 在终端中运行以下命令以导出为 HTML5
export_project ../export/html5/
*.gd*.tscn*.png, *.jpgscene/create:创建新场景scene/open:打开现有场景scene/save:保存当前场景node/add:添加节点到场景node/remove:删除指定节点node/edit:修改节点属性addons/godot_mcp 文件夹复制到您的 Godot 项目的 addons 目录。Project > Project Settings > Plugins 并启用 "Godot MCP"。本项目采用 MIT License 许可证,具体内容请参阅 LICENSE 文件。
欢迎贡献!请随意提交 Pull Request。
有关详细信息,请查阅 docs 文件夹中的文档: