> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant.md).

# AI 编码助手

将受支持的编码代理连接到 Unreal 编辑器，以便它为你设置 Convai 角色并读取 Convai 的技能库。

Convai Unreal Engine 插件会将 Convai 工具集注册到引擎自带的模型上下文协议（MCP）插件中，新增七个 Convai 专用编辑器操作以及一套 Convai 技能文档，连接的编码代理可以读取并调用这些文档。安装 Convai 插件后，当你希望由 Claude Code 或 Cursor 之类的编码代理在你的 Unreal 项目中为你设置 Convai 角色、玩家和动作，而不是由你手动搭建时，请使用本节。

{% hint style="info" %}
**开始之前：** AI 编码支持需要 **Unreal Engine 5.8 或更高版本** 并且仅存在于 **编辑器** 构建版本中—— `ConvaiToolset` 该模块在任何非 Editor 目标上都会抛出构建错误。在 UE 5.0–5.7 中，插件仍可编译，但 AI 编码工具并不存在。参见 [AI 编码助手快速入门](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/quick-start.md) 获取完整的设置流程。
{% endhint %}

### Convai 工具集新增了什么

引擎的 `ModelContextProtocol` 插件已经为连接的编码代理提供了用于编辑项目的通用 MCP 工具。在此基础上，Convai 工具集新增了七个可由 AI 调用的编辑器操作—— `SetupConvaiCharacter`, `SetupConvaiPlayer`, `SetupConvaiPawnMovement`, `AddNavMeshVolumeForCurrentLevel`, `SetBlueprintPropertyAndPropagate`, `AddConvaiAction`，以及 `CreateConvaiActionHandler` ——由引擎的 `ToolsetRegistry` 插件注册。参见 [Convai 工具集参考](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/convai-toolset-reference.md) 了解每个操作的作用及其参数。

插件还在 `Content/Skills/` 下随附了 17 份技能文档，位于插件自身内容中，代理可通过工具集的 `AgentSkillToolset` (`ListSkills` 和 `GetSkills`) 列出并阅读这些文档。这些文档描述了 Convai 的工作流，例如项目设置、MetaHuman 设置、动作和动态上下文，因此代理在调用工具集操作之前可以先查阅某个功能的工作方式。参见 [Convai AgentSkills](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/convai-agent-skills.md) 以查看完整列表。

### 受支持的编码代理

设置支持五种代理： `Claude Code`, `Cursor`, `VS Code`, `Gemini`，以及 `Codex`。每个代理都会获得自己的项目根上下文文件——例如 `CLAUDE.md` 适用于 Claude Code——如果你选择添加，还会带有一个由标记分隔的 Convai 导言块。参见 [受支持的编码代理](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/supported-coding-agents.md) 了解确切的文件以及各代理的行为。

### 将编码代理连接到你的项目

打开 Convai 编辑器窗口，点击 **设置** 图标，然后选择 **设置 AI 编码（MCP）**。选择一个代理，设置安装选项，并在提示时重启编辑器。参见 [AI 编码助手快速入门](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/quick-start.md) 获取完整的流程说明和验证步骤。

### 这与角色自己的 MCP 连接不同

本节讲的是在你使用 Unreal Editor 构建项目时，由编码代理调用 Convai 的编辑器工具。这与 [MCP 服务器](/api-docs/zh/convai-playground/character-customization/mcp-servers.md)是不同的话题，后者讲的是 Convai 角色在与玩家进行实时对话时调用外部 MCP 服务器。

### AI 编码助手页面

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>AI 编码助手快速入门</strong><br>打开“设置 AI 编码（MCP）”，选择一个代理，并端到端验证设置。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/quick-start.md">AI 编码助手快速入门</a></td></tr><tr><td><strong>受支持的编码代理</strong><br>查找五个受支持代理各自的上下文文件、终端支持和代理特定选项。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/supported-coding-agents.md">受支持的编码代理</a></td></tr><tr><td><strong>Convai 工具集参考</strong><br>七个可由 AI 调用的编辑器操作及其参数的参考。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/convai-toolset-reference.md">Convai 工具集参考</a></td></tr><tr><td><strong>Convai AgentSkills</strong><br>17 份随附技能文档及代理如何列出和读取它们的参考。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/convai-agent-skills.md">Convai AgentSkills</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
