Unity AI Bridge enables AI coding assistants to remotely control and interact with the Unity Editor through file-based IPC (no ports, firewalls, or network dependencies), providing 62 tools across 13 categories:
Scene Management: Create, open, save, unload, and list scenes; retrieve scene data and set the active scene.
GameObject Operations: Find, create, destroy, duplicate, modify, and parent/unparent GameObjects.
Component Management: Add, remove, get, list, and modify components on GameObjects.
Asset Management: Search, get, modify, move, copy, delete assets; create folders, materials, list shaders, and refresh the AssetDatabase.
Prefab Workflows: Create prefabs from GameObjects; open, save, close, and instantiate prefabs.
Scripting & Code Execution: Read, create, update, and delete C# scripts; dynamically compile and execute C# code via Roslyn.
Editor Control: Get/set play mode and pause state, manage editor selection, and retrieve console logs.
C# Reflection: Find and call any C# method (including private) across all assemblies.
Performance Profiling: Capture snapshots (FPS, memory, draw calls), stream multi-frame data with P95/P99 percentiles, analyze frame hierarchies, identify hotpaths, and track GC allocations.
Package Management: List, search, add, and remove UPM packages from registry, Git, or local sources.
Light Probes: Analyze lights, generate probe grids, bake lighting, clear probe groups, and configure bake modes.
Testing: Run EditMode/PlayMode tests with filtering by assembly, namespace, class, or method; retrieve detailed pass/fail results with logs and stack traces.
Extensibility: Add custom tools via
[BridgeTool]attribute with automatic discovery. Works with Claude Code, Cursor, GitHub Copilot, Windsurf, and Claude Desktop.
Allows remote control and automation of the Unity Editor, providing tools to manage scenes, game objects, assets, prefabs, and scripts, as well as access to the profiler and test runner.
Unity AI Bridge
Remote-control the Unity Editor from any AI IDE — no ports, no dependencies, just works.
https://github.com/user-attachments/assets/4e8b3f85-b209-406f-a96e-f8b8eddc9160
Why Unity AI Bridge?
Most AI coding assistants can read and write files, but they are blind to the Unity Editor — they can't inspect your scene, tweak materials, run tests, or profile performance. Unity AI Bridge gives AI full editor access.
Key Advantages
62 tools, 13 categories — Scene, GameObject, Assets, Prefab, Script, Profiler, LightProbe, Tests, and more. Covers the full editor workflow, not just file I/O.
File-based IPC, not WebSocket — No open ports, no firewall issues, no connection drops. Survives recompilation, play-mode transitions, and editor restarts gracefully.
Zero external dependencies — Pure Python stdlib CLI/MCP server, self-contained C# Unity package. No pip install, no npm, no Node.js runtime.
Every major AI IDE — Claude Code (Skill mode), Cursor, GitHub Copilot, Windsurf, Claude Desktop (MCP mode). One Unity plugin, all IDEs.
5-line extensibility — Add custom tools with
[BridgeTool]attribute. Auto-discovered, auto-serialized, auto-documented. No registration code needed.Production-tested — Built for and battle-tested in a large-scale open-world Unity game (50+ developers, 2M+ lines of C#).
vs Unity 6 AI Gateway
Unity 6.2 introduced an official AI Gateway with MCP support. Both projects share the same goal — giving AI agents editor access via MCP — but differ in important ways:
Unity AI Bridge | Unity 6 AI Gateway | |
Unity version | 2022.3 LTS+ | 6.2+ only |
Tool coverage | 62 tools across 13 categories | General-purpose (Scene, Assets, Script, Console) |
Deep tooling | Profiler (snapshot, hotpath, stream), LightProbe, Reflection, Package Manager | Not yet available |
IPC mechanism | File polling (~100ms) | Unix Socket / Named Pipe |
Extensibility |
| TBD |
In practice, the ~100ms file-polling latency is imperceptible because AI agent think-time dominates each round trip. File IPC also makes cross-process debugging trivial — just inspect the JSON files on disk.
Quick Start
AI-native project — Copy the prompt below and send it to your AI coding assistant. The setup guide is written for AI to follow — you don't need to run any commands yourself.
Help me install Unity AI Bridge by following this guide: https://github.com/butterlatte-zhang/unity-ai-bridge/blob/main/docs/SETUP.md
If you prefer manual setup:
Unity Package — In Unity: Window > Package Manager > + > Add package from git URL:
https://github.com/butterlatte-zhang/unity-ai-bridge.git?path=Packages/com.aibridge.unityOr manually copy
Packages/com.aibridge.unityfrom this repo into your project'sPackages/directory.IDE Integration — Copy
.claude/to your project root, then configure your IDE per docs/SETUP.md.
Supports: Claude Code (Skill mode), Cursor, GitHub Copilot, Windsurf, Claude Desktop (MCP mode).
Tool Categories
62 tools organized into 13 categories:
Category | Count | Tools |
Scene | 7 |
|
GameObject | 11 |
|
Assets | 11 |
|
Prefab | 5 |
|
Script | 4 |
|
Object | 2 |
|
Editor | 4 |
|
Reflection | 2 |
|
Console | 1 |
|
Profiler | 5 |
|
Package | 4 |
|
Light Probe | 5 |
|
Tests | 1 |
|
Architecture
┌──────────────────────────────────────────────────┐
│ AI IDE │
│ (Claude Code / Cursor / Copilot / Windsurf) │
└──────────┬────────────────────┬──────────────────┘
│ │
Skill mode MCP mode
│ │
▼ ▼
┌─────────────┐ ┌──────────────┐
│ bridge.py │ │ mcp_server.py│
│ (Python) │ │ (Python) │
└──────┬──────┘ └──────┬───────┘
│ │
└────────┬─────────┘
│
File-based IPC
(request / response)
│
▼
┌───────────────────────────────┐
│ Unity Editor Plugin │
│ (com.aibridge.unity) │
│ │
│ BridgePlugin ← polls files │
│ BridgeToolRegistry │
│ BridgeToolRunner │
│ [BridgeTool] methods │
└───────────────────────────────┘Dual-channel design: The same Unity plugin serves both Skill mode (direct CLI) and MCP mode (protocol server). Both 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.
Why file IPC? Unity's main thread is single-threaded and blocks during domain reload. File polling is the most reliable way to survive recompilation, play-mode transitions, and Editor restarts without losing messages.
Add Your Own Tools
Expose any static method to AI with a single attribute:
using UnityAiBridge;
[BridgeToolType]
public static partial class CustomTools
{
[BridgeTool("custom-greet")]
[System.ComponentModel.Description("Say hello")]
public static string Greet(string name = "World")
{
return $"Hello, {name}!";
}
}The bridge discovers tools at Editor startup via reflection. No registration code, no config files. Parameters are automatically mapped to JSON Schema for the AI to call.
Security
Unity AI Bridge runs entirely on your local machine. The file IPC channel is scoped to your user's temp directory, and no network listeners are opened.
See SECURITY.md for details.
Compatibility
Unity Version | Render Pipeline | Status |
2022.3 LTS+ | Built-in | Supported |
2022.3 LTS+ | URP | Supported |
2022.3 LTS+ | HDRP | Supported |
6000.x (Unity 6) | All | Supported |
Platforms: Windows, macOS
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Report bugs and request features via GitHub Issues
Submit pull requests against the
mainbranchAdd new tools by following the
[BridgeTool]pattern above
Acknowledgments
Unity AI Bridge is derived from Unity-MCP by Ivan Murzak (Apache License 2.0). See THIRD_PARTY_NOTICES.md for details.