unity
Allows AI agents to drive the Unity Editor, including scene management, object manipulation, component editing, asset operations, prefab handling, console logging, play mode control, and test execution.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@unitycompile the current scripts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LLM Dev Tools
Unity Editor tooling for AI-assisted development. AgentBridge exposes a
file-based command protocol so external tools (Claude Code, scripts, CI) can
drive the Unity Editor — and MCP turns every command into a tool your LLM can
call directly.
Quickstart
1. Install the package
Window → Package Manager → + → Add package from git URL
https://github.com/simonwittber/AgentBridge.gitOr for a specific version:
https://github.com/simonwittber/AgentBridge.git#v0.1.02. Build the CLI
Download a pre-built binary from the latest release
and place it on your PATH. Or build from source:
cd path/to/AgentBridge/Harness~/dffrnt-agent
go build -o dffrnt-agent . # macOS / Linux
go build -o dffrnt-agent.exe . # Windows3. Wire into Claude Code
Add to .claude/settings.json inside your Unity project:
{
"mcpServers": {
"unity": {
"command": "dffrnt-agent",
"args": ["serve"]
}
}
}Run dffrnt-agent from your Unity project root, or pass --project <path> to
point it at the project directory.
4. Open Unity and verify
Start (or focus) your Unity project. In Claude Code, the unity MCP server
will appear in /mcp with all bridge commands available as tools.
5. Send your first command
dffrnt-agent statusExpected output:
{
"cmd": "status",
"status": "ok",
"uptime_s": 42.3,
"queued": 0,
"busy": false
}Related MCP server: MCP For Unity
Requirements
Unity 6000.0 or later
Go 1.25+ (only needed to build from source)
Built-in commands
Core
Command | Description |
| Bridge liveness, uptime, queue depth |
| Request script compilation; returns structured errors and warnings |
| Trigger |
| List all available commands and their arguments |
Scene
Command | Description |
| Name, path, dirty flag, root count |
| Open a scene by asset path |
| Save the active scene |
| Create a new empty or default scene |
Hierarchy & objects
Command | Description |
| Scene tree as JSON (configurable depth) |
| Find a GameObject by path; returns components |
| Find all objects with a given component type |
| Create a GameObject or primitive |
| Delete a GameObject |
| Activate or deactivate a GameObject |
| Rename a GameObject |
| Select one or more objects in the editor |
Components & assets
Command | Description |
| Get all serialized fields of a component |
| Set a serialized field on a component |
| Add a component by type name |
| Open a prefab in prefab stage |
| Save and exit the current prefab stage |
| GUID and importer settings for an asset |
| Set an importer field and reimport |
| Find assets by type / label filter |
| Get all shader properties of a material |
| Set a shader property on a material |
Editor & console
Command | Description |
| Recent Unity console messages (ring buffer, newest first) |
| Enter, exit, or query play mode |
| Invoke a Unity menu item by path |
| Run edit-mode or play-mode tests; returns pass/fail/skip |
| Generate a UUID v4 |
Adding custom commands
Implement IAgentCommand in any Editor assembly:
using System.Text.Json.Nodes;
using LLMDevTools;
using UnityEditor;
[InitializeOnLoad]
public class MyCommand : IAgentCommand
{
static MyCommand() => AgentBridge.Register(new MyCommand());
public string Cmd => "my_cmd";
public string Description => "Does something useful.";
public ArgSpec[] Args => new[]
{
new ArgSpec("message", "string", "", "Text to log"),
};
public JsonObject Execute(string uid, string requestJson)
{
var resp = AgentBridge.MakeResponse(uid, Cmd, "ok");
resp["echoed"] = requestJson;
return resp;
}
}Protocol
Commands are newline-delimited JSON written to Temp/agent_input:
{"uid":"a1b2c3d4","cmd":"compile"}Responses are appended to Temp/agent_output:
{"uid":"a1b2c3d4","cmd":"compile","status":"ok","session_id":1749123456789,"errors":[],"warnings":[]}Unity also writes Temp/agent_session every 5 seconds:
{"pid":12345,"state":"idle","active_scene":"Main","play_mode":false,"compile_errors":0,"written_at":1749123456789}dffrnt-agent reads this file to verify Unity is alive before sending any command.
Output rotates at 2 MB; input is truncated on Unity startup.
Testing
Unit tests (Go)
cd Harness~/dffrnt-agent
go test ./...End-to-end tests (MCP → Unity)
These tests spawn the installed dffrnt-agent binary (must be on PATH) and drive
it over the MCP protocol against a live Unity session. Build and install the binary
first, open the Example~ project in Unity, then:
cd Harness~/dffrnt-agent
UNITY_PROJECT=/path/to/AgentBridge/Example~ go test -v -run TestMCP -timeout 300sOn Windows (PowerShell):
$env:UNITY_PROJECT = "C:\path\to\AgentBridge\Example~"
go test -v -run TestMCP -timeout 300sIf UNITY_PROJECT is not set, the tests default to ../../Example~ relative to
the test directory. Tests are automatically skipped if Unity is not running or the
session file is missing or stale.
Note:
TestMCP_Refreshtriggers a fullAssetDatabase.Refresh()which can take 2+ minutes on a fresh project. Subsequent runs are much faster.
LLM Agent Log window
Open via Window → General → LLM Agent Log. Live scrolling view of all commands and responses — green = ok, red = error.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/simonwittber/AgentBridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server