unreal-ai-connection
AGENTS.md9 starsChanged 26 days agoMITView on GitHub
Context for any coding agent working on Unreal AI Connection: a UE 5.7 editor plugin plus a stdlib-only Python bridge that serves editor automation to MCP clients over 127.0.0.1:18888. The wire protocol is open MCP, so everything that ships stays vendor-neutral. Start here: read the "At a glance" section of docs/HANDOFF.md for the current state and open work. If a gitignored CLAUDE.local.md exists, read it too: it holds this machine's engine and host-project paths and the maintainer's standing permissions. CI…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,266 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- driving-unrealSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 5
Start here: read the "At a glance" section of docs/HANDOFF.md for the current state and open work.
- Distinctive: line 18
Verify every UE API against UE 5.7 source: before committing C++. Reviewer agents have asserted UE APIs that don't exist.
- Very specific: line 40
UE 5.7 protected members: use USoundCue::GetSubtitlePriority(), USoundWave::GetSampleRateForCurrentPlatform(), …
- Very specific: line 65
Add a closing note to docs/HANDOFF.md for any session that ships meaningful changes, and update its "At a glance" section.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Context for any coding agent working on Unreal AI Connection: a UE 5.7 editor plugin plus a stdlib-only Python bridge that serves editor automation to MCP clients over 127.0.0.1:18888. The wire protocol is open MCP, so everything that ships stays vendor-neutral.
Start here: read the "At a glance" section of docs/HANDOFF.md for the current state and open work. If a gitignored CLAUDE.local.md exists, read it too: it holds this machine's engine and host-project paths and the maintainer's standing permissions.
Layout
- C++ handlers:
UnrealAIConnection/Source/UnrealAIConnection/Private/MCP/Handlers/Handler_*.cpp, one MCP method each (GetMethodName()), registered in theReg.Register(...)block ofUnrealAIConnectionModule.cpp. Optional companion plugins (UnrealAIConnectionDMX,-Geometry,-NDisplay,-OCIO) register their own handlers the same way. - Bridge:
bridge/unreal_ai_connection_bridge.py.TOOLSis the advertised catalog;SYNTHETIC_TOOLSmaps the bridge-side tools (composed from existing handlers or run as editor Python) to their functions; everything else is forwarded to UE. - Catalog, three places:
TOOLS,UnrealAIConnection/Resources/mcp_manifest.jsonanddocs/TOOLS.md.tests/test_manifest_sync.pyandtests/test_catalog_sync.pyfail when they disagree with each other or with the C++ handlers. - Counts: the exact counts are
EXPECTED_*intests/conftest.py, tied to the code bytest_catalog_sync. Prose says "150+ tools"; exact numbers appear only in the README badge and Status row, thedocs/TOOLS.mdintro and the shipped metadata (.uplugin, manifest,.claude-plugin/*.json). - Reference:
docs/ARCHITECTURE.md(design and UE 5.7 API gotchas),docs/TOOLS.md(per-tool schemas and examples),docs/HANDOFF.md(state, runbook, closing notes).
House rules
- One handler, one
.cpp: a new native tool is a newHandler_*.cppplus oneexterndeclaration and oneReg.Register(...)line. Add leaves; leave the foundation alone. - Verify every UE API against UE 5.7 source before committing C++. Reviewer agents have asserted UE APIs that don't exist.
- Vendor-neutral copy in everything that ships: the
.upluginDescription, README, tool descriptions, metadata. Name MCP clients as examples, never as the target. - Feature branches and PRs only; the maintainer merges.
- Bot-review gate: after CI is green and before merging, read every bot review on the PR. Apply each finding as a follow-up commit on the branch, or dismiss it in a PR comment with a verifiable reason. A follow-up that only applies bot fixes surgically can merge without a second bot pass; new logic needs one.
- C++ is verified on a host build: CI and pytest never compile C++. A C++ PR merges only after a UE 5.7 host build (
Build.bat), an editor load and a smoke test (examples/smoke_test.pyagainst a live editor).
Checks before a PR
python -m pytest # bridge suite, no UE needed (Windows: py -m pytest)
python -m ruff check . && python -m ruff format --check .
python scripts/drift_sweep.py # stale counts and versions in docs and metadataCI runs all three on every PR, plus a job that builds the wheel and runs its unreal-ai-connection console script.
Traps
- Manifest "required" substring:
test_manifest_sync.pygreps the word "required" in manifest param descriptions. Word conditional params as "needed when X". call_uereturns{"jsonrpc", "id", "result"}or{"jsonrpc", "id", "error"}, never a top-levelok; branch on"error" in resp. Ontools/callthe bridge turns tool failures into results withisError: true(the error object as JSON text); only an unknown tool or a malformed request stays a JSON-RPC error.- Transport errors keep their code through synthetic tools: -32099 not reachable, -32098
ue_busy_timeout(the request was sent and may still apply), -32700 bad frame. Pass them through; don't remap to -32603. execute_unreal_python:result.outputis the traceback on failure, not stdout; capturedprint()output comes back inresult.stdout.unreal.log()goes toLogPython, read back withget_log_lines(seesynthetic_get_camera_transform).- UE 5.7 protected members: use
USoundCue::GetSubtitlePriority(),USoundWave::GetSampleRateForCurrentPlatform(),UTexture::GetCompositeTexture(); handler modules build with warnings as errors. The full list is under "UE 5.7 traps already mapped" indocs/HANDOFF.md. - Launching the editor from PowerShell: pre-quote a project path that has spaces inside the argument,
Start-Process '<UE>\Engine\Binaries\Win64\UnrealEditor.exe' -ArgumentList '"<path with spaces>\Project.uproject"'; otherwise UE opens the Project Browser and port 18888 never binds. A cold launch takes about 2 minutes to bind.
Registering the bridge
Claude Code, Copilot CLI and Cursor read the project's .mcp.json (copy examples/.mcp.json.example). Codex CLI:
codex mcp add unreal-ai-connection -- python <repo>/bridge/unreal_ai_connection_bridge.pyOn Windows, use py instead of python if python resolves to the Microsoft Store stub. Per-client guides: docs/setup/.
Briefing another agent
A coding brief that ships on the first try (proven with Codex and Copilot CLI):
- Name a template by file path and line range for the agent to mirror.
- Spell out the contract: return shapes, error versus success keys.
- Name the shortcut it must not take.
- Pin the test style: mock library and assertion style.
- Number the reading order.
Finishing a session
Add a closing note to docs/HANDOFF.md for any session that ships meaningful changes, and update its "At a glance" section. Closing notes record history: leave older ones as they are.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

