
Hera Agent Unity
io.github.NotNull92由 GitHub 帳號 NotNull92 發布v0.2.17更新於 Nov 3, 2026
Control and verify a live Unity Editor through a local, low-token MCP server.
概覽
把 AI 程式助理連接到執行中的 Unity 編輯器,讓它能在本機檢查、修改、執行、測試並驗證專案。
- 可以做什麼
- 檢查編輯器狀態:版本、專案、編譯狀態與 Console 錯誤,並可啟動或重啟指定專案。
- 檢視與編輯場景:場景資訊、GameObject 搜尋、建立/複製/設定父層/刪除物件,讀取與修改元件。
- 處理資源與預製體:在 Assets 下尋找、建立、複製、移動或刪除資源,建立與編輯預製體。
- 創作內容:動畫片段、AnimatorController 狀態機、Timeline 軌道、uGUI 版面、專案設定與烘焙。
- 執行與驗證:EditMode/PlayMode 測試、Play 模式控制、截圖、uGUI 與 Input System 輸入模擬、效能分析讀取、建置。
- 擴充與批次處理:在編輯器中執行專案相關 C#、呼叫自訂專案工具、一次批次執行多個操作。
- 適用情境
- 適合助理撰寫 Unity C# 或建立 Unity 內容、需要從執行中的編輯器取得真實回饋而非只憑原始碼猜測的情境。可用於編譯—修正循環、測試驗證流程、依參考圖建立 UI,以及重現遊戲邏輯錯誤。
- 執行需求
- 在使用者機器上以本機程序執行,僅支援桌面端。需安裝 hera-agent-unity 命令列工具(npm 全域安裝或原生安裝腳本),並在 Unity 專案中加入 Hera Unity Connector 套件。支援 Unity 6.6 以上;Unity 2022.3 僅在開啟選用的 Developer Mode 後可用。宣告了選用環境變數 HERA_MCP_ENABLED。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Hera Agent Unity,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[Release] [GitHub stars] [License] [Go] [Unity] [Platform]
hera-agent-unity
Give your AI coding agent hands, eyes, and a checklist inside Unity.
Codex, Claude, Cursor, Copilot, AntiGravity, and other shell-capable agents can inspect your live Unity Editor, change it, run it, test it, see the result, and keep fixing until the evidence says it is done.
Start in 3 steps · What can it do? · Why Hera? · How good is it? · Examples · Commands
Hera in one minute
An AI can write Unity C# without Hera, but it cannot reliably know what your live Editor looks like after the code is written.
Normally the loop looks like this:
Hera closes that loop:
A simple way to think about it:
The AI is the brain. Hera gives that brain hands to operate Unity, eyes to inspect the result, and a checklist so it does not stop while the project is still broken.
Hera does not replace Unity and it does not replace the coding agent. It connects the two so the agent can work with facts from your actual project instead of guessing from source code alone.
What problem does it solve?
Unity development has a feedback loop that lives outside the source files.
A change can look correct in code and still fail because:
- Unity did not compile it;
- the wrong Scene is open;
- a GameObject or Component is missing;
- the Inspector has a different serialized value;
- a Unity API changed in your Editor version;
- the Console contains an exception;
- Play Mode behaves differently from Edit Mode;
- a button is visually present but cannot receive input;
- a UI layout is technically valid but looks wrong;
- the AI says "done" before it has actually checked any of those things.
Hera lets the agent ask the real Editor instead.
If the selected Editor is not running, Hera can bootstrap the exact project before Connector discovery:
The project version comes from ProjectSettings/ProjectVersion.txt; the
matching Unity Hub install comes from UNITY_HUB_EDITOR or the platform default
(%ProgramFiles%\Unity\Hub\Editor on Windows). Pass --hub-root for a custom
Hub location. Startup uses normal Package Manager behavior, not -noUpm, and
returns when the new process publishes that exact project's heartbeat. On
Windows, Hera also restores the standard common-profile environment for the
Unity child when an agent shell omitted it, so UPM path resolution still starts
with the same baseline as a normal desktop launch.
The important part is not the command names. The important part is that the agent can observe → change → run → verify → repair without making you act as the courier between the AI and Unity.
What can it actually do?
You can use Hera for tiny one-line checks or for a full AI-assisted Unity workflow.
In short, Hera is not just a "press Play" remote. It is a bridge for the whole edit-and-check loop around a running Unity project.
Why use Hera?
1. The AI can check its own work
Without Editor access, the agent often ends with:
"This should work."
With Hera, it can finish with evidence such as:
That difference is the main reason Hera exists.
2. You stop being the copy-and-paste bridge
You no longer need to repeatedly:
- copy code from the AI;
- switch to Unity;
- wait for compile;
- copy errors back;
- explain the Scene hierarchy;
- press Play;
- describe what happened.
The AI can perform most of that loop itself.
3. It works with the tools you already use
The normal production path is a CLI. Any agent that can run shell commands can use it.
- Codex
- Claude Code
- Cursor
- GitHub Copilot
- AntiGravity
- scripts and CI jobs
- your own automation
No Python server is required, and no host protocol has to be configured.
4. It is designed for AI context, not just humans
A giant tool response becomes more input for the model to read. Hera therefore gives common commands compact views such as IDs-only GameObject searches and on-demand tool schemas.
The goal is simple: send the agent the smallest amount of Unity state that is enough to make the next decision.
5. It knows that "request sent" is not the same as "work finished"
Unity recompiles scripts, reloads domains, changes ports, enters Play Mode, runs tests, and sometimes drops a connection while doing it.
Hera tracks these workflows instead of treating a successful HTTP send as proof that Unity is finished.
6. It can grow with your project
Start with the built-in commands. Later you can add a [HeraTool] for the workflow your own project repeats every day: build a dungeon room, validate a quest graph, bake a table, spawn a test battle, or check your studio-specific asset rules.
How good is it?
Hera avoids vague "AI magic" claims. The repository keeps concrete measurements and compatibility evidence instead.
Small responses for common agent reads
Measured low-token baselines for list --compact are about 93 estimated tokens across the tested Unity versions. find_gameobjects --ids measured 49 to 55 estimated tokens in the retained cross-version fixtures.
| Unity Editor | list --compact | find_gameobjects --ids |
| list --tool <name> --action <action> | Read only the selected action parameters, result and safety. |
|:---|---:|---:|
| 2022.3.62f2 | 93 T | 54 T |
| 2023.2.22f1 | 93 T | 54 T |
| 6000.3.5f2 | 93 T | 49 T |
| 6000.5.0f1 | 93 T | 55 T |
T is a simple ceil(UTF-8 bytes / 4) estimate for Hera's CLI payload only. It is not provider billing telemetry. Full methodology: token-reduction benchmark.
Developer Mode on Unity 2022.3
Connector 0.3.0 compiles on Unity 2022.3, but dispatched requests are refused by default with DEVELOPER_MODE_REQUIRED. Enable Developer Mode (Unity 2022.3) in Hera Settings or run hera-agent-unity asset-config developer-mode on; use off to disable it. asset-config developer-mode shows the value and asset-config --json includes developer_mode (read-only).
The setting applies to every Unity 2022.3 project on this machine. Unity 6.6+ ignores it. A missing file/key defaults to off; malformed or locked configuration reads keep the last good value until a successful refresh. Changes need no domain reload. Status and ping still work while locked; cached local-only catalog queries and validation can also succeed, but dispatched requests are refused.
This is an unsupported opt-in line. On 2022.3.62f2, scoped paths for TMP 3.0.7, Timeline 1.7.7, Input System 1.14.0 and AI Navigation 1.1.6 passed independent verification; the package-present Hera suite passed 51/51. Keyboard and mouse delivery matched the same probe on 6000.6.6f1 with Input System 1.20.0. See versions, paths and evidence. unity_docs uses the 6000.6 corpus: both its unity_version and docs_version describe documentation, so compare them with the Editor version in status. With test-framework older than 1.4.0, cancel cannot stop a run whose callback is active in this domain; it preserves its pending record until completion. Stale records without an active callback can still be released.
All other Editor lines (including 2023.x and 6000.0–6000.5) hit an explicit #error. This stops normal project compilation, and other compiler errors may appear alongside it. Remove the package or use one of the two allowed lines.
Compatibility is checked across Unity generations
Supported Unity versions are Unity 6.6+ (6000.6 minimum). The release compile gate installs the Connector's exact source as a normal UPM dependency in a disposable blank project of the representative Editor and requires a clean compile, a green release-gate suite, and zero console errors:
Connector 0.3.0 at 925e020 passed the required 6000.6.6f1 gate independently: clean normal/testables imports, unchanged catalog, and 48 tests passed with 0 failed and 1 Timeline skip in the blank template. Gate evidence. The released 0.3.0, which also carries the 0.2.14 scene save and Input System fixes, passed again: on 6000.6.6f1, 0 errors, no new warnings, unchanged catalog, 49 passed / 0 failed / 1 Timeline skip; on 2022.3.62f2 with Developer Mode on, 52/52 with the same input delivery. Release evidence.
Unity 6.6+ remains the supported line. Connector 0.3.0 also compiles on Unity 2022.3 behind the opt-in Developer Mode gate below. Its uGUI dependency resolves to the Editor's built-in version; the compile-time allow-list rejects other Editor lines. The package minimum alone does not enforce this boundary for git installs.
CLI and Connector versions are intentionally separate.
v0.2.0 was exercised in a live Editor, not only compile-tested
The final release candidate was loaded as Connector 0.0.86 in Unity 6000.5.6f1 with Input System 1.20.0 and driven through real Play Mode before release. The retained smoke evidence recorded:
- 31 tools / 80 actions from the live catalog;
- keyboard down/up and mouse position synthesis in Play Mode;
- a bounded input sequence completing successfully;
- an input recording with 5 events / 588 bytes, then two successful replays of the same file;
- zero Hera-owned controls left held after replay;
- Connector
ReleaseGateTests: 18/18 PASS; - Unity Console errors after the run: 0;
- graceful Editor shutdown with 0 new scene-recovery backups, while the disposable fixture manifest and lock file were restored.
This complements the five-version compile matrix with an end-to-end Editor regression on the released capability set.
A real game-creation run reached a verified playable result
The retained Crystal Forge scenario asked an AI to author code and tests, build UI, compile, drive Unity EventSystem input, run tests, capture the rendered result, and leave the Editor clean.
Final result: PASS after repair. First attempt: FAIL.
The measured execution window was 15 minutes 52 seconds. The run is useful because the failures were kept instead of being edited out. It showed why a closed verification loop matters: hidden state was correct before the UI was actually visible, and the agent had to observe, repair, and verify again.
This is not a claim that Hera makes every task succeed on the first try, and it is not an "X% smarter AI" benchmark. It demonstrates something more practical: Hera can give an agent enough real Editor feedback to find and repair integration failures instead of stopping at the first plausible answer.
Full evidence: Crystal Forge real-world benchmark.
How do I use it?
There are only two pieces:
Step 1. Install the CLI
The simplest cross-platform option is npm:
Or use the native installer.
Windows PowerShell
macOS / Linux
Check it:
Step 2. Add the Unity package
In Unity:
Paste:
Or add it to Packages/manifest.json:
The Connector starts automatically when the Editor opens.
To pin an existing Connector tag:
The current released Connector pin is:
Step 3. Open Unity and check the connection
You should see the real project path, Unity version, Editor state, and connection information.
Now you can simply tell your agent:
That is the normal Hera workflow.
What can I do with it?
Fix a compiler or runtime error
Typical commands behind the scenes:
Build a feature and prove it works
Reproduce a gameplay bug
Build UI from a reference image
Hera can give the agent a measurement loop instead of an eyeballing loop:
Example commands:
Use manage_ui, manage_components, and screenshot --overlay in small verified batches.
Verify buttons without guessing screen coordinates
This verifies Unity's EventSystem path. It is not a physical Windows/macOS mouse click, so Hera reports those two kinds of evidence separately.
Projects that already use the optional Input System package can also verify gameplay input without adding a Hera dependency:
Keyboard, mouse, bounded sequence, recording capture, and replay require Play Mode. Recordings use the bounded hera.input-recording/1 JSON format under the project or system temp directory; replay validates the complete file before mutation and reuses sequence-owned cleanup. Hera resolves the package at runtime, never creates devices, and releases any held controls when Play Mode exits.
Input System response values describe the player-side state at the end of the input update that applied the request's last change, preserved through settle_frames. press/click report the release update (pressed_after=false); down reports true. Each change waits up to 2000 ms for its configured update. Manual mode requires your project's own InputSystem.Update() pump; Hera does not pump it or change input policy. A missing update returns INPUTSYSTEM_INVOCATION_FAILED, while pause/exit use their existing Play Mode errors. When Unity is in the background with Run In Background off, player updates stop and INPUTSYSTEM_INVOCATION_FAILED results; focus Unity or enable Run In Background. See the Unity verification evidence and scope.
Sequence and replay group consecutive instantaneous steps connected by settle_frames=0 into one configured player input update, applying them in order and capturing once. press/click are group boundaries and keep their hold/release behavior. Nonzero settle counts still mean Editor updates, including the gaps loaded from recordings; they do not promise player-frame timing.
Automate repetitive Scene work
scene save rejects a dirty untitled Scene with SCENE_UNSAVED instead of opening a Save dialog. Save it once from the Editor, or create it with scene create <Assets/...unity> before editing. A clean Scene remains a no-op. Explicit generic menu/exec calls can still open modal dialogs.
You can ask an agent to:
- create a test arena;
- place prefabs under a new root;
- add and configure Components;
- create ScriptableObject assets;
- wire Animator states;
- save the Scene;
- run validation afterwards.
Create studio-specific tools
If your project has a repeated workflow, expose it as a custom [HeraTool]. The tool appears in Hera's live catalog automatically.
Examples:
build_test_battlevalidate_item_databasespawn_quest_fixturebake_localization_tablecheck_prefab_rules
Hera can therefore start as a generic Unity bridge and gradually become a CLI for your own game production pipeline.
Ultra Hera: make "done" mean checked
Ultra Hera is a verification rule for AI-assisted Unity work. It does not write the feature by itself. It tells the agent how carefully to check the work it just did through Hera.
Find it in:
Think of Light as a seatbelt check and Ultra as a pre-flight inspection.
Use Ultra when the request sounds like:
- "verify it exactly";
- "play it and confirm";
- "match this UI";
- "check the Inspector too";
- "do not finish until all tests pass".
The goal is simple: the agent should not close the task while Unity is still broken.
More than Editor control
Hera includes optional guidance and authoring systems that help the agent do more than change raw objects.
Game Feel Mode (Beta)
Helps the agent think about how gameplay feels, not only whether it functions: control feel and input forgiveness, the Update / FixedUpdate / LateUpdate split, screen shake, hit stop, knockback, camera, sound, reward presentation, haptics, session pacing, and accessibility constraints.
The knowledge is guidance. Hera does not secretly add heavy runtime systems to your game.
Game Feel UI Mode (Beta)
Adds practical UI feedback recipes such as hover scale, press squash, popup entrance, count-up text, health-bar response, cooldown feedback, and accessibility baselines.
Unity De-slop Mode (Beta)
Helps agents catch common generated-looking UI habits: unnecessary decoration, weak spacing systems, box-in-box layouts, decorative italics, inconsistent colors, and other visual tells.
The rules include exceptions so functional game UI such as inventory cells is not flattened just because it is repetitive.
Asset preferences and compiler defaults
Known assets such as Odin and DOTween can be enabled as preferences. Enabling one does not install it; it tells generated agent rules and AI JSON to prefer that API when the project actually contains it.
The compiler defaults are read by the next exec call, without restarting the
Editor. You can configure the same values from HeraAgent -> Hera Settings.
Command overview
You do not need to memorize these. They are here so you can understand the surface Hera gives an agent.
Full reference: docs/COMMANDS.md.
Teach your AI agent to use Hera automatically
You can put Hera's operating rules in the project so the agent knows to inspect Unity before guessing.
Codex plugin
Then open /plugins, choose Hera Agent Unity, and enable Hera Unity.
Standalone Agent Skill
Shared AGENTS.md
The compact default guidance is intentionally small. Its reviewed baseline is 2,315 UTF-8 bytes and contains the important rules for bootstrap, targeting, approvals, safety, and verification. The full guide is available on demand.
This repository also ships templates for Cursor, Copilot, AntiGravity, Continue, and other agent environments under examples/rules.
Safety and reliability in plain language
Hera can make real changes to a Unity project, so "fast" is not enough. It also needs to know when to stop.
It identifies the project, not just a port number
Unity can change its local port after a domain reload or restart. Hera prefers the normalized full project path as the Editor identity and treats the port as a temporary endpoint.
If several Editors are open, use:
Ambiguous targeting fails instead of guessing.
Risky operations can require approval
Approval-gated work is preflighted first. The returned token is tied to that exact request and is single-use. Changing the target or arguments invalidates the approval. In a shell or CI job you already trust, --yes (env: HERA_AGENT_APPROVE=1) answers the preflight in the same invocation instead of returning APPROVAL_REQUIRED — the preflight and the operation ledger still run.
It does not blindly repeat an uncertain mutation
If a response disappears during a reload or timeout, Hera checks fresh Editor ownership/state before an eligible retry. A mutation is not resent merely because the network response was unclear.
Slow tests can be resumed instead of started again
A long Test Runner job can outlive a normal request window. Hera stores durable run state so an agent can resume waiting for the same run instead of accidentally starting another test execution.
Unity versions
Version-specific behavior is checked against live Editors rather than assumed from one Unity version.
- Representative Editors follow the Unity series used by the author's game: currently 6000.6, represented by
6000.6.6f1. - Within two weeks of a new series' stable release, add a representative and run the Connector release gate; alpha and beta releases are not tracked. Until the gate passes, mark that series Checking.
- Game crunch takes priority: defer these checks during crunch and leave the series Checking.
- Raise the minimum only when the game moves to a new series or an actual case shows the old series blocking a necessary fix. Announce it one minor release ahead in this README and CHANGELOG, raise it in a Connector minor release, and list the last Connector tag supporting the old series here so users can pin
#connector-X.Y.Z.
One agent surface: the CLI
Hera is a plain command-line binary.
Any shell-capable coding agent can drive it, and every command answers with the same compact JSON envelope over the same catalog, approval flow, and operation ledger.
CLI v0.1.0-v0.2.x also carried an experimental, default-off, stdio-only MCP
adapter. It was removed in v0.3.0. The adapter sat in front of the same
execution core, so it never unlocked a Unity capability the CLI did not already
have, and keeping a second protocol surface meant a second discovery, approval,
and result path to maintain. Use the CLI directly: list to discover, call for
typed execution, exec when no dedicated command exists.
What Hera is not
- Not AI: the coding agent makes decisions; Hera provides access to the Editor.
- Not a game runtime tool: the Connector is Editor-only (
HeraAgent.asmdefincludes onlyEditor). - No second protocol: the CLI is the only agent surface; there is no MCP adapter or separate persistent or relay server alongside it.
- No real-time channel: every call is one request and one response; there are no progress streams or push notifications.
- No multi-Editor control in one command: each command targets one Editor; use
--projectto select it when several are open. - Not a sandbox:
execdefaults to Full Access; Restricted is one layer of defense.
New features require a reproduced failure. See Contributing.
Current release
- CLI / GitHub Release: v0.3.25 with five native binaries
- npm: 0.3.25 (
latest) - Unity Connector: 0.3.0 (pin with
#connector-0.3.0) - License: Apache-2.0
The npm publish is chained to the GitHub Release, so npm install -g hera-agent-unity and the GitHub binaries stay in step.
The two version numbers are separate on purpose. The CLI and the Unity package can evolve independently while keeping their compatibility contract explicit.
Upgrading from v0.2.x: v0.3.8 was the first published 0.3 release, so it also carries the breaking v0.3.0 changes. The experimental MCP adapter is gone: there is no mcp command and no HERA_MCP_* environment variable. A failed request now declares how it can be retried (retryable, state, retry_after_ms), and the heartbeat advertises the catalog schema hash so a matching catalog is reused without another round-trip. Connector 0.2.x requires Unity 6.6 (6000.6), and its instance_id values are 64-bit. The live catalog exposes 34 tools / 133 actions.
What's new since v0.2.17:
For release-by-release engineering detail, read CHANGELOG.md instead of treating the main README as a migration log.
How does Hera work internally?
The Unity package opens a local HTTP listener. The CLI selects the intended Editor from local heartbeat state and sends the command. Unity work is marshaled to the Editor main thread.
Domain reloads and long-running operations use filesystem-backed state so compilation, tests, and recovery can survive the HTTP listener being recreated.
Architecture details: docs/ARCHITECTURE.md.
Advanced exec, token, and async notes
- Prefer dedicated commands over arbitrary
execwhen one exists. - Use small projections such as
find_gameobjects --idswhen IDs are enough. - Side-effecting
execsnippets should normally returnnullor nothing rather than a large status object. - Do not return a full
UnityEngine.Objectunless you truly need its reflected graph. - Use
--strictor throw an exception when a logged error must fail the CLI operation. - Use
--security-mode restrictedwhen a snippet only needs platform APIs and should be denied file, network, process, reflection, native, threading,UnityEditor, and project-assembly access. Full Access remains the default. - Use
exec --checkwhen you want to compile-check a snippet without executing it. - Long asynchronous workflows are better represented as tracked
[HeraTool]actions or durable task/test operations than as detached work inside a one-shotexec.
The complete agent operating guide is AGENTS.md.
FAQ
Does Hera make the AI smarter?
No. Hera gives the AI better access to your real Unity state and better ways to verify the result. The coding model still makes the design and implementation decisions.
Does it need Python?
No. The normal install is one native CLI plus one Unity package.
Is a host protocol required?
No. The CLI is the only surface. It speaks localhost HTTP to the Unity package and nothing else.
Can it control more than one open Unity Editor?
Each command targets one Editor. If several are open, use the full --project path for the clearest selection. Hera tracks the selected project identity even if the local port changes.
Can it physically click the Unity window?
The input command sends Unity EventSystem events for uGUI QA and can synthesize optional Input System keyboard/mouse state in Play Mode. Both prove Unity-level behavior, not a physical operating-system click. Physical click evidence must be reported separately.
What should I do if it cannot connect?
Also check that the Unity package is installed and the Editor has finished compiling.
Where are the detailed docs?
Projects using Hera
https://github.com/user-attachments/assets/15d353e4-b7bb-4534-bbca-c27de0792147
NoMoreRolls - full Play Mode video from a Unity game built with Hera-assisted Editor work.
Author
Victor - Unity/C# developer with 6+ years of live-service MMORPG production experience.
GitHub: @NotNull92
Discord: Join the Hera community
Support
Hera is free and licensed under Apache-2.0. If it saves you time, you can support development:
License
來源:README.md,提交 e1c48ac
工具
0版本歷史
1- v0.2.17最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分