---
catalog_id: "R-103"
kind: "repo"
domain: "tooling"
domain_label: "工程门禁 / Tooling & QA"
date: "2026-11-28"
title: "EpicGames/unreal-engine-skills-for-claude-code-plugin"
verdict: "Epic官方UE插件：按需发现工具直连实时编辑器MCP"
summary: "Epic Games 官方维护的 Claude Code 插件（v3.1.2），通过 SessionStart 上下文钩子、三元工具按需发现契约（bEnableToolSearch）及 C++/Python Toolset 与 AgentSkill 开发规范，将 Claude Code 接入 UE 5.8+ 实时编辑器 MCP 服务器。"
summary_en: "Official Epic Games Claude Code plugin linking UE 5.8+ live editor MCP via SessionStart hooks, bEnableToolSearch discovery, and Toolset specs."
canonical_url: "https://oumuatown.com/repos/EpicGames__unreal-engine-skills-for-claude-code-plugin/"
markdown_url: "https://oumuatown.com/repos/EpicGames__unreal-engine-skills-for-claude-code-plugin.md"
og_image_zh: "https://oumuatown.com/og/zh/R-103.png"
og_image_en: "https://oumuatown.com/og/en/R-103.png"
cite_count: 119
repo: "epicgames/unreal-engine-skills-for-claude-code-plugin"
github_url: "https://github.com/epicgames/unreal-engine-skills-for-claude-code-plugin"
commit: "0e27bde"
tags:
  - "unreal-engine"
  - "mcp"
  - "claude-code"
  - "agent-skills"
  - "toolset-registry"
  - "game-dev"
github_repos:
  - "https://github.com/epicgames/unreal-engine-skills-for-claude-code-plugin/tree/0e27bde"
---

# R-103 · EpicGames/unreal-engine-skills-for-claude-code-plugin

> **结论 / Verdict**: Epic官方UE插件：按需发现工具直连实时编辑器MCP
> **EN Summary**: Official Epic Games Claude Code plugin linking UE 5.8+ live editor MCP via SessionStart hooks, bEnableToolSearch discovery, and Toolset specs.

## Provenance & Evidence

- Primary Repository: https://github.com/epicgames/unreal-engine-skills-for-claude-code-plugin (@0e27bde)
- Verified Source Citations (#Lxx): 119
- Web Reader: https://oumuatown.com/repos/EpicGames__unreal-engine-skills-for-claude-code-plugin/

# EpicGames/unreal-engine-skills-for-claude-code-plugin

> 仓库地址：https://github.com/EpicGames/unreal-engine-skills-for-claude-code-plugin · 审计版本：`EpicGames/unreal-engine-skills-for-claude-code-plugin@0e27bde` · 审计日期：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)

## 定位与解决的真问题

- **核心定位与目标用户**：Epic Games 官方（author: Thomas Mansencal，`.claude-plugin/plugin.json#L5-L8`、`CODEOWNERS#L1-L2`）发布在 `anthropics/claude-plugins-official` 的 MIT 开源 Claude Code 插件（`v3.1.2`），面向使用 Unreal Engine 5.8+ 的游戏开发者、TA 与引擎团队。
- **注意仓库边界**：本仓库**不包含** UE 编辑器侧 MCP 服务端源码（`ModelContextProtocol`、`ToolsetRegistry` 与 `AllToolsets` 位于 Unreal Engine 5.8+ 引擎源码/安装包内，标记为 Experimental）；本仓库是**客户端编排层 + 开发者规范层**（Hooks + Skills + 运维排障参考）。
- **相比常规做法解决的关键痛点**：
  1. **上下文窗口与 Prompt Cache 爆炸**：UE `AllToolsets` 跨 30+ 工具集暴露数百个工具（`README.md#L3`）；若全量注入 `tools/list`，会严重撑爆上下文并破坏 Prompt Cache。插件配套引擎默认开启的 `bEnableToolSearch=True`（`README.md#L82`、`skills/unreal-mcp/references/operations.md#L18-L28`），将 MCP 表面收敛为 3 个元工具（`list_toolsets`、`describe_toolset`、`call_tool`）。
  2. **项目级知识与工具发现解耦**：通用模型不懂特定项目的命名规范、PCG 规则或目录约定；插件通过 `AgentSkillToolset`（`skills/unreal-mcp/SKILL.md#L36-L46`）与 `unreal-skill`（`skills/unreal-skill/SKILL.md#L1-L112`）支持在 `.uproject` 或代码插件内注册优先于默认行为的项目专属指令包。
  3. **多编辑器 / 崩溃重连与安全边界**：提供可选 STDIO 代理 `unreal_mcp_proxy` 跨编辑器重启保活（`skills/unreal-mcp/references/setup.md#L83-L122`），多编辑器固定端口隔离与 `processId` 身份校验（`setup.md#L123-L132`、`operations.md#L42-L49`），以及针对任意 Python 执行与不可撤销修改的操作护栏（`README.md#L84-L95`、`SKILL.md#L26-L35`）。

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

- **语言 / 运行时 / 关键依赖**：Claude Code Plugin 清单（JSON）、Bash（`SessionStart` 钩子，依赖 `PATH` 上存在 `bash`）、Markdown Skill/Reference；与 UE 5.8+ `ModelContextProtocol`、`AllToolsets`、`ToolsetRegistry`（C++ UHT / Unreal Python）及可选 `unreal_mcp_proxy` 协同。
- **全仓 12 个文件清单与职责划分**：

```text
unreal-engine-skills-for-claude-code-plugin/
├── .claude-plugin/plugin.json          # 插件元数据（name/version 3.1.2/MIT/author）
├── .gitignore                          # 忽略 skill-creator 评估产物 skills/*-workspace/
├── CODEOWNERS                          # 全仓默认所有者 @Thomas.Mansencal
├── LICENSE                             # MIT License (Copyright 2026 Epic Games, Inc.)
├── README.md                           # 装机前置条件、平台支持、Tool Search、安全声明与 13 类工具域概览
├── hooks/
│   ├── hooks.json                      # SessionStart (startup|resume|clear) 钩子配置，timeout 5s
│   └── unreal-context.sh               # 向上遍历查找 UE 项目根并注入项目类型与 .mcp.json 状态提示
└── skills/
    ├── unreal-mcp/
    │   ├── SKILL.md                    # 实时编辑器 MCP 操作主契约（3 元工具流、5 条安全铁律、AgentSkill 发现）
    │   └── references/
    │       ├── setup.md                # 首次安装、.ini 自启、.mcp.json 生成、代理安装、多编辑器端口隔离
    │       └── operations.md           # 控制台命令、bEnableToolSearch、代理恢复、实例识别、排障矩阵
    ├── create-toolset/SKILL.md         # 面向引擎/TA 的 C++ & Python Toolset 扩展、Schema、错误处理与测试规范
    └── unreal-skill/SKILL.md           # 面向团队的 Python / UAsset AgentSkill 编写、注册与热重载规范
```

> 细节勘误：`README.md#L6-L10` 的 `### Skills` 目录仅列出了 `unreal-mcp`，遗漏了仓库中实际随附的 `create-toolset` 与 `unreal-skill` 两个伴随技能（它们仅在 `skills/unreal-mcp/SKILL.md#L53-L56` 中被引用）。

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

### 1. SessionStart 钩子与项目上下文注入（`hooks/hooks.json#L1-L17`、`hooks/unreal-context.sh#L1-L84`）

1. **触发时机与 Matcher**（`hooks/hooks.json#L4-L15`）：仅绑定 `SessionStart` 事件，正则 `matcher` 为 `"startup|resume|clear"`（不包含 `compact`），超时 `5` 秒，执行 `bash ${CLAUDE_PLUGIN_ROOT}/hooks/unreal-context.sh`。
2. **向上追溯与项目根识别**（`hooks/unreal-context.sh#L13-L47`）：
   - `find_project_root`（`#L28-L41`）从 `$PWD` 逐级向 `dirname` 向上查找直至根目录（无层级深度限制），支持从 `Source/`、`Content/`、`Plugins/` 等子目录启动会话。
   - `is_project_root`（`#L13-L26`）匹配 4 种可靠标志物：`GenerateProjectFiles.bat`、`GenerateProjectFiles.sh`、`GenerateProjectFiles.command` 或任意 `*.uproject`（`#L19-L24`）。注释明确指出**严禁将裸 `Engine/` 目录作为根标志**，因为 UE 源码树存在 `Engine/Source/Runtime/Engine`，否则从 Runtime 模块启动时会误判 `Source/Runtime` 为项目根（`#L14-L18`）。
   - 若未找到任何标志，仅在设置了 `$CLAUDE_UE_HOOK_DEBUG` 时向 `stderr` 打调试日志，并静默 `exit 0`（无任何 `stdout` 输出，`#L44-L47`）。
3. **项目类型区分与 `.mcp.json` 检测**（`hooks/unreal-context.sh#L49-L78`）：
   - 存在 `$project_root/Engine` 目录则判为 `project_type="engine"`，否则为 `"game"` 并读取第一个匹配的 `*.uproject` 文件名（`#L49-L58`）。
   - 检测 `$project_root/.mcp.json`（注意是项目根而非 `$PWD`，`#L60-L61`）：若存在则注入 `"An .mcp.json is already present at the project root."`（`#L74-L75`）；若缺失则注入精确生成指令 `"Run ModelContextProtocol.GenerateClientConfig ClaudeCode in the editor console to generate one."`（`#L76-L78`）。
   - 同时注入 UE 编码惯例（`C++/UObject`、`Slate`、`UHT reflection`）并引导使用 `unreal-mcp` skill（`#L72-L73`）。
4. **平台边界与 JSON 转义实现**（`README.md#L21-L28`、`hooks/unreal-context.sh#L80-L84`）：
   - Windows 原生 PowerShell 若无 Git Bash 或 WSL 提供 `bash` 到 `PATH`，`SessionStart` 钩子会失效（无 PowerShell 替代脚本），但 MCP 工具本身仍可正常运行（`README.md#L28`）。
   - `unreal-context.sh#L81-L84` 仅用 Bash 字符串替换转义反斜杠 `\` 与双引号 `"`，随后直接 `printf` 拼接 `hookSpecificOutput.additionalContext` JSON；若 `.uproject` 文件名含控制字符（如 `\n`/`\t`）将不会被转义，属于轻量脚本的隐含假设。

### 2. MCP 连接配置、Tool Search、代理恢复与并发契约（`setup.md#L1-L144`、`operations.md#L1-L59`、`unreal-mcp/SKILL.md#L1-L56`）

1. **双插件启用与“零工具”边界**（`README.md#L17`、`setup.md#L12-L31`）：
   - `.uproject` 的 `Plugins` 数组中需启用 `"ModelContextProtocol"`（服务端与传输层）与 `"AllToolsets"`（`EnabledByDefault` 为关闭的编辑器聚合插件，`setup.md#L31`）。
   - 官方文档明确指出：**仅启用 `ModelContextProtocol` 时服务端虽能启动，但不会暴露任何工具**（`"the server exposes none without it"` / `"starts but exposes no tools"`，`README.md#L17`、`setup.md#L14`）。若只需暴露部分工具，可直接启用特定 toolset 插件替代 `AllToolsets`（`setup.md#L31`）。
2. **自启配置、端口与客户端生成路径**（`setup.md#L33-L82`、`operations.md#L9-L15`）：
   - 持久化自启写入非受控的个人配置文件 `<Project>/Saved/Config/<Platform>Editor/EditorPerProjectUserSettings.ini`（`#L39-L53`）：
     ```ini
     [/Script/ModelContextProtocolEngine.ModelContextProtocolSettings]
     bAutoStartServer=True
     ServerPortNumber=8000
     ServerUrlPath=/mcp
     ```
     或通过命令行参数 `-ModelContextProtocolStartServer` / `-ModelContextProtocolPort=<port>` 启动（`#L55`）。
   - 控制台命令 `ModelContextProtocol.GenerateClientConfig <client>` 支持 `ClaudeCode`、`Cursor`、`VSCode`、`Gemini`、`Codex`、`All`（`operations.md#L14`）。**路径分支规则**（`setup.md#L63-L66`）：源码构建（含 `Engine/` 目录）写入**工作区根目录（与 `Engine/` 同级，而非 `.uproject` 旁）**；启动器安装版才写入 `.uproject` 同级目录。JSON 客户端重跑自动合并覆盖，`Codex` 的 `.codex/config.toml` 则拒绝覆盖已有文件（`setup.md#L61`）。
3. **Tool Search 三元工具流（默认开启）**（`README.md#L82`、`operations.md#L16-L28`、`SKILL.md#L14-L23`）：
   - `UModelContextProtocolSettings.bEnableToolSearch` 默认 `True`，`tools/list` 仅暴露 `list_toolsets`、`describe_toolset`、`call_tool`；所有实际工具均由 `call_tool(toolset_name, tool_name, arguments)` 在服务端同回合派发，不污染 `tools/list` 且保持 Prompt Cache 稳定。设为 `False` 时启动即注册全部原生工具（供 hash-mapping commandlet 使用）。
4. **可选 STDIO 代理 `unreal_mcp_proxy` 与多编辑器实例识别**（`setup.md#L83-L132`、`operations.md#L30-L55`）：
   - 位于 `Engine/Plugins/Experimental/ModelContextProtocol/Extras/Proxy/Bin/{Win64,Mac,Linux,LinuxArm64}/unreal_mcp_proxy(.exe)`，将 `.mcp.json` 中的 HTTP 入口替换为 STDIO `unreal-mcp-proxy`（原配置备份至 `_upstreamEntry`），在编辑器重启期间保持客户端会话不断开并缓存目录；无缓存且上游断开时仅暴露 `unreal_mcp_status`（注意该工具只反映代理会话状态，不代表当前编辑器可达，恢复后发 `notifications/tools/list_changed`，`operations.md#L34-L37`）。
   - 多编辑器并行需为每个工作区分配独立固定端口（如 `8100`、`8101`），并通过协议 `2026-07-28` 在 `initialize` / `server/discover` 返回的 `_meta["com.epicgames.unrealengine/instance"]`（含 `processId`、`projectDirectory` 等）及 `execute_python` 执行 `os.getpid` 核验目标进程（`operations.md#L42-L48`）。
5. **并发调度与静默失败契约**（`SKILL.md#L30-L34`、`operations.md#L58-L59`）：
   - **并发语义**：MCP 服务端接受并发请求并负责派发同步，但**异步工具可重叠执行，请求顺序不保证执行或完成顺序**；因此存在依赖关系或触及同一资产/编辑器状态的写操作必须串行化，多 Agent 连入同一编辑器会产生冲突。
   - **静默失败**：`SKILL.md#L33` 明确警示蓝图编译、Widget 创建、材质编辑等诸多工具不会在传输层抛异常，而是在返回值状态字段中翻转成败，必须显式检查响应再继续。

### 3. 编辑器能力面、Python 执行、PIE 与自动化测试（`README.md#L86-L112`、`SKILL.md#L30-L46`、`operations.md#L47,L56-L59`、`create-toolset/SKILL.md#L380-L408`）

1. **13 类工具域与文档可见具名工具**（`README.md#L98-L112`）：
   - 涵盖 Actors/Scene、Blueprints、Assets/Content（Data/Curve/String Tables）、Materials、Meshes/Textures（LOD/Collision/Nanite/Socket/Bone）、Animation（Control Rig/State Tree/Behavior Tree）、Sequencer（Level Sequence/Keyframes/FBX）、VFX（Niagara/Dataflow）、UI（UMG/Slate UI 自动化）、Gameplay（Tags/GAS/Game Feature Plugins/Physics Assets）、Testing（C++ 自动化测试）、Editor（截图/相机控制/选中态/Content Browser/日志检视）、Scripting（Python 批处理）。
   - 仓库内显式点名的工具集/工具名包括：`ProgrammaticToolset.execute_tool_script`（`README.md#L90`）、`execute_python`（`operations.md#L47`）、`LiveCodingToolset.CompileLiveCoding`（`SKILL.md#L31`、`operations.md#L57`、`create-toolset/SKILL.md#L234`）、`AgentSkillToolset`（`ListSkills` / `GetSkills` / `CreateSkill` / `UpdateSkill`）、`AutomationTestToolset`（`DiscoverTests` / `ListTests` / `RunTests` / `GetTestStatus` / `GetTestResults`）、`AIAssistantToolset.GetDockedContext`（需停靠在资产编辑器内否则返回空，`operations.md#L58`），以及示例提及的 `BlueprintTools`、`SequencerTools`、`StaticMeshTools`、`ObjectTools`、`LevelTools`、`MaterialTools`、`AssetTools`、`NiagaraTools`。
   - **注**：完整 30+ 工具集清单并不硬编码在 `operations.md` 中，而是通过 `list_toolsets` 运行时自省获取。
2. **编辑器内 Python 执行与事务/撤销边界**（`README.md#L88-L95`、`SKILL.md#L30`）：
   - `ProgrammaticToolset.execute_tool_script` 在编辑器进程内执行任意 Python，拥有全部 Toolset API、磁盘项目文件、资产数据库与编辑器特权接口的完整访问权（`README.md#L90`）。
   - 服务端仅绑定 `localhost:8000` 并校验 Origin 防浏览器标签页跨站访问，但**本地同用户进程无鉴权边界**（`README.md#L88`）；强烈建议禁止在使用本插件时开启 `--dangerously-skip-permissions`（`#L92`）。
   - **所有 MCP 编辑（不仅是 Python）都不保证可撤销**，尤其是跨编译边界的修改，必须依赖 VCS（Git/Perforce）与显式保存作为恢复点（`SKILL.md#L30`、`README.md#L94`）。
3. **PIE 运行期约束与 C++ 自动化测试闭环**（`SKILL.md#L34`、`operations.md#L57`、`create-toolset/SKILL.md#L384-L407`）：
   - PIE（Play-in-Editor）运行期间编辑器专属工具（尤其是资产创建）行为异常，且编译或加载关卡期间调用会挂起或报错（`SKILL.md#L34`、`operations.md#L57`）。
   - 自动化测试闭环分 4 步（`create-toolset/SKILL.md#L390-L395`）：先调 `AutomationTestToolset.DiscoverTests`（Python 测试增删后需传 `force_rediscover=true`）→ `ListTests` → `RunTests` → 轮询 `GetTestStatus` + `GetTestResults`；无运行期编辑器时可用 `UnrealEditor-Cmd.exe <Project>.uproject -ExecCmds="Automation RunTests <Filter>;quit" -Unattended -NullRHI`（`#L403-L405`）。

### 4. 自定义 Toolset 与项目级 AgentSkill 扩展机制（`create-toolset/SKILL.md#L1-L420`、`unreal-skill/SKILL.md#L1-L112`）

1. **C++ Toolset 开发规范**（`create-toolset/SKILL.md#L83-L268`）：
   - **基类与宏**：继承 `UToolsetDefinition`（`ToolsetRegistry/ToolsetDefinition.h`），`UCLASS(BlueprintType, MinimalAPI)`，每 `.h/.cpp` 单类；暴露方法必须为 `static` 并标记 `UFUNCTION(meta = (AICallable), Category = "...")`，注释即 AI 工具描述；结构体用 `USTRUCT(BlueprintType)`，支持 `UPROPERTY(meta=(ClampMin=..., ClampMax=...))` 自动映射至 JSON Schema（`#L81,L87-L139`）。
   - **异步与序列化**：长耗时任务返回 `UToolCallAsyncResult` 子类（如 `UToolCallAsyncResultImage*`），通过 `SetValue` / `SetError` 回调（`#L142-L176`）；复杂类型可继承 `FToolsetJsonConverter`（`ToolsetRegistry/ToolsetJsonConverter.h`），内置 `FToolsetColorConverter`、`FToolsetReferenceConverter`、`FToolsetTransformConverter`（`#L201-L214`）。
   - **注册与报错**：在 `IModuleInterface::StartupModule` / `ShutdownModule` 中调用 `UToolsetRegistry::RegisterToolsetClass` / `UnregisterToolsetClass`（`#L185-L196`）；同步失败须调用 `UKismetSystemLibrary::RaiseScriptError(EScriptExceptionType::Error, TEXT("..."))` 并返回默认空值，严禁返回布尔/错误字符串包装（`#L48,L217-L229`）。
   - **测试**：先调用 `LiveCodingToolset.CompileLiveCoding` 热编，再用 `BEGIN_DEFINE_SPEC` / `END_DEFINE_SPEC`（`EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter`）配合 `AddExpectedError` 覆盖正常与异常路径（`#L234-L267`）。
2. **Python Toolset（官方优先推荐）**（`create-toolset/SKILL.md#L34-L39,L270-L378`）：
   - 当 `<project_root>/Intermediate/PythonStub/unreal.py`（需在编辑器开启 Python Developer Mode）覆盖所需 API 时优先选 Python；类使用 `@unreal.uclass` 继承 `unreal.ToolsetDefinition`，方法使用 `@toolset_registry.tool_call` + `@staticmethod` 并强制写标准 Python 类型注解（如 `list[str]`），在 `init_unreal.py` 调用 `unreal.ToolsetRegistry.register_toolset_class`，失败直接 `raise ValueError`，测试继承 `ToolCallTestCase` 并用 `reload_remote.py` 热重载。
3. **项目专属 `AgentSkill` 双注册路径**（`unreal-skill/SKILL.md#L32-L106`）：
   - **代码插件路径（Python）**：在插件 `skills/` 子目录用 `@agent_skill` 装饰继承 `unreal.AgentSkill` 的类，docstring 为 `Description`，`instructions` 类属性为正文，在 `init_unreal.py` 导入即自动注册，支持 `reload_remote.py` 热重载。
   - **项目无代码路径（UAsset）**：通过 MCP 调用 `AgentSkillToolset.CreateSkill` / `UpdateSkill` 直接在 Content Browser（如 `/Game/Skills/MyWorkflowSkill`）创建或更新 `UAgentSkill` 资产（写入 `Description` 与 `FAgentSkillDetails.Instructions`）。
   - **注**：仓库本身未提及 City Sample 或 PCG 具体示例（该示例出自 `@rewind02` 外部实践），但其底层机制正是上述 `AgentSkillToolset` 运行时加载。

### 5. `@rewind02` 原文核验对照表（一致点 vs 差异与细节补充）

| 核验项 | `@rewind02` 原文宣称 | 源码核验结论（`0e27bde`） | 差异 / 细节补充 |
|---|---|---|---|
| `SessionStart` 钩子行为 | 从子目录启动也能找到 `.uproject`，检测 `.mcp.json` 缺失并提示确切命令，非 UE 目录静默 | **高度一致**（`hooks/unreal-context.sh#L13-L84`） | 实际还识别 `GenerateProjectFiles.{bat,sh,command}`、区分 `engine` 源码树与 `game` 项目，显式排除裸 `Engine/` 误判；仅触发于 `startup\|resume\|clear`，Windows 需 Git Bash/WSL |
| 插件启用（`ModelContextProtocol` + `AllToolsets`） | 仅开前者时服务端启动但“offers nothing” | **文档一致**（`README.md#L17`、`setup.md#L14`） | `setup.md#L31` 补充：`AllToolsets` 非唯一路径，可改为仅启用特定子 toolset 插件；开启 `bEnableToolSearch` 时 MCP 仍注册 3 个元工具外壳，但无任何可用 toolset |
| `.mcp.json` 生成位置与客户端 | `GenerateClientConfig ClaudeCode` 生成在 `.uproject` 旁 | **部分片面**（`setup.md#L61-L66`） | 仅 Launcher 安装版写到 `.uproject` 旁；**源码构建写到 `Engine/` 同级工作区根**。还支持 `Cursor`/`VSCode`/`Gemini`/`Codex`/`All` |
| 端口与自启 | 默认 8000，`StartServer 8010` 改端口，Editor Preferences 开 Auto Start | **基本一致**（`setup.md#L35-L56`） | 持久化应改 `<Project>/Saved/Config/<Platform>Editor/EditorPerProjectUserSettings.ini` 的 `bAutoStartServer=True` 与 `ServerPortNumber`，或传 `-ModelContextProtocolPort`；多编辑器不可临时漂移端口 |
| 并发请求支持 | 官网称串行、9 月更新称支持并发，建议同资产顺序执行 | **精准补充**（`SKILL.md#L32`、`operations.md#L59`） | 服务端接受并发请求并同步派发，但**异步工具可重叠且请求顺序不保证完成顺序**；多 Agent 共连同一编辑器亦会冲突 |
| 遗漏的核心特性 | 未提及 Tool Search、`unreal_mcp_proxy` 与 `create-toolset`/`unreal-skill` | **源码存在重要机制** | 仓库默认开启 `bEnableToolSearch` 3 元工具流（`operations.md#L18-L28`）、提供跨编辑器重启保活的 `unreal_mcp_proxy`（`setup.md#L83-L122`）及 C++/Python 扩展技能 |
| 撤销与 Python 边界 | 提及运行 Python 道具的操作不总是可撤销 | **范围比原文更广**（`SKILL.md#L30`） | 仓库警示**所有 MCP 实时编辑（尤其跨编译边界）都不保证可撤销**，不止 Python toolset；且共有 `ProgrammaticToolset.execute_tool_script` 与 `execute_python` 两个引用 |
| City Sample PCG 技能 | 举例 City Sample 注册了教 Agent 建 PCG 图的 Skill | **仓库未收录该案例** | 仓库仅定义通用 `AgentSkillToolset`（`ListSkills`/`GetSkills`/`CreateSkill`/`UpdateSkill`）与 Python/UAsset 两种注册机制，未点名 City Sample 或 PCG |

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

- **值得借鉴的设计**：
  1. **3 元工具懒加载契约（`list_toolsets` / `describe_toolset` / `call_tool`）**：用不变的 3 工具列表锁死 `tools/list` 保持 Prompt Cache 热命中，同时支持 30+ 工具集数百个工具同回合发现即调用（`README.md#L82`、`SKILL.md#L14-L23`）。
  2. **文档与工具的双层解耦（`ToolsetRegistry` vs `AgentSkillToolset`）**：底层原子能力放在无状态的静态 Toolset，工作流知识与项目禁忌（naming/folder/sequence）通过独立 `AgentSkill` 下发，且可在编辑器内以 UAsset 无代码热维护（`unreal-skill/SKILL.md#L88-L106`）。
  3. **多编辑器实例元数据校验**：在 MCP `initialize` `_meta` 注入 `processId` 与 `projectDirectory`，配合 `os.getpid` 二次核验，防止错连旧编辑器（`operations.md#L42-L48`）。
  4. **防误判的项目根探测**：明确跳过裸 `Engine/` 目录避免 UE 源码树内部短路的工程细节（`hooks/unreal-context.sh#L14-L18`）。
- **局限、隐含假设与潜在坑点**：
  1. **规范与历史实现存在断层**：`create-toolset/SKILL.md#L48` 严禁工具返回状态包装而要求抛异常，但 `unreal-mcp/SKILL.md#L33` 坦承蓝图编译/材质/UMG 等现有工具仍会在不抛异常的情况下返回失败状态字段，Agent 易误判成功。
  2. **本地无鉴权与任意代码执行面**：`localhost:8000` 仅校验 Origin，同机任意进程可调用 `ProgrammaticToolset.execute_tool_script`（`README.md#L88-L92`），对共享机器或 `--dangerously-skip-permissions` 风险极高。
  3. **跨平台钩子与 JSON 转义小瑕疵**：Windows 原生 PowerShell 无可用 `SessionStart` 钩子（`README.md#L28`）；`unreal-context.sh#L81-L84` 未转义控制字符；`README.md#L6-L10` 技能目录遗漏了 `create-toolset` 与 `unreal-skill`。
  4. **代理缓存假象**：`unreal_mcp_proxy` 在编辑器离线时仍可返回缓存工具列表且 `unreal_mcp_status` 仅报会话状态，需要一次只读工具调用才能真正确认编辑器可达（`operations.md#L34-L37`、`setup.md#L142`）。

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

- **如何迁移到未来项目**：
  1. **大型软件/DCC/IDE 的 MCP 接入模板**：当目标宿主暴露 >30 个工具时，采用 `list_toolsets` + `describe_toolset` + `call_tool` 三元工具网关（替代一次性塞满 `tools/list`），既保住 Prompt Cache 又避免上下文膨胀。
  2. **“工具集 + 领域技能资产”双注册架构**：不仅暴露 API，还给宿主项目一个 `AgentSkill` 注册表，让每个项目可把自身工作流/避坑指南打包成可热重载的技能包，供 Agent 启动任务前先 `ListSkills`。
  3. **有头软件的本地代理保活 + 实例元数据指纹**：针对会频繁编译重启的桌面宿主（如 UE/Blender/Xcode），用轻量化 STDIO Proxy 维持客户端会话，并在 `initialize._meta` 携带 `processId` 与 `projectDirectory` 防串台。
- **关联 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 选型、爆炸半径管控与二连败熔断纪律
- [P-020 · AI 视频四轨生产、Code2Video 工艺、Blender Previs、Seedance 2.5 UGC 与 Unity/UE 官方插件工程手册](https://oumuatown.com/patterns/ai-video-previs-code2video-and-ugc-production-playbook.md) — 贯通四轨视频产线、预演锁镜与引擎六闸门验收闭环
