godot-mcp-scene-builder

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MCP Scene Builder

MCP Scene Builder

High-level agentic interface for low-level Godot MCP tools to build scenes from scratch.
用于底层Godot MCP工具的高级智能代理界面,可从头开始构建场景。

NEVER Do in MCP Scene Building

MCP场景构建中的禁止操作

  • NEVER skip design phase — Jumping straight to
    mcp_godot_add_node
    without planning hierarchy = spaghetti scenes. ALWAYS draft node tree first.
  • NEVER assume scene exists before adding nodes
    mcp_godot_add_node
    on non-existent scene = error. Must call
    mcp_godot_create_scene
    FIRST.
  • NEVER use absolute paths in MCP calls
    texturePath="C:/Users/..."
    breaks on other machines. Use
    res://
    paths only.
  • NEVER skip verification step — MCP creates .tscn files but doesn't validate. ALWAYS call
    mcp_godot_run_project
    or
    mcp_godot_launch_editor
    to verify no errors.
  • NEVER add CollisionShape2D without setting shape — MCP adds node but
    shape
    property is null by default. Must manually set or scene is broken.

  • 绝对不要跳过设计阶段 — 不规划层级结构就直接调用
    mcp_godot_add_node
    会导致混乱的场景。务必先草拟节点树。
  • 绝对不要在添加节点前假设场景已存在 — 在不存在的场景上调用
    mcp_godot_add_node
    会报错。必须先调用
    mcp_godot_create_scene
  • 绝对不要在MCP调用中使用绝对路径
    texturePath="C:/Users/..."
    在其他机器上会失效。仅使用
    res://
    路径。
  • 绝对不要跳过验证步骤 — MCP会创建.tscn文件,但不会进行验证。务必调用
    mcp_godot_run_project
    mcp_godot_launch_editor
    来确认无错误。
  • 绝对不要在未设置形状的情况下添加CollisionShape2D — MCP会添加节点,但
    shape
    属性默认是null。必须手动设置,否则场景会损坏。

Available Scripts

可用脚本

scene_builder_manifest.gd

scene_builder_manifest.gd

Resource definition for declarative scene building via MCP.
用于通过MCP进行声明式场景构建的资源定义。

Available MCP Tools Summary

可用MCP工具汇总

  • mcp_godot_create_scene
    : Initializes a
    .tscn
    file.
  • mcp_godot_add_node
    : Adds a node to an existing scene.
  • mcp_godot_load_sprite
    : Assigns a texture to a
    Sprite2D
    node.
  • mcp_godot_run_project
    : Spawns the Godot editor to verify the result.
  • mcp_godot_create_scene
    : 初始化一个
    .tscn
    文件。
  • mcp_godot_add_node
    : 向现有场景中添加节点。
  • mcp_godot_load_sprite
    : 为
    Sprite2D
    节点分配纹理。
  • mcp_godot_run_project
    : 启动Godot编辑器以验证结果。

Workflow: Building a Scene

工作流:构建场景

When asked to "Create a scene", "Make a character", or "Setup a level":
  1. Design Phase:
    • Determine the Root node type (e.g.,
      CharacterBody2D
      ,
      Node3D
      ,
      Control
      ).
    • Draft a node hierarchy (e.g., Root -> Sprite2D, CollisionShape2D).
  2. Execution Phase (MCP Pipeline):
    • Step 1: Call
      mcp_godot_create_scene
      to create the file.
    • Step 2: Sequentially call
      mcp_godot_add_node
      for each child.
    • Step 3 (Optional): If sprites are needed, call
      mcp_godot_load_sprite
      .
    • Step 4: (Critical for verifying) Call
      mcp_godot_run_project
      or
      mcp_godot_launch_editor
      .
  3. Optimization Phase:
    • Apply
      godot-gdscript-mastery
      standards when attaching scripts.
当收到“创建场景”、“制作角色”或“设置关卡”的请求时:
  1. 设计阶段:
    • 确定根节点类型(如
      CharacterBody2D
      Node3D
      Control
      )。
    • 草拟节点层级结构(如根节点 -> Sprite2D、CollisionShape2D)。
  2. 执行阶段(MCP流水线):
    • 步骤1: 调用
      mcp_godot_create_scene
      创建文件。
    • 步骤2: 依次为每个子节点调用
      mcp_godot_add_node
    • 步骤3(可选): 如果需要精灵,调用
      mcp_godot_load_sprite
    • 步骤4: (验证关键步骤)调用
      mcp_godot_run_project
      mcp_godot_launch_editor
  3. 优化阶段:
    • 附加脚本时遵循
      godot-gdscript-mastery
      标准。

Example: Creating a Basic 2D Player

示例:创建基础2D玩家

Prompt: "Create a 2D player scene with a sprite and collision."
Plan:
  1. mcp_godot_create_scene(scenePath="player.tscn", rootNodeType="CharacterBody2D")
  2. mcp_godot_add_node(scenePath="player.tscn", nodeType="Sprite2D", nodeName="Skin", parentNodePath=".")
  3. mcp_godot_add_node(scenePath="player.tscn", nodeType="CollisionShape2D", nodeName="Hitbox", parentNodePath=".")
  4. mcp_godot_load_sprite(scenePath="player.tscn", nodePath="Skin", texturePath="res://icon.svg")
请求: "创建一个带有精灵和碰撞的2D玩家场景。"
计划:
  1. mcp_godot_create_scene(scenePath="player.tscn", rootNodeType="CharacterBody2D")
  2. mcp_godot_add_node(scenePath="player.tscn", nodeType="Sprite2D", nodeName="Skin", parentNodePath=".")
  3. mcp_godot_add_node(scenePath="player.tscn", nodeType="CollisionShape2D", nodeName="Hitbox", parentNodePath=".")
  4. mcp_godot_load_sprite(scenePath="player.tscn", nodePath="Skin", texturePath="res://icon.svg")

Verification

验证

The agent must verify that the scene opens in the editor without errors.
代理必须确保场景能在编辑器中无错误打开。

Reference

参考

  • Master Skill: godot-master
  • 主技能: godot-master