Skip to content
Back to search

godot-mcp

一款支持godot开源引擎的的mcp插件,支持常见godot引擎操作,一键配置服务。This is an MCP plugin that supports the Godot open-source engine, offering support for common Godot engine operations and one-click service configuration.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/daxianlee--godot-mcp/badge.svg)](/listings/daxianlee--godot-mcp)

HTML

<a href="/listings/daxianlee--godot-mcp"><img src="/api/listings/daxianlee--godot-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 377 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Godot MCP Server
  2. [English](./README_EN.md) | 中文
  3. 一个为 Godot 引擎设计的 Model Context Protocol (MCP) 服务器插件,让 AI 助手能够直接与 Godot 编辑器交互,实现 AI 驱动的游戏开发。
  4. ## 功能特性
  5. ### 核心功能
  6. - **场景管理** - 创建、打开、保存场景,查看场景树结构
  7. - **节点操作** - 添加、删除、移动节点,修改节点属性
  8. - **脚本编辑** - 创建、读取、修改 GDScript 脚本
  9. - **资源管理** - 加载、创建、修改游戏资源
  10. - **文件系统** - 浏览项目文件,读写文件内容
  11. - **编辑器控制** - 控制编辑器界面,管理选中对象、撤销重做
  12. - **调试工具** - 查看日志,获取运行时信息
  13. - **动画工具** - 创建和编辑动画,状态机管理
  14. ### 视觉效果
  15. - **材质工具** - 创建和配置材质
  16. - **着色器工具** - 管理着色器参数
  17. - **灯光工具** - 配置场景灯光
  18. - **粒子工具** - 创建粒子效果
  19. ### 2D 开发
  20. - **瓦片地图工具** - TileMap 编辑和配置
  21. - **几何体工具** - 2D 几何图形创建
  22. ### 游戏玩法
  23. - **物理工具** - 物理体和碰撞配置
  24. - **导航工具** - 导航网格和寻路
  25. - **音频工具** - 音频播放和配置
  26. ### 实用工具
  27. - **UI 工具** - 用户界面组件
  28. - **信号工具** - 信号连接管理
  29. - **分组工具** - 节点分组管理
  30. ### 多语言支持
  31. 插件界面支持 9 种语言,自动检测系统语言:
  32. - English (英语)
  33. - 简体中文
  34. - 繁體中文
  35. - 日本語 (日语)
  36. - Русский (俄语)
  37. - Français (法语)
  38. - Português (葡萄牙语)
  39. - Español (西班牙语)
  40. - Deutsch (德语)
  41. ## 支持的 AI 客户端
  42. ### IDE 编辑器(一键配置)
  43. - **Trae CN** - AI 编辑器中文版
  44. - **Cursor** - AI 代码编辑器
  45. - **Windsurf** - Codeium 的 AI 编辑器
  46. ### CLI 命令行工具(命令复制)
  47. - **Claude CLI** - Anthropic Claude 命令行工具
  48. - **Codex CLI** - OpenAI Codex 命令行工具
  49. - **Gemini CLI** - Google Gemini 命令行工具
  50. ## 系统要求
  51. - Godot Engine 4.x
  52. - 支持的操作系统:Windows、macOS、Linux
  53. ## 安装步骤
  54. 1. 下载或克隆本仓库:
  55. ```bash
  56. git clone https://github.com/DaxianLee/godot-mcp.git
  57. ```
  58. 2. 将 `addons/godot_mcp` 文件夹复制到你的 Godot 项目的 `addons` 目录下:
  59. ```
  60. your_project/
  61. ├── addons/
  62. │ └── godot_mcp/
  63. │ ├── plugin.cfg
  64. │ ├── plugin.gd
  65. │ ├── mcp_server.gd
  66. │ ├── i18n/
  67. │ └── tools/
  68. └── ...
  69. ```
  70. 3. 在 Godot 编辑器中,打开 `项目 -> 项目设置 -> 插件`
  71. 4. 找到 **Godot MCP Server** 并启用它
  72. ## 使用教程
  73. ### 1. 启动 MCP 服务器
  74. 插件启用后,你会在编辑器右侧看到 **GodotMCP** 面板:
  75. - **服务器** - 显示服务器运行状态、端点地址、作者信息
  76. - **工具** - 管理可用的 MCP 工具(按分类显示)
  77. - **配置** - IDE 一键配置和 CLI 命令复制
  78. 默认配置:
  79. - 端口:`3000`
  80. - 地址:`http://127.0.0.1:3000/mcp`
  81. - 自动启动:开启
  82. ### 2. 配置 AI 客户端
  83. #### IDE 编辑器 - 一键配置
  84. 在 GodotMCP 面板中切换到「配置」标签,可以看到支持的 IDE 客户端。
  85. ##### Trae CN
  86. 1. 点击 Trae CN 下的「一键配置」按钮
  87. 2. 重启 Trae CN
  88. 配置文件位置:
  89. - **macOS**: `~/Library/Application Support/Trae CN/User/mcp.json`
  90. - **Windows**: `%APPDATA%\Trae CN\User\mcp.json`
  91. - **Linux**: `~/.config/Trae CN/User/mcp.json`
  92. ##### Cursor
  93. 1. 点击 Cursor 下的「一键配置」按钮
  94. 2. 重启 Cursor
  95. 配置文件位置:`~/.cursor/mcp.json`
  96. ##### Windsurf
  97. 1. 点击 Windsurf 下的「一键配置」按钮
  98. 2. 重启 Windsurf
  99. 配置文件位置:`~/.codeium/windsurf/mcp_config.json`
  100. #### CLI 命令行工具 - 复制命令
  101. CLI 工具需要在终端中执行命令进行配置。在「配置」标签中:
  102. 1. 使用「配置范围」下拉框选择 scope:
  103. - **用户级** - 全局生效,所有项目都可使用
  104. - **项目级** - 仅当前项目生效
  105. 2. 复制对应工具的命令到终端执行
  106. ##### Claude CLI (Claude Code)
  107. ```bash
  108. claude mcp add --scope <user|project> --transport http godot-mcp http://127.0.0.1:3000/mcp
  109. ```
  110. ##### Codex CLI
  111. ```bash
  112. codex mcp add --scope <user|project> --transport http godot-mcp http://127.0.0.1:3000/mcp
  113. ```
  114. ##### Gemini CLI
  115. ```bash
  116. gemini mcp add --scope <user|project> --transport http godot-mcp http://127.0.0.1:3000/mcp
  117. ```
  118. ### 3. 开始使用
  119. 配置完成后,在 AI 客户端中你可以直接操作 Godot 项目:
  120. ```
  121. 用户:帮我创建一个新场景,添加一个 Sprite2D 节点
  122. AI:好的,我来为你创建场景...
  123. [调用 scene_create 创建场景]
  124. [调用 node_add 添加 Sprite2D 节点]
  125. 完成!已创建包含 Sprite2D 节点的新场景。
  126. ```
  127. ## 工具列表
  128. ### 核心工具
  129. #### 场景工具 (Scene)
  130. | 工具名 | 描述 |
  131. |--------|------|
  132. | `scene_create` | 创建新场景 |
  133. | `scene_open` | 打开指定场景 |
  134. | `scene_save` | 保存当前场景 |
  135. | `scene_get_tree` | 获取场景树结构 |
  136. | `scene_get_current` | 获取当前场景信息 |
  137. #### 节点工具 (Node)
  138. | 工具名 | 描述 |
  139. |--------|------|
  140. | `node_add` | 添加新节点 |
  141. | `node_delete` | 删除节点 |
  142. | `node_get` | 获取节点信息 |
  143. | `node_set_property` | 设置节点属性 |
  144. | `node_get_property` | 获取节点属性 |
  145. | `node_move` | 移动节点位置 |
  146. | `node_rename` | 重命名节点 |
  147. | `node_duplicate` | 复制节点 |
  148. | `node_find` | 查找节点 |
  149. #### 脚本工具 (Script)
  150. | 工具名 | 描述 |
  151. |--------|------|
  152. | `script_create` | 创建新脚本 |
  153. | `script_read` | 读取脚本内容 |
  154. | `script_write` | 写入脚本内容 |
  155. | `script_attach` | 附加脚本到节点 |
  156. #### 资源工具 (Resource)
  157. | 工具名 | 描述 |
  158. |--------|------|
  159. | `resource_load` | 加载资源 |
  160. | `resource_create` | 创建资源 |
  161. | `resource_save` | 保存资源 |
  162. #### 文件系统工具 (Filesystem)
  163. | 工具名 | 描述 |
  164. |--------|------|
  165. | `filesystem_list` | 列出目录内容 |
  166. | `filesystem_read` | 读取文件 |
  167. | `filesystem_write` | 写入文件 |
  168. | `filesystem_delete` | 删除文件 |
  169. #### 项目工具 (Project)
  170. | 工具名 | 描述 |
  171. |--------|------|
  172. | `project_get_info` | 获取项目信息 |
  173. | `project_get_settings` | 获取项目设置 |
  174. #### 编辑器工具 (Editor)
  175. | 工具名 | 描述 |
  176. |--------|------|
  177. | `editor_get_selection` | 获取当前选中 |
  178. | `editor_select_node` | 选中指定节点 |
  179. | `editor_undo_redo` | 撤销/重做操作 |
  180. #### 调试工具 (Debug)
  181. | 工具名 | 描述 |
  182. |--------|------|
  183. | `debug_get_logs` | 获取调试日志 |
  184. #### 动画工具 (Animation)
  185. | 工具名 | 描述 |
  186. |--------|------|
  187. | `animation` | 创建和编辑动画 |
  188. | `animation_state_machine` | 状态机管理 |
  189. ### 视觉工具
  190. #### 材质工具 (Material)
  191. | 工具名 | 描述 |
  192. |--------|------|
  193. | `material` | 创建和配置材质 |
  194. #### 着色器工具 (Shader)
  195. | 工具名 | 描述 |
  196. |--------|------|
  197. | `shader` | 着色器参数管理 |
  198. #### 灯光工具 (Lighting)
  199. | 工具名 | 描述 |
  200. |--------|------|
  201. | `lighting` | 场景灯光配置 |
  202. #### 粒子工具 (Particle)
  203. | 工具名 | 描述 |
  204. |--------|------|
  205. | `particle` | 粒子效果创建 |
  206. ### 2D 工具
  207. #### 瓦片地图工具 (TileMap)
  208. | 工具名 | 描述 |
  209. |--------|------|
  210. | `tilemap` | TileMap 编辑 |
  211. #### 几何体工具 (Geometry)
  212. | 工具名 | 描述 |
  213. |--------|------|
  214. | `geometry` | 2D 几何图形 |
  215. ### 游戏玩法工具
  216. #### 物理工具 (Physics)
  217. | 工具名 | 描述 |
  218. |--------|------|
  219. | `physics` | 物理体和碰撞配置 |
  220. #### 导航工具 (Navigation)
  221. | 工具名 | 描述 |
  222. |--------|------|
  223. | `navigation` | 导航网格和寻路 |
  224. #### 音频工具 (Audio)
  225. | 工具名 | 描述 |
  226. |--------|------|
  227. | `audio` | 音频播放和配置 |
  228. ### 实用工具
  229. #### UI 工具
  230. | 工具名 | 描述 |
  231. |--------|------|
  232. | `ui` | 用户界面组件 |
  233. #### 信号工具 (Signal)
  234. | 工具名 | 描述 |
  235. |--------|------|
  236. | `signal` | 信号连接管理 |
  237. #### 分组工具 (Group)
  238. | 工具名 | 描述 |
  239. |--------|------|
  240. | `group` | 节点分组管理 |
  241. ## 常见问题
  242. ### Q: 服务器无法启动?
  243. A: 请检查端口是否被占用,尝试更换端口后重启。
  244. ### Q: AI 客户端无法连接?
  245. A:
  246. 1. 确保 MCP 服务器正在运行(状态显示为绿色)
  247. 2. 检查配置文件中的端口号是否正确
  248. 3. 重启 AI 客户端
  249. ### Q: 修改了端口后需要做什么?
  250. A: 需要同时更新 AI 客户端的配置文件中的端口号,然后重启客户端。
  251. ### Q: 如何切换界面语言?
  252. A: 在「服务器」标签的设置区域,使用「语言」下拉框选择你需要的语言。
  253. ## 许可证
  254. 本项目采用 **非商业使用许可证**。
  255. ### 允许:
  256. - 个人学习和研究使用
  257. - 非商业性质的开源项目使用
  258. - 教育和教学目的使用
  259. ### 禁止:
  260. - 商业用途(包括但不限于销售、集成到商业产品中)
  261. - 未经授权的再分发
  262. 如需商业使用授权,请联系作者。
  263. ## 作者
  264. **LIDAXIAN**
  265. - GitHub: [https://github.com/DaxianLee/godot-mcp](https://github.com/DaxianLee/godot-mcp)
  266. - 微信: `lidaxian-AI`
  267. ## 贡献
  268. 欢迎提交 Issue 和 Pull Request!
  269. 1. Fork 本仓库
  270. 2. 创建你的功能分支 (`git checkout -b feature/AmazingFeature`)
  271. 3. 提交你的更改 (`git commit -m 'Add some AmazingFeature'`)
  272. 4. 推送到分支 (`git push origin feature/AmazingFeature`)
  273. 5. 开启一个 Pull Request
  274. ## 致谢
  275. - [Godot Engine](https://godotengine.org/) - 开源游戏引擎
  276. - [Model Context Protocol](https://modelcontextprotocol.io/) - AI 交互协议规范
  277. ---
  278. 如果这个项目对你有帮助,请给一个 Star!

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.