> 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 或更高版本** 并且仅存在于 **编辑器** 构建版本中—— `ConvaiToolset` 模块在任何非编辑器目标上都会抛出构建错误。在 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 Toolset 添加了什么

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

该插件还随附 17 份技能文档，位于 `Content/Skills/` 插件自身内容中的，代理会通过工具集的 `AgentSkillToolset` (`ListSkills` 和 `GetSkills`）来列出并阅读这些文档。这些文档描述了诸如项目设置、MetaHuman 设置、动作和动态上下文之类的 Convai 工作流程，因此代理可以在调用工具集操作之前先查阅某项功能的工作方式。参见 [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 Toolset 参考</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 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.
