> 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 Toolset 注册到引擎自带的 Model Context Protocol (MCP) 插件中，添加七个 Convai 专属编辑器操作，以及一组 Convai 技能文档，供已连接的编码代理读取和调用。安装 Convai 插件后，如果你希望 Claude Code 或 Cursor 等编码代理在 Unreal 项目中配置 Convai 角色、玩家和操作，而不是由你手动连接它们，请参阅本节。

{% hint style="info" %}
**开始之前：** AI 编码支持要求使用 **Unreal Engine 5.8 或更高版本** 并且仅在 **Editor** 构建中提供—— `ConvaiToolset` 模块在任何非 Editor 目标上都会导致构建错误。在 UE 5.0–5.7 中，插件仍可编译，但不包含 AI 编码工具。完整设置步骤请参阅 [AI 编码助手快速入门](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/quick-start.md) 。
{% endhint %}

### Convai Toolset 的新增功能

引擎自带的 `ModelContextProtocol` 插件已经为已连接的编码代理提供了用于编辑项目的通用 MCP 工具。Convai Toolset 在此基础上新增七个可由 AI 调用的编辑器操作—— `SetupConvaiCharacter`, `SetupConvaiPlayer`, `SetupConvaiPawnMovement`, `AddNavMeshVolumeForCurrentLevel`, `SetBlueprintPropertyAndPropagate`, `AddConvaiAction`和 `CreateConvaiActionHandler` ——并将它们注册到引擎的 `ToolsetRegistry` 插件中。各项操作及其参数说明请参阅 [Convai Toolset 参考](https://docs.convai.com/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`列出并读取这些文档。这些文档介绍了项目设置、MetaHuman 设置、操作和动态上下文等 Convai 工作流程，代理可以在调用工具集操作前查阅功能的工作方式。完整列表请参阅 [Convai AgentSkills](https://docs.convai.com/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 Code 使用 `CLAUDE.md` ——你可以选择添加其中包含由哨兵标记界定的 Convai 入门说明块。请参阅 [支持的编码代理](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/supported-coding-agents.md) 了解确切文件和各代理的行为。

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

打开 Convai 编辑器窗口，点击 **设置** 图标，然后选择 **设置 AI 编码（MCP）**。选择一个代理，设置选项，并在收到提示时重启编辑器。完整的操作指南和验证步骤请参阅 [AI 编码助手快速入门](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/ai-coding-assistant/quick-start.md) 。

### 这与角色自身的 MCP 连接并不相同

本节介绍在 Unreal Editor 中构建项目时，编码代理如何调用 Convai 的编辑器工具。这与 [MCP 服务器](https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
