SuperAPI AI Directory

unity-ai-bridge

#️⃣ 🐍 🏠 🍎 🪟 - Control the Unity Editor from AI coding tools via file-based IPC.

Open website

About this tool

Purpose

Unity AI Bridge is designed to solve the problem that AI programming assistants cannot perceive the state of the Unity Editor. Most AI programming assistants can only read and write files, and cannot inspect scenes, adjust materials, run tests, or analyze performance. This tool provides AI with complete Editor access capabilities, enabling it to directly operate the Unity Editor.

Main Capabilities

  • 65 tools, 15 categories: Covers the complete Editor workflow including scenes, GameObjects, assets, prefabs, scripts, Profiler, light probes, screenshots, runtime, tests, and more.
  • File-based IPC: Does not use WebSocket, does not open ports, has no firewall issues, and no connection interruptions. It gracefully handles recompilation, play mode switching, and Editor restarts.
  • Zero external dependencies: A pure Python standard library CLI/MCP server, with a self-contained C# Unity package. No pip install, npm, or Node.js runtime required.
  • Supports mainstream AI IDEs: Claude Code (Skill mode), Cursor, GitHub Copilot, Windsurf, Claude Desktop (MCP mode). One Unity plugin adapts to all IDEs.
  • Extend with 5 lines of code: Add custom tools through the [BridgeTool] attribute, with automatic discovery, automatic serialization, and automatic documentation, no registration code required.
  • Production-validated: Built for and battle-tested in a large open-world Unity game (50+ developers, 2 million+ lines of C# code).

Usage

AI-native project setup

Copy the prompt provided by the project and send it to the AI programming assistant. The setup guide is written specifically for AI, with no need to manually run commands.

Manual setup

  1. Unity package installation: In Unity, open Window > Package Manager > + > Add package from git URL, and enter:https://github.com/butterlatte-zhang/unity-ai-bridge.git?path=Packages/com.aibridge.unity Or manually copy Packages/com.aibridge.unity from the repository to the project's Packages/ directory.
  2. IDE integration: Copy .claude/ to the project root directory, then configure the IDE according to docs/SETUP.md. Supports Claude Code (Skill mode), Cursor, GitHub Copilot, Windsurf, Claude Desktop (MCP mode).

Dual-channel design

The same Unity plugin serves both Skill mode (direct CLI) and MCP mode (protocol server). The two channels communicate through the same file-based IPC - a pair of request/response files on disk. No network sockets, no port conflicts, no firewall rules.

Beyond editing - AI as a game testing tool

Most Unity AI tools stop at file editing. Unity AI Bridge goes further, turning Claude Code (or any AI IDE) into a game testing tool.

AI playtest loop mode: act -> wait -> observe -> judge -> repeat

  • Act: runtime-invoke calls static methods to trigger game actions
  • Wait: wait_playmode.py / wait_compile.py handles timing
  • Observe: runtime-query reads MonoBehaviour fields + screenshot-capture obtains visual information
  • Judge: AI analyzes state/screenshots to decide pass/fail

Add custom tools

Expose any static method to AI through a single attribute. The bridge discovers tools via reflection when the Editor starts, with no registration code or configuration files required. Parameters are automatically mapped to JSON Schema for AI invocation.

Use Cases

  • Teams using AI programming assistants for Unity game development
  • Workflows that need AI assistance for scene inspection, material adjustment, and performance analysis
  • Developers who want to use AI for automated game testing
  • Large Unity projects (validated at the scale of 50+ developers and 2 million+ lines of code)

Limitations

  • Platform support: Windows, macOS
  • File-based IPC has about 100ms of file polling latency, but in actual use it is hard to notice because AI agent thinking time dominates
  • There are differences compared with Unity 6.2's official AI Gateway; the specific differences are not explained in detail in the materials
  • Security: runs entirely on the local machine, the file IPC channel is confined to the user's temporary directory, and no network listening is exposed

License and Source

Unity AI Bridge is derived from Ivan Murzak's Unity-MCP (Apache License 2.0). It is licensed under the Apache License 2.0. Contributions are welcome; see CONTRIBUTING.md for details. Report bugs and request features via GitHub Issues.