Hera Agent Unity — MCP server for Claude Code
A local MCP server that hands your coding agent a running Unity Editor: compile state, Console, Scene and components, then changes and verification.
claude mcp add --env HERA_MCP_ENABLED=<HERA_MCP_ENABLED> --transport stdio hera-agent-unity -- npx -y hera-agent-unityWhat Hera Agent Unity does
This MCP server sits between your agent and a live Unity Editor. The agent asks the Editor what happened instead of inferring it from C# files: compile state, Console output, the open Scene, GameObjects, serialized component values. Then it acts — spawns and parents objects, edits components, moves assets under Assets/.
Startup is npx -y hera-agent-unity; nothing else has to stay running. A closed Editor gets booted by editor launch with --project, which reads the version from ProjectSettings/ProjectVersion.txt and finds the Hub install through UNITY_HUB_EDITOR or the platform default (%ProgramFiles%\Unity\Hub\Editor on Windows). Point --hub-root at a Hub kept elsewhere.
Unity 6000.6 or newer is the floor, older Editors will not do. Beyond edits, the agent runs EditMode and PlayMode tests, enters Play Mode, captures Scene and Game views, and synthesizes Input System input. Destructive calls get a preflight check and need the matching approval token — worth keeping on for a real project.
What it helps with
- find out a change broke compilation before hitting Play
- read Console errors without switching back to the Editor
- build a uGUI layout and see how it actually renders
- run PlayMode tests and fix the ones that fail
- launch the right Editor at the version recorded in
ProjectSettings/ProjectVersion.txt
Example prompts for the agent
- Check whether the Editor compiled the project and show me what is in the Console.
- Build the
Mainscene with a Canvas and one button, then capture the Game view so I can compare it to the mock. - Run the PlayMode tests, fix whatever failed and rerun until they pass.
How to install Hera Agent Unity
Platform CLI
claude mcp add --env HERA_MCP_ENABLED=<HERA_MCP_ENABLED> --transport stdio hera-agent-unity -- npx -y hera-agent-unityReplace <…> with your own values
Platform CLI
codex mcp add hera-agent-unity --env HERA_MCP_ENABLED=<HERA_MCP_ENABLED> -- npx -y hera-agent-unityReplace <…> with your own values
Config file
{
"mcpServers": {
"hera-agent-unity": {
"command": "npx",
"args": [
"-y",
"hera-agent-unity"
],
"env": {
"HERA_MCP_ENABLED": "<HERA_MCP_ENABLED>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"hera-agent-unity": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"hera-agent-unity"
],
"env": {
"HERA_MCP_ENABLED": "<HERA_MCP_ENABLED>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e HERA_MCP_ENABLED=<HERA_MCP_ENABLED> hera-agent-unity npx -y hera-agent-unityReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Hera Agent Unity
How do I install Hera Agent Unity in Claude Code?
Run claude mcp add hera-agent-unity -- npx -y hera-agent-unity. The server then shows up among your MCP servers, ready to query the Editor.
What does Hera Agent Unity do?
It gives an agent access to a running Unity Editor: compile state, Console, Scene and component reads, tests, Play Mode and view captures. Results come back as facts from your project.
Which Unity version does it need?
Unity 6000.6 or newer, with the Editor running. If it is closed, editor launch --project starts the project at the version from ProjectSettings/ProjectVersion.txt.