---
catalog_id: "R-100"
kind: "repo"
domain: "tooling"
domain_label: "工程门禁 / Tooling & QA"
date: "2026-11-28"
title: "chongdashu/unreal-mcp"
verdict: "TCP 封送操控 UE 蓝图，注意缓冲溢出与零撤销坑"
summary: "面向 UE 5.5–5.7 的社区开源 MCP 桥接插件（C++ EditorSubsystem TCP 服务 + Python FastMCP stdio 代理），通过 AsyncTask+TPromise 将 JSON 命令封送至 GameThread 操控关卡 Actor、蓝图节点图与 UMG，在原生 MCP 尚未落地前提供源码可编译方案，但存在帧缓冲溢出、停服死锁、零 Undo 事务及前后端 Schema 漂移等工程坑点。"
summary_en: "UE 5.5-5.7 MCP bridge via C++ EditorSubsystem TCP and FastMCP stdio, notable for buffer overflow, shutdown deadlock, and zero-undo caveats."
canonical_url: "https://oumuatown.com/repos/chongdashu__unreal-mcp/"
markdown_url: "https://oumuatown.com/repos/chongdashu__unreal-mcp.md"
og_image_zh: "https://oumuatown.com/og/zh/R-100.png"
og_image_en: "https://oumuatown.com/og/en/R-100.png"
cite_count: 84
repo: "chongdashu/unreal-mcp"
github_url: "https://github.com/chongdashu/unreal-mcp"
commit: "4e5f00d"
tags:
  - "unreal-engine"
  - "mcp"
  - "cpp-plugin"
  - "tcp-rpc"
  - "blueprint-graph"
  - "umg"
  - "game-dev"
github_repos:
  - "https://github.com/chongdashu/unreal-mcp/tree/4e5f00d"
---

# R-100 · chongdashu/unreal-mcp

> **结论 / Verdict**: TCP 封送操控 UE 蓝图，注意缓冲溢出与零撤销坑
> **EN Summary**: UE 5.5-5.7 MCP bridge via C++ EditorSubsystem TCP and FastMCP stdio, notable for buffer overflow, shutdown deadlock, and zero-undo caveats.

## Provenance & Evidence

- Primary Repository: https://github.com/chongdashu/unreal-mcp (@4e5f00d)
- Verified Source Citations (#Lxx): 84
- Web Reader: https://oumuatown.com/repos/chongdashu__unreal-mcp/

# chongdashu/unreal-mcp

> 仓库地址：https://github.com/chongdashu/unreal-mcp · 审计版本：`chongdashu/unreal-mcp@4e5f00d` · 审计日期：2026-11-28
> 来源文章：[How to Build your own Game in Unreal Engine with Claude Opus 5.5 (Full Course)](../articles/2026-11-28-rewind02-ue58-mcp-opus55-game-course.md)

## 定位与解决的真问题

- **核心定位与目标用户**：面向使用 Unreal Engine 5.5–5.7（尚未内置官方 `ModelContextProtocol` 插件）的独立游戏开发者与原型验证团队，提供「外部 Python FastMCP 服务端 + 编辑器内嵌 C++ `UnrealMCP` 插件」的 MIT 开源实时编辑器控制桥（`README.md#L13-L55`、`MCPGameProject/MCPGameProject.uproject#L3`）。
- **相比常规做法解决的关键痛点**：
  1. **填补 UE 5.8 之前官方实时 MCP 空窗期**：UE 5.5–5.7 只有离线 Python 脚本或单向编辑器命令，缺少标准 MCP 协议入口；本仓随附完整示范工程 `MCPGameProject` 与独立插件 `UnrealMCP`，可随项目一同编译启动（`README.md#L77-L106`）。
  2. **跨线程调用虚幻编辑器的崩溃隔离**：C++ 后台 TCP 线程不可直接读写 `UWorld`、`UBlueprint` 与 `WidgetTree`，插件借助 `AsyncTask(ENamedThreads::GameThread, ...)` + `TPromise<FString>` 将所有编辑指令同步封送回 `GameThread` 执行（`MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/UnrealMCPBridge.cpp#L204-L332`）。
  3. **低门槛蓝图/UMG 程序化拼装**：除关卡 Actor 增删改查外，暴露了创建蓝图、添加 `USCS_Node` 组件、拼装 `UK2Node_Event`/`UK2Node_CallFunction`/`UK2Node_VariableGet` 并连线、以及构建 `UWidgetBlueprint` 控件树等高层命令（`Python/tools/blueprint_tools.py`、`Python/tools/node_tools.py`、`Python/tools/umg_tools.py`）。

## 技术栈与核心目录结构

- **语言 / 运行时 / 关键依赖**：
  - **UE C++ Editor 插件**：UE 5.5+（`IWYUSupport.Full`、`UnrealMCP.Build.cs#L11`），依赖 `Networking`、`Sockets`、`Json`、`JsonUtilities`、`UnrealEd`、`EditorScriptingUtilities`、`EditorSubsystem`、`UMG`、`UMGEditor`、`Kismet`、`KismetCompiler`、`BlueprintGraph`、`BlueprintEditorLibrary`（`UnrealMCP.Build.cs#L25-L69`）。
  - **Python MCP 服务端**：Python `>=3.10`（README 标 `3.12+`），依赖 `mcp[cli]>=1.4.1`（使用 `mcp.server.fastmcp.FastMCP`，`stdio` 传输），另在 `pyproject.toml` 中声明了未实际启用的 `fastmcp>=0.2.0`、`uvicorn`、`fastapi`、`requests`（`Python/pyproject.toml#L6-L14`、`Python/unreal_mcp_server.py#L13,L375-L377`）。
- **关键目录树与职责划分**：

```text
unreal-mcp/
├── mcp.json                                      # uv --directory <Python> run unreal_mcp_server.py 客户端模板
├── Python/
│   ├── pyproject.toml                            # Python 包配置与 MCP 依赖声明
│   ├── unreal_mcp_server.py                      # FastMCP 入口、UnrealConnection TCP 客户端与 @mcp.prompt("info")
│   ├── tools/
│   │   ├── editor_tools.py                       # 8 个活跃关卡 Actor 工具（focus_viewport 已注释停用）
│   │   ├── blueprint_tools.py                    # 7 个活跃蓝图/组件/编译工具（set_pawn_properties 已注释）
│   │   ├── node_tools.py                         # 8 个蓝图节点图与变量工具
│   │   ├── project_tools.py                      # 1 个旧版 InputSettings 映射工具
│   │   └── umg_tools.py                          # 6 个 UMG WidgetBlueprint 工具
│   └── scripts/                                  # 直连 55557 端口的独立冒烟/示例脚本（actors/blueprints/node）
└── MCPGameProject/Plugins/UnrealMCP/
    ├── UnrealMCP.uplugin                         # Editor 类型插件，Default 阶段加载，依赖 EditorScriptingUtilities
    └── Source/UnrealMCP/
        ├── UnrealMCP.Build.cs                    # 模块依赖配置（含 UE5.5 IWYUSupport.Full）
        ├── Public|Private/UnrealMCPModule.*      # 空壳模块入口（仅打日志）
        ├── Public|Private/UnrealMCPBridge.*      # UEditorSubsystem：启停 TCP 监听、GameThread 封送与命令路由
        ├── Public|Private/MCPServerRunnable.*    # FRunnable：Accept、收发循环与（未启用的）换行分帧逻辑
        └── Public|Private/Commands/
            ├── UnrealMCPCommonUtils.*            # JSON 解析、/Game/Blueprints/ 加载、反射设值与节点/Pin 查找
            ├── UnrealMCPEditorCommands.*         # 关卡 Actor 增删改查、蓝图 Actor 生成、视口聚焦与截图
            ├── UnrealMCPBlueprintCommands.*      # 蓝图创建、SCS 组件、反射属性、物理与编译
            ├── UnrealMCPBlueprintNodeCommands.*  # K2 节点生成、Pin 连线、成员/组件引用与节点检索
            ├── UnrealMCPProjectCommands.*        # UInputSettings::AddActionMapping + SaveConfig
            └── UnrealMCPUMGCommands.*            # UWidgetBlueprint 创建、TextBlock/Button、事件绑定与保存
```

## 核心实现源码级剖析（附文件路径与行号）

1. **插件生命周期、TCP 监听与 `FMCPServerRunnable` 帧/缓冲缺陷**（`UnrealMCPModule.cpp#L9-L17`、`UnrealMCPBridge.cpp#L62-L201`、`MCPServerRunnable.cpp#L35-L321`）：
   - **自动启动与硬编码绑定**：`FUnrealMCPModule` 仅打日志（`UnrealMCPModule.cpp#L9-L17`），真正的服务宿主是继承 `UEditorSubsystem` 的 `UUnrealMCPBridge`（`UnrealMCPBridge.h#L27`）。编辑器加载子系统时在 `Initialize` 中直接调用 `StartServer`（`UnrealMCPBridge.cpp#L84-L97`），硬编码绑定 `127.0.0.1:55557`（`#L62-L63`），配置 `SetReuseAddr(true)`、`SetNonBlocking(true)`、`Listen(5)`（`#L132-L144`），并拉起 `FRunnableThread` 运行 `FMCPServerRunnable`（`#L155-L159`）。无鉴权、无 Origin 校验，也不支持命令行或 `.ini` 覆盖端口。
   - **单客户端串行循环与栈溢出风险**：`FMCPServerRunnable::Run`（`MCPServerRunnable.cpp#L35-L156`）每次通过 `HasPendingConnection` 接受一个 `ClientSocket`（`#L44-L48`），在栈上分配 `uint8 Buffer[8192]`（`#L59`）进入内层阻塞循环读包。当 `ClientSocket->Recv(Buffer, sizeof(Buffer), BytesRead)`（`#L63`）恰好读满 `8192` 字节时，`#L72` 的 `Buffer[BytesRead] = '\0'` 会**越界写入栈缓冲 1 个字节**。
   - **无分帧解析与死代码分叉**：`Run` 直接对单次 `Recv` 切片执行 `FJsonSerializer::Deserialize`（`#L76-L80`），既没有累积半包也没有长度头/换行定界；一旦请求超过 8KB 或发生 TCP 拆包，`#L107-L110` 仅打警告且不向客户端回包，导致 Python 端卡死直至超时。同时，`#L94` 回写响应时传 `Response.Len`（UTF-16 `TCHAR` 字符数）而非 UTF-8 字节长度，含非 ASCII 字符的响应会被截断。更具迷惑性的是，同文件下半段 `#L167-L321` 实现了另一套基于 `\n` 分帧、读取 `"command"` 字段的 `HandleClientConnection` / `ProcessMessage`，但**从未被 `Run` 调用**（死代码）。

2. **GameThread 封送与关停死锁陷阱**（`UnrealMCPBridge.cpp#L170-L332`）：
   - `UUnrealMCPBridge::ExecuteCommand` 在后台线程创建 `TPromise<FString>` 与 `TFuture<FString>`，通过 `AsyncTask(ENamedThreads::GameThread, ...)` 投递匿名 lambda 到主线程执行命令并 `Promise.SetValue(ResultString)`（`#L204-L329`），随后在后台线程调用 `return Future.Get` 阻塞等待结果（`#L331`）。
   - **典型关停死锁路径**：`Deinitialize`（`#L100-L104`）在编辑器主线程调用 `StopServer`（`#L170-L201`），后者调用 `ServerThread->Kill(true)`（`#L182`，`bShouldWait = true`）。若此时恰有一条命令在 `FMCPServerRunnable` 线程正处于 `Future.Get` 等待 `GameThread` 消费 `AsyncTask`，主线程就会死等工作线程退出、工作线程死等主线程派发任务，造成编辑器退出卡死。
   - **空指针与静默失败隐患**：`ExecuteCommand` 仅在 `ResultJson->HasField(TEXT("success"))` 为 `false` 时才设置 `"status": "error"`（`#L294-L317`），而多处处理器（如 `HandleAddButtonToWidget` 等）错误分支只设 `"error"` 不设 `"success"`，导致桥接层仍包装为 `"status": "success"` 返回；且 `#L297` 未判空 `ResultJson`。

3. **五大命令处理器与真实 UE C++ API 调用**（`Commands/*.cpp`）：
   - **关卡与 Actor（`UnrealMCPEditorCommands.cpp#L28-L600`）**：
     - 使用 `UGameplayStatics::GetAllActorsOfClass(GWorld, ...)` 遍历关卡（`#L84,L110,L232,L265,L316,L348`），使用 `GEditor->GetEditorWorldContext.World` 调用 `World->SpawnActor`（`#L163-L214,L453-L467`），支持硬编码的 5 种基础类型（`StaticMeshActor`/`PointLight`/`SpotLight`/`DirectionalLight`/`CameraActor`）以及 `/Game/Blueprints/<name>` 下的蓝图类；删除与变换直接调 `Actor->Destroy`（`#L242`）与 `TargetActor->SetActorTransform`（`#L298`）。
     - 视口控制 `HandleFocusViewport`（`#L476-L561`）直接强转 `GEditor->GetActiveViewport->GetClient` 为 `FLevelEditorViewportClient*`（`#L508`，未判空 `GetActiveViewport`）；`HandleTakeScreenshot`（`#L563-L600`）通过 `FViewport::ReadPixels` + `FImageUtils::CompressImageArray` + `FFileHelper::SaveArrayToFile` 落盘 PNG。
   - **蓝图与 SCS 组件（`UnrealMCPBlueprintCommands.cpp#L70-L1160`、`UnrealMCPCommonUtils.cpp#L154-L158,L512-L709`）**：
     - `FindBlueprintByName` 硬编码前缀 `/Game/Blueprints/`（`UnrealMCPCommonUtils.cpp#L154-L158`）；`HandleCreateBlueprint` 使用 `UBlueprintFactory` + `CreatePackage` + `FAssetRegistryModule::AssetCreated` + `MarkPackageDirty`（`UnrealMCPBlueprintCommands.cpp#L88-L159`）。
     - `HandleAddComponentToBlueprint` 通过 `FindObject<UClass>(ANY_PACKAGE, ...)` 猜测组件类名后调用 `Blueprint->SimpleConstructionScript->CreateNode` / `AddNode` 并立即 `FKismetEditorUtilities::CompileBlueprint(Blueprint)`（`#L197-L252`）；`HandleCompileBlueprint` 调 `CompileBlueprint` 后**未检查 `Blueprint->Status` 是否为 `BS_Error`** 就直接返回 `compiled: true`（`#L845-L850`）。
     - 属性写入通过 `FindFProperty<FProperty>` 与 `FUnrealMCPCommonUtils::SetObjectProperty`（`UnrealMCPCommonUtils.cpp#L512-L709`）支持 `FBoolProperty`/`FIntProperty`/`FFloatProperty`/`FStrProperty`/`FByteProperty`/`FEnumProperty` 及 `FVector`/`FRotator`，但仅 SpringArm 分支使用局部 `FScopeGuard` 调用 `Modify`/`PostEditChange`（`UnrealMCPBlueprintCommands.cpp#L401-L418`）。
   - **蓝图节点图（`UnrealMCPBlueprintNodeCommands.cpp#L65-L924`、`UnrealMCPCommonUtils.cpp#L160-L418`）**：
     - 分别构造 `UK2Node_Event`、`UK2Node_CallFunction`、`UK2Node_VariableGet`（`SetSelfMember` + `ReconstructNode`）、`UK2Node_InputAction`、`UK2Node_Self` 加入 `EventGraph`，通过 `SourcePin->MakeLinkTo(TargetPin)` 连线并调用 `FBlueprintEditorUtils::MarkBlueprintAsModified(Blueprint)`（`UnrealMCPCommonUtils.cpp#L353-L360`、`UnrealMCPBlueprintNodeCommands.cpp#L133-L136`）。
   - **项目输入与 UMG（`UnrealMCPProjectCommands.cpp#L19-L72`、`UnrealMCPUMGCommands.cpp#L63-L544`）**：
     - `HandleCreateInputMapping` 调用旧版 `GetMutableDefault<UInputSettings>->AddActionMapping` 并立即 `SaveConfig`（`UnrealMCPProjectCommands.cpp#L35-L66`），不支持 UE5 Enhanced Input，也忽略 Python 传入的 `input_type="Axis"`。
     - UMG 写死 `/Game/Widgets/`（`UnrealMCPUMGCommands.cpp#L73`），用 `FKismetEditorUtilities::CreateBlueprint(UUserWidget::StaticClass, ...)` 创建 `UWidgetBlueprint` 并挂载 `UCanvasPanel` 根控件（`#L91-L113`），用 `WidgetTree->ConstructWidget` / `NewObject<UButton>` 添加控件，用 `FKismetEditorUtilities::CreateNewBoundEventForClass` 绑定按钮事件（`#L403-L408`），用 `FBlueprintEditorUtils::AddMemberVariable` + `AddFunctionGraph` 生成文本绑定函数（`#L480-L535`）。且 `HandleAddButtonToWidget`/`HandleBindWidgetEvent`/`HandleSetTextBlockBinding` 在每次调用末尾都会强制执行 `CompileBlueprint` + `UEditorAssetLibrary::SaveAsset(BlueprintPath, false)` 自动落盘（`#L314-L315,L436-L437,L538-L539`）。
   - **零 Undo 事务**：全插件 C++ 源码中**没有任何 `FScopedTransaction` 或 `GEditor->BeginTransaction` 调用**，所有场景/蓝图/配置修改均不可通过编辑器 `Ctrl+Z` 回滚。

4. **Python FastMCP 服务端、工具清点与前后端契约漂移**（`Python/unreal_mcp_server.py#L30-L377`、`Python/tools/*.py`）：
   - **传输与连接管理**：使用 `FastMCP("UnrealMCP", lifespan=server_lifespan)` 与 `mcp.run(transport='stdio')`（`unreal_mcp_server.py#L262-L266,L375-L377`），日志写至文件 `unreal_mcp.log` 并刻意注释掉 stdout 日志防破坏 stdio JSON-RPC（`#L19-L22`）。
   - **短连接 + 无效探针导致的双次建连 Bug**：`UnrealConnection.send_command`（`#L126-L201`）按早期 Unity MCP 格式发 `{"type": command, "params": params or {}}`（无 `\n`），且每次收包后主动关闭 Socket（`#L178-L185`）。然而 `get_unreal_connection`（`#L206-L236`）仍尝试向复用对象执行 `_unreal_connection.socket.sendall(b'\x00')` 探活（`#L219`）——因上次调用已把 `socket` 置 `None`，必触发 `AttributeError` 并先重连一次，随后 `send_command` 入口又关闭该连接并二次建立 TCP 连接。接收端 `receive_full_response`（`#L81-L124`）硬编码 5 秒超时（`#L51,L84`），每次 `recv(4096)` 都对累积字节全量执行 `json.loads` 判断报文结束。
   - **工具盘点（30 活跃 + 2 注释停用 + 1 Prompt）**：`editor_tools.py` 8 个（`focus_viewport` 因 buggy 被注释 `#L262`；C++ 实现了 `take_screenshot` 但 Python 未注册）、`blueprint_tools.py` 7 个（`set_pawn_properties` 被注释 `#L333`）、`node_tools.py` 8 个、`project_tools.py` 1 个、`umg_tools.py` 6 个，合计 **30 个活跃 `@mcp.tool`**，外加 `@mcp.prompt("info")`（`unreal_mcp_server.py#L282-L372`）。
   - **多处 Python↔C++ Schema 漂移**：
     - `find_actors_by_name`（`editor_tools.py#L72`）读取 `response.get("actors", )`，漏掉桥接层外包的 `"result"` 键（`UnrealMCPBridge.cpp#L310`），实际恒返回空列表。
     - `umg_tools.py` 全模块键名错位：`create_umg_widget_blueprint` 发 `widget_name`/`parent_class`/`path`（`umg_tools.py#L43-L47`），C++ 只读 `name`（`UnrealMCPUMGCommands.cpp#L67`）且硬编码基类与路径；其余 5 个 UMG 工具 Python 传 `widget_name`/`text_block_name`/`button_name`/`binding_property`，C++ 却读 `blueprint_name`/`widget_name`/`binding_name`（`#L133-L464`）；`add_widget_to_viewport` 仅返回说明文本而不挂接视口（`#L226-L236`）。
     - `add_component_to_blueprint` 传入 `component_properties`（`blueprint_tools.py#L59,L90`），但 C++ `HandleAddComponentToBlueprint` 完全忽略该字段；多数工具直接透传 C++ 返回字典而未转译为 MCP 错误状态。

## 亮点设计 vs 局限/坑点

- **值得借鉴的设计**：
  - **独立测试脚本直连旁路**：`Python/scripts/` 下的测试脚本直接复用 `UnrealConnection` 连 `127.0.0.1:55557`，无需拉起完整 MCP Client 即可端到端验证 Blueprint 组装、物理属性与角色输入映射。
  - **蓝图文本化/结构化 API 覆盖较全**：相比单纯暴露 `execute_python`，把 `SimpleConstructionScript`、`K2Node` 连线、CDO 反射写属性拆成强类型工具，降低了模型猜 UE Python API 签名出错的概率。

- **局限、隐含假设与潜在坑点**：
  - **未鉴权回环端口与任意改写**：本地 `127.0.0.1:55557` 无 Token、无 Origin 检查，且没有作用域事务（`FScopedTransaction` 缺失）与 PIE/编译状态护栏，必须配合 Git/Perforce 恢复点使用。
  - **UE 5.5–5.7 源码编译门槛与过时 API**：插件以纯 C++ 源码分发（`.uplugin` 无预编译二进制），要求项目本身为 C++ 工程并配好 VS/Xcode；多处仍使用 `FindObject<UClass>(ANY_PACKAGE, ...)`（`UnrealMCPBlueprintCommands.cpp#L197`、`UnrealMCPBlueprintNodeCommands.cpp#L323,L506`，注释自承在 UE 5.5+ 可能失效），在 UE 5.6/5.7 开启严格废弃警告或移除 `ANY_PACKAGE` 时需改写为 `FindFirstObject<UClass>` / `LoadClass`。
  - **与 Epic UE 5.8 官方 MCP 及 Blender MCP 架构直接对比**：

| 对比维度 | `chongdashu/unreal-mcp`（UE 5.5–5.7 社区） | Epic UE 5.8 官方 MCP（`ModelContextProtocol` + `AllToolsets`） | `ahujasid/mcp-for-blender`（Blender 插件） |
|---|---|---|---|
| **分发与适配层** | C++ 源码插件随工程编译 + 外部 Python `stdio` 进程（`UnrealMCP.uplugin`） | 引擎内建插件直接暴露；可选官方 `unreal_mcp_proxy` 保活重启会话 | 纯 Python `addon.py` 插件 + `uvx` FastMCP 客户端（无需 C++ 编译） |
| **传输协议与端口** | 自研无定界 JSON-over-TCP（`127.0.0.1:55557`），每次工具调用重连 2 次 | Streamable HTTP（`127.0.0.1:8000/mcp`），支持 Origin 校验与多编辑器端口隔离 + `processId` 校验 | 长连接 JSON-over-TCP（`localhost:9876`），客户端 `threading.Lock` 串行化 |
| **主线程封送机制** | `FRunnable` 调 `AsyncTask(GameThread)` + `Future.Get` 阻塞等（有停服死锁风险） | 引擎 `ToolsetRegistry` 统一派发（支持 `UToolCallAsyncResult` 异步回调） | 守护线程入 `queue.Queue` + 主线程 50ms 单例 `bpy.app.timers` 排空（`MSG_PEEK` 丢弃超时包） |
| **工具规模与发现** | 全量注册 30 个硬编码工具（仅覆盖 Actor/BP/K2/UMG 基础集） | 30+ Toolset 数百工具，默认 `bEnableToolSearch=True` 收敛为 3 元工具防爆上下文 | ~20 个内建工具 + `execute_code` 脚本逃生舱（内置多视角 `LOOK` 渲染脚本） |
| **安全、Undo 与健壮性** | 零 `FScopedTransaction`、无 PIE/编译检查、UMG 自动 `SaveAsset`、存在 8KB 栈越界与前后端字段漂移 | 无全局 Undo 强依赖 VCS，但提供显式 `AutomationTestToolset`、编译检查与 `unreal-skill` 规范 | 提供 `BLENDER_MCP_SAFE_MODE` AST 白名单沙箱与 `GPUOffScreen` 离屏截图 |

## 可复用的模块或设计模式

- **如何迁移到未来项目**：
  1. **若必须停留在 UE 5.5–5.7 使用社区方案**：不要直接原样部署本仓 `4e5f00d`——至少需先修复 `MCPServerRunnable.cpp#L72` 的 8KB 栈越界并切换为长度前缀/换行分帧、移除 `StopServer` 中与 `Future.Get` 互锁的阻塞等待、补齐 `FScopedTransaction`、清理 `ANY_PACKAGE` 废弃宏，并对齐 `umg_tools.py` 与 `find_actors_by_name` 的 JSON 字段契约；若条件允许升级至 UE 5.8，应直接迁移到官方 `ModelContextProtocol` + `AllToolsets`。
  2. **跨线程编辑器桥接的反面教材**：切忌在后台 Socket 线程用 `Future.Get` 同步死等主线程的同时，在主线程 `Deinitialize` 用 `Kill(true)` 等待后台线程退出；应借鉴 `ahujasid/mcp-for-blender` 的非阻塞双队列 + 主线程 Tick/Timer 排空模型，并在关闭前先唤醒/取消所有挂起 `TPromise`。
  3. **编译状态显式回传**：封装蓝图编译工具时不能只调用 `FKismetEditorUtilities::CompileBlueprint` 返回常量 `true`，必须读取 `Blueprint->Status`（`BS_Error` / `BS_UpToDateWithWarnings`）及编译消息日志回传给 Agent。
- **关联 Pattern**：[unreal-engine-mcp-live-editor-agent-workflow](../patterns/unreal-engine-mcp-live-editor-agent-workflow.md)

## Cross-Referenced Specimens

- [A-024 · UE 5.8 官方 MCP + Claude Opus 5.5 零基础做可玩游戏全流程课程拆解](https://oumuatown.com/articles/2026-11-28-rewind02-ue58-mcp-opus55-game-course.md) — 划清 UE5.8 官方 MCP 实时编辑边界与五闸门安全网
- [P-025 · Unreal Engine 实时编辑器 MCP 操控、安全网、五闸门切片与官方插件供应链模式（UE Live-Editor MCP Workflow）](https://oumuatown.com/patterns/unreal-engine-mcp-live-editor-agent-workflow.md) — 虚幻引擎实时 MCP 选型、爆炸半径管控与二连败熔断纪律
