Skip to content

kevaldeepak/UnityBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation



🎮 UnityBridge

Give Claude direct access to your Unity Editor.

Read scenes, inspect GameObjects, write scripts, manage assets, control lighting, run tests, and automate your entire Unity workflow - all through natural conversation.

74 tools. 7 live resources. Zero external servers.


Quick Start · Features · Setup · Claude Code · FAQ


✨ What is UnityBridge?

UnityBridge is a Unity Editor plugin that runs a local MCP (Model Context Protocol) server directly inside your Editor process. Once connected, Claude can see and interact with your Unity project in real time - no copy-pasting code, no context switching.

You: "Find all GameObjects missing a Collider and add BoxColliders to them."
Claude: [calls find_gameobjects → add_component × N] ✓ Done. Added BoxCollider to 7 objects.

You: "Read PlayerController.cs and refactor the movement code to use the new Input System."
Claude: [calls get_script_contents → writes updated script] ✓ PlayerController.cs updated.

You: "What errors are in my Console right now?"
Claude: [calls manage_console] → 2 errors found: NullReferenceException in EnemyAI.cs line 47...

Everything runs locally. Your project data only leaves your machine as part of your normal Claude API conversation - the same as any other message you send.


⚠️ Experimental Software - Read Before Using

UnityBridge is experimental, pre-release software. Use at your own risk.

This plugin is under active development. By installing or using it you accept that:

  • It can crash. The Unity Editor may freeze, hang, or close unexpectedly while the plugin is running or while Claude is performing operations.
  • It can produce errors. Scripts may be written incorrectly, components may be misconfigured, scenes may end up in an unexpected state, packages may fail to install, or the editor may report compile errors that require manual cleanup.
  • It can lose data. Some operations (asset deletion, file overwrites, project setting changes) are not always undoable. Tools may behave differently across Unity versions, render pipelines, or installed packages.
  • It can drive unexpected actions. Claude is an LLM - it can misinterpret instructions, take destructive actions you didn't intend, or chain operations in ways you didn't anticipate.

Strong recommendations before using:

  1. Use version control (git) and commit before any non-trivial Claude session. This is the only reliable way to recover from a bad run.
  2. Back up important projects separately. Don't run this on a project you can't afford to lose.
  3. Try it on a throwaway test project first to learn its behaviour before pointing it at production work.
  4. Watch what Claude does. Don't approve sweeping changes you haven't reviewed.

If any of the above isn't acceptable for your workflow, do not install this plugin yet. Wait for a stable release.


🔑 License Key - Early Access (Free)

The store is currently under construction. While it's being set up, the plugin is available free of charge using the key below.

⚠️ This key is temporary. Once the store launches, it will be deactivated and a purchase will be required. Grab it now while it's free.

570734A3-5E61-4210-B6AA-7CA64EDA47C3

Paste this into Window → UnityBridge → Settings → Licence Key and click Validate Licence.


⚡ Quick Start

Get from zero to a working Claude ↔ Unity connection in under 5 minutes.

Prerequisites

Requirement Notes
Unity 2022 LTS or later Tested on Unity 6000.4.5f1 (Windows). Other versions may work.
Newtonsoft.Json (Json.NET) Install via Package Manager: com.unity.nuget.newtonsoft-json. Often already present.
Claude Desktop Free download - any plan works
Node.js LTS Required for the npx mcp-remote bridge. Download from nodejs.org
UnityBridge licence key Use the free early-access key above
Internet connection Required for first-time licence validation only (cached for 7 days after)

🛠️ Setup

Step 1 - Install the plugin

Via Unity Package Manager (recommended)

  1. Open your Unity project
  2. Go to Window → Package Manager
  3. Click +Add package from git URL
  4. Paste: https://github.com/CoplayDev/unity-bridge.git
  5. Click Add and wait for import to complete

Manual install

Copy the Assets/UnityBridge/ folder from this repo directly into your project's Assets/ folder.


Step 2 - Enter your licence key

Open Window → UnityBridge → Settings

  1. Paste 570734A3-5E61-4210-B6AA-7CA64EDA47C3 into the Licence Key field
  2. Click Validate Licence
  3. Wait a few seconds - you should see a green ✓ and Valid confirmation

Your licence key is stored per device in Unity's EditorPrefs - it is local to your machine and never committed to source control. On a shared machine, each developer should enter and validate their own key.


Step 3 - Start the server

The server starts automatically when the plugin loads. You should see ● Running in the Settings panel.

If it shows ○ Stopped, click Start Server. Then click Test Connection - you should see ✓ Connection successful.

The server listens on http://localhost:3333 by default. Change the port in Settings if 3333 is already in use.


Step 4 - Connect Claude Desktop

  1. Open Claude Desktop
  2. Go to Settings (the gear icon or Claude menu → Settings)
  3. Click DeveloperEdit Config

This opens the claude_desktop_config.json file directly. Add the following (or merge it in if the file already has content):

{
  "mcpServers": {
    "unity-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:3333/sse"
      ]
    }
  }
}

Restart Claude Desktop. UnityBridge will appear in the tools list (the 🔨 icon in the bottom-left of the chat window).


Step 5 - Try it out

Make sure a scene is open in Unity, then ask Claude:

"What's in my current scene?"

"Check the Console for errors."

"Create a Cube at (0, 1, 0) and add a Rigidbody to it."


🧰 Features

UnityBridge exposes 74 tools and 7 live resources across every major area of the Unity Editor.

📖 MCP Resources (always available, no tool call needed)

Resource What it returns
unity://editor_state Play mode, pause state, active scene
unity://editor_selection Currently selected GameObjects
unity://scene_info Active scene name, path, dirty flag, object count
unity://project_info Project name, Unity version, platform, render pipeline
unity://project_layers All defined layer names
unity://project_tags All defined tags
unity://console_errors Latest compiler/runtime errors

🛠️ Tool Categories

Category What you can do
Scene & GameObjects Read hierarchy, find/create/delete/rename/reparent objects, set transforms
Components Add, set properties, assign object references
Scripts Read, write, validate, diff, section-read, find-in-file, list all scripts
Assets Import, move, delete, create folders, manage prefabs, dependencies
Materials & Textures Create/modify materials, configure shaders, manage textures/sprites
Lighting Configure directional/point/spot lights, bake settings, reflection probes
Camera FOV, clipping, clear flags, Cinemachine virtual cameras
Physics Rigidbody, colliders, physics materials, raycasts, layer matrix
Audio Audio sources, clips, mixers, spatial settings
UI (uGUI) Create Canvas/Button/Text/Image/Slider/ScrollView, RectTransform, TMP
Animation Animator controllers, parameters, transitions, states, clips
Particles Emission, lifetime, speed, shape, colour per particle system
Particles, LOD & VFX LOD groups, Visual Effect Graph, tilemap management
Timeline Tracks, clips, playable directors
NavMesh Bake, agents, obstacles, areas
Profiler Start/stop sessions, read frame times, memory snapshots
Build Configure targets, run builds, read build reports
Packages Add, remove, list Unity packages
Addressables Manage groups, labels, mark/unmark assets
Tags & Layers Add/remove tags and layers
Git Status, add, commit, push, pull, fetch, log, diff, checkout, stash, branch
Console Clear, read, filter by log/warning/error
Batch Operations Edit multiple GameObjects in one call, find-and-replace across files
Reflection & Docs Inspect any C# type at runtime, fetch Unity API docs

💻 Claude Code Support

UnityBridge works with Claude Code (the CLI) as well as Claude Desktop.

Add the following to .claude/settings.json in your project root (or ~/.claude/settings.json globally):

{
  "mcpServers": {
    "unity-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:3333/sse"
      ]
    }
  }
}

❓ FAQ

Does my project data leave my machine?

Your scene data is sent to Anthropic's API as part of your Claude conversation - the same as any other message you send in Claude. The plugin itself runs entirely locally. No project data is sent to any UnityBridge server; the only external call the plugin makes is the licence key validation on startup.

Do I need a Claude subscription?

You just need Claude Desktop installed - any plan (including the free tier) works. UnityBridge connects through Claude Desktop's MCP support, so no separate API key or additional account is required.

Which Unity versions are supported?

Unity 2022 LTS and later, tested up to Unity 6. Unity 2021 may work but is not officially supported.

Can Claude break my project?

Yes - this is experimental software, treat it that way. Most GameObject and component operations register with Unity's Undo system, so Ctrl+Z covers a lot of cases. However, several operations are NOT undoable, including: asset deletion (delete_asset), script file writes/overwrites (write_script, apply_text_edits, replace_in_files), package install/remove, project setting changes, and anything that triggers a domain reload.

The plugin scope is limited to your Unity project folder - it cannot touch files outside Assets/ and ProjectSettings/. But that is plenty of room to break things.

Always commit to git before letting Claude do non-trivial work. That is your real safety net, not Ctrl+Z.

Can I use two Unity projects at the same time?

Yes - each open Unity project runs its own server. Set one project to a different port (e.g. 3334) in its Settings panel and update the Claude config accordingly.

The tools don't appear in Claude Desktop.
  1. Check the server is ● Running in Window → UnityBridge → Settings
  2. Click Test Connection - it should say ✓
  3. Verify claude_desktop_config.json has the correct entry (see Step 4)
  4. Fully quit and reopen Claude Desktop (not just the window - quit the app)
Is this affiliated with Unity Technologies or Anthropic?

No. UnityBridge is an independent plugin. It uses Anthropic's public Claude API and Unity's public Editor scripting API. It is not affiliated with, endorsed by, or supported by Anthropic or Unity Technologies.


🔧 Troubleshooting

Port 3333 already in use Change the port in Window → UnityBridge → Settings → Port, then update the http://localhost:XXXX/sse URL in your Claude config.

"Access denied" on Windows Run this in an Administrator Command Prompt:

netsh http add urlacl url=http://localhost:3333/ user=Everyone

Server stops after script compilation This is expected - Unity reloads the domain after compilation and the server restarts automatically within a few seconds. If it stays stopped, click Start Server manually.

Licence validation fails Check your internet connection. The validation result is cached for 7 days, so you only need connectivity once per week.


⚖️ Disclaimer & Limitation of Liability

UnityBridge is provided "AS IS" and "AS AVAILABLE", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, title, and non-infringement. The plugin is experimental, pre-release software and may contain bugs, defects, or other issues that cause crashes, data loss, project corruption, lost work, or other harm.

You use this plugin entirely at your own risk. You are solely responsible for:

  • maintaining backups and version control of any project you use it with;
  • reviewing and accepting (or rejecting) every action the plugin and Claude perform on your behalf;
  • ensuring the plugin's behaviour is appropriate for your particular project, Unity version, render pipeline, and installed packages;
  • complying with the licences and terms of service of Unity, Anthropic, and any third-party packages it interacts with.

To the maximum extent permitted by applicable law, in no event shall the author(s), contributors, copyright holders, or distributors of UnityBridge be liable for any direct, indirect, incidental, special, consequential, exemplary, or punitive damages - including but not limited to loss of data, loss of profits, loss of work, business interruption, project corruption, asset destruction, or computer failure - arising from or in any way connected with the use, misuse, or inability to use this plugin, even if advised of the possibility of such damages and regardless of the legal theory (contract, tort, negligence, strict liability or otherwise) on which the claim is based.

By installing, copying, or using UnityBridge you acknowledge that you have read this disclaimer, understood it, and agree to be bound by its terms. If you do not agree, do not install or use the plugin.

This plugin is not affiliated with, endorsed by, or supported by Unity Technologies or Anthropic. Unity®, the Unity logo, Claude™, and all related marks are trademarks of their respective owners.


Made for developers who'd rather talk to their engine than fight it.


UnityBridge is experimental software. Not affiliated with Unity Technologies or Anthropic.

About

Read scenes, inspect GameObjects, write scripts, manage assets, control lighting, run tests, and automate your entire Unity workflow - all through natural conversation.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors