Unity AI Bridge

io.github.butterlatte-zhang由 GitHub 帳號 butterlatte-zhang 發布v1.0.0更新於 Oct 24, 2026

Remote-control Unity Editor from any AI IDE via file-based IPC. 62 tools, zero dependencies.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

讓 AI 助理在本機遠端控制 Unity 編輯器:檢視場景、編輯資源與指令碼、執行測試、效能分析,並驅動播放模式測試。

可以做什麼
Unity AI Bridge 提供約 65 個 Unity 編輯器工具,涵蓋 Scene、GameObject、Assets、Prefab、Script、Editor、Reflection、Screenshot、Runtime、Console、Profiler、Package、Light Probe 與 Tests 等類別。助理可以開啟與儲存場景、建立或修改遊戲物件與元件、讀寫指令碼、擷取畫面、讀取主控台記錄、取得效能分析快照,並在播放模式下查詢或呼叫執行階段狀態。它與 Unity 外掛透過以檔案為基礎的 IPC 通訊,而非網路通訊埠,並同時支援 skill/CLI 模式與 MCP 模式。
適用情境
當助理需要深入 Unity 專案內部而不只是編輯檔案時使用:檢視或修改場景與預製物件、檢查編譯錯誤、執行 Unity 測試、進行效能分析,或執行自動化的「撰寫—測試—修正」播放測試循環。適用於 Windows 或 macOS 上的 Unity 2022.3 LTS 及更新版本專案。
執行需求
本機 Unity 專案需安裝 com.aibridge.unity 套件(透過 git URL 或複製套件目錄),並設定支援 skill 或 MCP 模式的 AI IDE。此橋接是純 Python 標準函式庫實作的 CLI/MCP 伺服器,不需要 pip、npm 或 Node.js 執行環境。未宣告任何帳號、API 金鑰、環境變數或標頭。
安裝前請注意
這些工具會寫入與刪除專案內容:指令碼、資源、預製物件、資料夾與遊戲物件都可能被建立、修改、移動或刪除,編輯器狀態、播放模式與套件安裝也可能被變更。反射與執行階段呼叫可以呼叫執行中專案的方法。它完全在本機執行且不開放網路監聽,但檔案 IPC 通道位於使用者暫存目錄中,任何能存取該目錄的程式都可能與之互動。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Unity AI Bridge,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

English | 中文

Unity AI Bridge

Remote-control the Unity Editor from any AI IDE — no ports, no dependencies, just works.

[Unity 2022.3+] [License: Apache 2.0] [GitHub stars] [Release] [Glama]

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

  • 65 tools, 15 categories — Scene, GameObject, Assets, Prefab, Script, Profiler, LightProbe, Screenshot, Runtime, 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 BridgeUnity 6 AI Gateway
Unity version2022.3 LTS+6.2+ only
Tool coverage65 tools across 15 categoriesGeneral-purpose (Scene, Assets, Script, Console)
Deep toolingProfiler (snapshot, hotpath, stream), LightProbe, Reflection, Package ManagerNot yet available
IPC mechanismFile polling (~100ms)Unix Socket / Named Pipe
Extensibility[BridgeTool] attribute — 5 linesTBD

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:

  1. 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.unity

    Or manually copy Packages/com.aibridge.unity from this repo into your project's Packages/ directory.

  2. 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

65 tools organized into 15 categories:

CategoryCountTools
Scene7scene-open, scene-save, scene-create, scene-list-opened, scene-get-data, scene-set-active, scene-unload
GameObject11gameobject-find, gameobject-create, gameobject-destroy, gameobject-modify, gameobject-duplicate, gameobject-set-parent, gameobject-component-add, gameobject-component-destroy, gameobject-component-get, gameobject-component-list-all, gameobject-component-modify
Assets11assets-find, assets-find-built-in, assets-get-data, assets-modify, assets-move, assets-copy, assets-delete, assets-create-folder, assets-refresh, assets-material-create, assets-shader-list-all
Prefab5assets-prefab-create, assets-prefab-open, assets-prefab-save, assets-prefab-close, assets-prefab-instantiate
Script4script-read, script-update-or-create, script-delete, script-execute
Object2object-get-data, object-modify
Editor4editor-application-get-state, editor-application-set-state, editor-selection-get, editor-selection-set
Reflection2reflection-method-find, reflection-method-call
Screenshot1screenshot-capture
Runtime2runtime-query, runtime-invoke
Console1console-get-logs
Profiler5profiler-snapshot, profiler-stream, profiler-frame-hierarchy, profiler-hotpath, profiler-gc-alloc
Package4package-list, package-search, package-add, package-remove
Light Probe5lightprobe-generate-grid, lightprobe-analyze, lightprobe-bake, lightprobe-clear, lightprobe-configure-lights
Tests1tests-run

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.


Beyond Editing — AI as Game Tester

Most Unity AI tools stop at file editing. Unity AI Bridge goes further — it turns Claude Code (or any AI IDE) into a game testing harness.

CapabilityTraditional AIWith Unity AI Bridge
Write C# code:white_check_mark::white_check_mark:
Check compilation errors:x::white_check_mark: console-get-logs
Enter / exit Play Mode:x::white_check_mark: editor-application-set-state
Trigger game actions:x::white_check_mark: runtime-invoke
Read runtime game state:x::white_check_mark: runtime-query
Take screenshots:x::white_check_mark: screenshot-capture
Full closed loop: Write → Test → Fix → Repeat:x::white_check_mark:

AI Playtest Loop

AI writes code → compiles → enters Play Mode → observes state → judges → fixes → repeats     ↑                                                                         │     └─────────────────── fully automated loop ────────────────────────────────┘

The pattern: Act → Wait → Observe → Judge → Repeat

  • Act: runtime-invoke calls static methods to trigger game actions
  • Wait: wait_playmode.py / wait_compile.py handle timing
  • Observe: runtime-query reads MonoBehaviour fields + screenshot-capture for visuals
  • Judge: AI analyzes state/screenshots to decide PASS/FAIL

Auto-Playtest Example | AI Closed-Loop Guide | Playtest Tool Reference


Add Your Own Tools

Expose any static method to AI with a single attribute:

csharp
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 VersionRender PipelineStatus
2022.3 LTS+Built-inSupported
2022.3 LTS+URPSupported
2022.3 LTS+HDRPSupported
6000.x (Unity 6)AllSupported

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 main branch
  • Add 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.

License

Apache License 2.0

來源:README.md,提交 546583b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分