butterlatte-zhang/unity-ai-bridge

๐ŸŽฎ Gaming
0 Views
0 Installs

๏ธ ๐Ÿ ๐Ÿ  ๐ŸŽ ๐ŸชŸ - Remote-control Unity Editor from any AI IDE via file-based IPC โ€” 62 tools across 13 categories, zero dependencies, supports Claude Code, Cursor, Copilot, Windsurf, Claude Desktop.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "butterlatte-zhang-unity-ai-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "butterlatte-zhang-unity-ai-bridge"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

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:

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

Related MCP Servers

3aKHP/prts-mcp

๐Ÿ ๐Ÿ“‡ โ˜๏ธ ๐Ÿ  - MCP Server for Arknights, querying the PRTS Wiki API and serving auto-synced operator archives and voice lines from game data. Designed for fan-creation (ๅŒไบบๅ‰ตไฝœ) AI agents. Python (stdio/Docker) and TypeScript (Streamable HTTP) implementations.

๐ŸŽฎ Gaming0 views
alex-gon/thegamecrafter-mcp-server

๐Ÿ“‡ โ˜๏ธ - Design, manage, and price tabletop games on The Game Crafter. Browse catalogs, create projects, upload artwork, get pricing.

๐ŸŽฎ Gaming0 views
antics-gg/antics-mcp

๐Ÿ“‡ โ˜๏ธ - Deploy a single-file HTML game to a shareable multiplayer URL with rooms, state sync, and leaderboards. No backend or player accounts.

๐ŸŽฎ Gaming0 views
beckettlab/beckett-godot-mcp

๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Beckett โ€” MCP for Godot: a zero-sidecar GDScript editor addon that serves MCP over Streamable HTTP from inside the Godot 4 editor (no Node/Python sidecar). Reflection over any class, validate-before-write GDScript, scene/script/resource authoring, and a runtime play-test loop (play, screenshot, input, assert). MIT.

๐ŸŽฎ Gaming0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

Last checked: 7/28/2026, 7:54:59 PM

Unclaimed listing (imported or pending owner verification). Claim it โ†’
โ˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.