UE5 Editor Agent
Drive the Unreal Engine 5 editor from an LLM agent — no C++ plugin, no project
changes, nothing to install into your .uproject.
Tell it "add a point light at (500, 0, 300) and show me what it looks like" and it does it inside the running editor, then takes a screenshot so it can check the result itself.
It speaks over Epic's built-in Python Remote Execution channel, which is why there is no plugin to compile and no files dropped into your project. Works with DeepSeek / OpenAI / any OpenAI-compatible model, and exposes the same 31 tools as an MCP server, so Claude Code / Cursor / Codex can drive the editor too.
The agent can see its own work.screenshot spawns a temporary SceneCapture2D at your current viewport camera, renders into a transient TextureRenderTarget2D (never saved into the level), exports a PNG, then deletes the actor. No leftover actors, no dirty packages. Works without PIE and without the automation test framework. |
Install
pip install ue5-editor-agent # zero third-party dependencies
Or from source, to hack on it:
git clone https://github.com/rfioly/ue5-editor-agent
cd ue5-editor-agent && pip install -e .
What it can do
Beyond spawning and moving actors, it can rename and duplicate them, read and
write properties through dot paths (light_component.intensity), search assets
with class filtering, save the level on demand, and move the viewport camera onto
an actor — always with an explicit restore_viewport to put it back.
It works on assets, not just level actors: rename, duplicate and delete packages, inspect what an asset actually contains, and — critically — ask who references it before touching it. It works on material instances the same way: enumerate every parameter, write one instance and read every value back, or apply a shared set of values across dozens at once.
And it can act on whatever you have selected in the viewport
(get_selection → align_actors), which is the shortest path between a human
pointing at something and an agent changing it: no label needs to be typed out.
Destructive operations default to a dry run. Full list in docs/tools.md.
Quick start
1. Turn on the two switches in the editor
Edit → Plugins — enable Python Editor Script Plugin and
Editor Scripting Utilities.
Edit → Project Settings (Project Settings, not Editor Preferences) → search
Python → under Plugins → Python, tick:
- ☑ Enable Remote Execution?
- ☑ Develop Mode
Then restart the editor. It does not take effect without a restart.
2. Check the connection
ue5-agent check
连接成功 [ok]
engine_version: 5.8.2-56702186+++UE5+Release-5.8
project_name: <your project>
current_level: <level path>
actor_count: <actors in level>
is_mock: False
3. Give it a task
export LLM_API_KEY=sk-... # DeepSeek / OpenAI / any compatible endpoint
ue5-agent once "在场景里 (500, 0, 300) 加一盏点光源,然后截图给我看"
python run_demo_live.py # no API key needed — scripted model, real editor
python run_demo.py # fully offline: fake engine, fake model
run_demo_live.py swaps in a ScriptedLLM (a canned script) but leaves
everything else real: real tools, real transport, real editor. It will genuinely
modify your current level, and it deliberately scripts one wrong class name so you
can watch the agent read the error and correct itself.
python tests/run_all.py # 151 tests, zero dependencies
python eval/run_eval.py --self-test
ue5-agent --help # demo / check / once / chat
As an MCP server
{
"mcpServers": {
"ue5-agent": {
"command": "python",
"args": ["-m", "ue5_agent.mcp_server"],
"cwd": "<absolute path to the install>"
}
}
}
Two implementation notes: tool failures are reported with isError rather than as
JSON-RPC errors (so the model can read the message and self-correct), and nothing
is ever written to stdout except JSON-RPC.
Examples
Four short scripts in examples/ that do the things people actually ask
for, written as starting points rather than demos:
python examples/batch_rename_textures.py --folder /Game/Textures --from "^T_" --to "TEX_"
python examples/audit_material_params.py --folder /Game/Materials --param Roughness
python examples/align_selected_on_ground.py --mode min --apply
python examples/screenshot_after_change.py --actor DirectionalLight --intensity 12
They share one habit worth copying: the destructive ones default to a dry run, and
the one that moves the camera restores the previous camera position in a finally
block. tests/test_examples.py runs them so they cannot rot.
Verified
Measured against a live UE 5.8.2 editor on Windows 10, not a mock:
| Tools exercised end to end | all 31 |
| Tests | 151, zero third-party dependencies |
| CI | Windows + Linux × Python 3.9 / 3.11 / 3.13 |
| Lines of Python | ~8,400 across ue5_agent/ and tests/ |
Each tool's confirmed behaviour is listed in docs/tools.md; the 32 traps found along the way are in docs/pitfalls.md.
Not yet verified: more than one editor open at a time (the first discovered node wins), operations running for tens of seconds (timeout edges), and screenshots on levels other than the one test level (very large scenes may frame poorly on the bounding-box fallback).
How it works
The short version: the client pings over UDP multicast, the editor answers, and then — the part that surprises everyone — the editor connects out to the client's TCP server. Commands are self-contained Python snippets; results come back behind a sentinel prefix in the log stream.
There is a fake unreal module in tests/ so generated snippets can be executed
offline for real, which is the only thing that catches runtime errors without an
editor.
→ docs/architecture.md for the full picture, including
why the templates use string.Template instead of str.format, and why output
trimming happens in one place.
Two protocol traps, dug out of the engine source
MulticastBindAddress is used as three different things — bind address, join
interface, and egress interface — all from one value, which defaults to
127.0.0.1 in 5.8. So the editor only joins the multicast group on the loopback
NIC. This project matches that by also setting the outbound interface to loopback
(see build_strategies() in ue5_remote.py, which tries loopback-first, then
default, then each real NIC). If it ever stops connecting, set
Project Settings → Plugins → Python → Python Remote Execution → Advanced → Multicast Bind Address = 0.0.0.0 and restart.
Pong is broadcast back to the multicast group, not unicast to the requester. So
the client must issue IP_ADD_MEMBERSHIP itself and bind port 6766 — multicast
delivery matches on group address plus port. Binding a random port never receives
anything.
Both were found by reading PythonScriptRemoteExecution.cpp, which is also where
the inverted TCP direction comes from.
How this compares
| Approach | Channel | Plugin required | Notes |
|---|---|---|---|
| Epic's official Unreal MCP (built into 5.8) | HTTP + SSE 127.0.0.1:8000/mcp |
yes (ModelContextProtocol) |
Official, still early — 5.8.x has known editor crashes and silent data loss |
Most community MCPs (chongdashu/unreal-mcp, ChiR24/Unreal_mcp) |
C++ plugin + Python bridge | yes, compile it | Most capable; the cost is a compiled plugin in every project |
| This project | Python Remote Execution (built in) | no | Zero footprint: no .uproject edit, no files, no build |
"No plugin" is not "more powerful" — it buys near-zero setup cost and a project
that stays clean, at the price of the deep interfaces a plugin can offer (editing
Blueprint graph nodes directly, for instance). When you need those, run_python is
the escape hatch, or use a plugin-based project.
There was one earlier project on this channel, runreal/unreal-mcp (MIT), which
has not been updated since June 2025 and whose issues go unanswered. The point of
this project is to keep that channel maintained and to add the visual feedback loop
it never had.
Repository layout
ue5-editor-agent/
├── ue5_agent/
│ ├── tools.py 31 tools + validation + result trimming
│ ├── agent.py core loop, loop guards, trace recording
│ ├── llm.py OpenAI-compatible client + ScriptedLLM (zero deps)
│ ├── mcp_server.py MCP server over stdio, reuses the same tools
│ ├── cli.py demo / check / once / chat
│ └── backends/ remote_exec (real engine) / mock (offline)
├── ue5_remote.py Remote Execution client: discovery + TCP command channel
├── eval/ eval cases + runner (judged by engine state, not an LLM)
├── examples/ small runnable scripts
├── docs/ architecture / tools / screenshot / pitfalls
└── tests/ run_all.py + fake_unreal.py + 151 tests
Zero third-party dependencies — not even requests, all standard library. pytest tests/ works if you have pytest installed.
中文说明
用自然语言操作 Unreal Engine 5 编辑器的 AI agent。输入「在场景里加一盏灯,放到 (500,0,300)」这类指令,agent 会在编辑器里真实执行,而不是给出操作说明;需要确认结果时 它会自己截一张图来看。
已在真实 UE 5.8.2 + Windows 上实测。走 Epic 官方内置的 Python Remote Execution 通道
—— 不需要写 C++ 插件,不需要往 UE 项目里放任何文件,.uproject 一行都不用改。
pip install ue5-editor-agent
ue5-agent check # 连上编辑器
ue5-agent once "在场景里 (500,0,300) 加一盏点光源,然后截图给我看" # 需要 LLM_API_KEY
python run_demo_live.py # 没有 API Key 也能跑
python tests/run_all.py # 151 个测试,零依赖
编辑器侧只有两步:编辑 → 插件 勾上 Python Editor Script Plugin 与
Editor Scripting Utilities;编辑 → 项目设置(是项目设置,不是编辑器偏好设置)
搜 Python,勾上 Enable Remote Execution? 与 Develop Mode,然后重启编辑器。
- 工具全清单与每个工具的设计理由:docs/tools.md
- 架构、消息流、为什么模板不用
str.format:docs/architecture.md - 截图是怎么拍出来的,以及为什么
AutomationLibrary那条路是死路:docs/screenshot.md - 开发中踩过的 32 个坑:docs/pitfalls.md
- 版本历史:CHANGELOG.md
License
Apache-2.0. See LICENSE.
Metadata
Release files for ue5-editor-agent 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ue5_editor_agent-0.2.0.tar.gz | 100.5 kB | With provenance | Details for ue5_editor_agent-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ue5_editor_agent-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ue5_editor_agent-0.2.0-py3-none-any.whl |
Total release size: 177.0 kB
Release files / ue5_editor_agent-0.2.0.tar.gz
| Download URL | ue5_editor_agent-0.2.0.tar.gz |
|---|---|
| Size | 100.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf985120d899bd687ba448cd598a9b03fe142014f7f22c2c5a45b32dc92b5840
|
|
BLAKE2b-256 checksum How to use checksums |
b08c8425445cc346f5ce05fb503f9018bbc73a1cd9ac77a1dba86387d7ff2e82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / ue5_editor_agent-0.2.0-py3-none-any.whl
| Download URL | ue5_editor_agent-0.2.0-py3-none-any.whl |
|---|---|
| Size | 76.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
568b8a0357a28f542598522b926b64f56c311b3a0fbbccc66c1d2816c102dd2e
|
|
BLAKE2b-256 checksum How to use checksums |
89932a29e511ef3f8bef0c31cfbd00f0ff52e48f3f5467f5e0e432f2f553fbca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for ue5-editor-agent 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ue5_editor_agent-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.