Token导航 LogoToken导航TokenDH.com
Godot Wire logo
运维云端未说明官方级别未说明来源级核验

Godot Wire

MCP Server

GodotWire是一个Godot 4.x编辑器插件,实现了模型上下文协议(MCP) 2025规范,允许AI助手直接检查和操作Godot项目。

工具数

7

提示词数

0

GitHub Stars

0

资源数

0
游戏开发Claude云端部署ClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

nehpe

提供方

nehpe

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

GodotWire

MCP server for Godot Engine — wires AI to your editor and running game.

这是什么?

GodotWire是一个Godot 4.x编辑器插件,它实现了 模型上下文协议(MCP) 2025规范,允许AI助手(Claude、GPT、Copilot等)直接检查和操纵您的Godot项目。

主要特点:

  • 可流式HTTP传输 (MCP 2025-03-26标准)——单 /mcp 端点
  • 模块化工具架构 --下降a .gd 文件在 tools/ 添加功能
  • 52工具 跨越7个类别(场景、脚本、节点、编辑器、文件、运行时、导航)
  • 游戏桥 --执行脚本、模拟输入并从运行的游戏中捕获屏幕截图
  • AI助手就绪 --看 代理商.md 针对AI的使用指南

安装

选项A:复制(简单)

# From your Godot project root:
git clone https://github.com/nehpe/godot-wire.git /tmp/godot-wire
cp -r /tmp/godot-wire/addons/godot_wire addons/godot_wire

选项B:Symlink(用于开发)

# Clone the repo somewhere persistent:
git clone https://github.com/nehpe/godot-wire.git ~/dev/godot-wire

# From your Godot project root:
mkdir -p addons
ln -s ~/dev/godot-wire/addons/godot_wire addons/godot_wire

启用插件

  1. 在中打开项目 戈多4.4+
  2. 首选 项目→ 项目设置→ 插件
  3. 找到 GodotWire 然后单击 启用
  4. MCP服务器自动启动 127.0.0.1:6500

验证它是否正在运行

您应该在Godot输出面板中看到:

GodotWire: Streamable HTTP server listening on 127.0.0.1:6500
GodotWire: Plugin loaded — 52 tools registered

终端快速测试:

curl -s -X POST http://127.0.0.1:6500/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
  | python3 -m json.tool | head -20

MCP客户端配置

GodotWire使用 可流式传输的HTTP --将JSON-RPC 2.0 POST请求发送到 http://127.0.0.1:6500/mcp.

克劳德桌面版

添加 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或 %APPDATA%/Claude/claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "godot-wire": {
      "url": "http://127.0.0.1:6500/mcp"
    }
  }
}

VS代码/GitHub副本

添加 .vscode/mcp.json 在您的项目或 ~/.vscode/mcp.json 全球地:

{
  "servers": {
    "godot-wire": {
      "type": "http",
      "url": "http://127.0.0.1:6500/mcp"
    }
  }
}

光标

添加 .cursor/mcp.json 在项目根目录中:

{
  "mcpServers": {
    "godot-wire": {
      "url": "http://127.0.0.1:6500/mcp"
    }
  }
}

任何MCP客户端

为您的客户指出: http://127.0.0.1:6500/mcp

服务器通过HTTP POST接受标准JSON-RPC 2.0。无需身份验证(仅限本地主机)。

工具

模块工具说明
scene_tools12场景树、节点、实例化、节点详细信息、附加脚本
script_tools4执行GDScript,创建、编辑、检查错误
node_tools6属性、方法、信号、批处理操作
editor_tools10截图、播放/停止、选择、场景/项目管理
file_tools9读取、写入、创建、删除、重命名、搜索、资源
runtime_tools8游戏截图、场景树、执行、输入sim、属性
navigation_tools3导航区域、导航网烘焙、导航剂

总计:52个工具 --看 代理商.md 以获取带参数的完整工具参考。

快速示例

创建节点并设置属性:

{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{
  "name": "create_node",
  "arguments": {"name": "Enemy", "type": "CharacterBody2D", "parent": "/root/Main"}
}}

在编辑器中执行GDScript:

{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{
  "name": "execute_gdscript",
  "arguments": {"code": "var root = EditorInterface.get_edited_scene_root()\nreturn root.name"}
}}

玩游戏并模拟输入:

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{
  "name": "play_project", "arguments": {}
}}

{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{
  "name": "simulate_action",
  "arguments": {"action": "move_right", "pressed": true}
}}

捕捉游戏截图:

{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{
  "name": "get_game_screenshot", "arguments": {}
}}

添加自定义工具

创建新 .gd 文件在 addons/godot_wire/tools/:

extends GodotWireTool

func get_tools() -> Array:
    return [
        {
            "name": "my_custom_tool",
            "description": "Does something cool",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "arg1": {"type": "string", "description": "An argument"}
                },
                "required": ["arg1"]
            }
        }
    ]

func call_tool(tool_name: String, args: Dictionary) -> Dictionary:
    match tool_name:
        "my_custom_tool":
            return _success("It worked!")
    return _error("Unknown tool")

该工具在插件加载时自动发现。无需注册。

建筑

MCP Client (Claude, Copilot, etc.)
    ↓ POST /mcp (JSON-RPC 2.0)
server.gd (Streamable HTTP on port 6500)
    ↓
protocol.gd (MCP 2025-03-26 spec)
    ↓
tool_registry.gd (auto-discovers modules)
    ↓
tools/*.gd (modular tool implementations)
    ↓
game_bridge.gd ←→ game_autoload.gd (TCP bridge to running game)

故障排除

服务器无法启动

  • 正在使用的端口: 另一个带有GodotWire的Godot实例可能正在运行。在“项目设置”中更改端口→ godot_wire/server_port.
  • 插件未启用: 检查项目→ 项目设置→ 插件→ GodotWire已打开。

工具返回有关自动加载的错误

  • 自动加载需要重新启动编辑器 以被脚本编译器识别。如果您添加新的自动加载(例如通过 set_project_setting),关闭并重新打开Godot编辑器。

运行时工具失败

  • 运行时工具(execute_game_script, get_game_screenshot, simulate_action等等)仅在游戏运行时工作。呼叫 play_project 第一。
  • GodotWireGameBridge 必须注册自动加载。GodotWire会自动添加,但如果缺少,请在“项目设置”中手动添加→ 自动加载。

场景变化不会持续

  • 通过工具修改场景树后,调用 save_scene 写入磁盘。
  • 如果编辑器打开了缓存版本,它可能会在保存时覆盖您的更改。使用 execute_gdscript 随着 EditorInterface.get_edited_scene_root() 要修改实时编辑器场景,请执行以下操作 EditorInterface.save_scene().

组不会保留在已保存的场景中

  • 通过添加组 node.add_to_group()execute_gdscript 仅限运行时。要在场景中持久化组,请将它们添加到节点的脚本中 _ready() 相反,功能。

需求

  • 戈多4.4+
  • 仅限本地主机(127.0.0.1)——不暴露在网络中

许可证

麻省理工学院

目录标签

目录标签

游戏开发Claude云端部署GDScript本地部署AI集成编辑器插件自动化工具Godot扩展

支持客户端

ClaudeCursor

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

7

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP