# Hera Agent Unity

A local MCP server that hands your coding agent a running Unity Editor: compile state, Console, Scene and components, then changes and verification.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 29
- Author: NotNull92
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/NotNull92/hera-agent-unity
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/hera-agent-unity

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `HERA_MCP_ENABLED` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: Unity

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env HERA_MCP_ENABLED=<HERA_MCP_ENABLED> --transport stdio hera-agent-unity -- npx -y hera-agent-unity
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add hera-agent-unity --env HERA_MCP_ENABLED=<HERA_MCP_ENABLED> -- npx -y hera-agent-unity
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "hera-agent-unity": {
            "command": "npx",
            "args": [
                "-y",
                "hera-agent-unity"
            ],
            "env": {
                "HERA_MCP_ENABLED": "<HERA_MCP_ENABLED>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e HERA_MCP_ENABLED=<HERA_MCP_ENABLED> hera-agent-unity npx -y hera-agent-unity
```
Replace <…> with your own values

## When to use it
- 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
- Check whether the Editor compiled the project and show me what is in the Console.
- Build the `Main` scene 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.

## Similar
- [Pascal 3D Editor](https://affpapa.org/en/nevibecode/mcp/pascal-3d-editor.md) — MCP server · ★ 25085
- [Unity-MCP](https://affpapa.org/en/nevibecode/mcp/unity-mcp.md) — MCP server · ★ 4523
- [mcp](https://affpapa.org/en/nevibecode/mcp/sceneview-mcp.md) — MCP server · ★ 1348
- [Gearboy MCP Server](https://affpapa.org/en/nevibecode/mcp/gearboy-mcp-server.md) — MCP server · ★ 1219
- [ChiR24-unreal_mcp_server](https://affpapa.org/en/nevibecode/mcp/chir24-unreal-mcp-server.md) — MCP server · ★ 975
- [Nova3D](https://affpapa.org/en/nevibecode/mcp/nova3d.md) — MCP server · ★ 733

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
