unity

unity

Enables AI assistants to control the Unity Editor via MCP, allowing scene manipulation, asset management, compilation, and testing through natural language.

Category
访问服务器

README

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

Or for a specific version:

https://github.com/simonwittber/AgentBridge.git#v0.1.0

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

3. 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 status

Expected output:

{
  "cmd": "status",
  "status": "ok",
  "uptime_s": 42.3,
  "queued": 0,
  "busy": false
}

Requirements

  • Unity 6000.0 or later
  • Go 1.25+ (only needed to build from source)

Built-in commands

Core

Command Description
status Bridge liveness, uptime, queue depth
compile Request script compilation; returns structured errors and warnings
refresh Trigger AssetDatabase.Refresh() and wait for completion
commands List all available commands and their arguments

Scene

Command Description
scene_info Name, path, dirty flag, root count
scene_open Open a scene by asset path
scene_save Save the active scene
scene_new Create a new empty or default scene

Hierarchy & objects

Command Description
hierarchy Scene tree as JSON (configurable depth)
object_find Find a GameObject by path; returns components
objects_find Find all objects with a given component type
object_create Create a GameObject or primitive
object_delete Delete a GameObject
object_active Activate or deactivate a GameObject
object_rename Rename a GameObject
object_select Select one or more objects in the editor

Components & assets

Command Description
component_get Get all serialized fields of a component
component_set Set a serialized field on a component
component_add Add a component by type name
prefab_open Open a prefab in prefab stage
prefab_save Save and exit the current prefab stage
asset_info GUID and importer settings for an asset
asset_set Set an importer field and reimport
asset_find Find assets by type / label filter
material_get Get all shader properties of a material
material_set Set a shader property on a material

Editor & console

Command Description
console_logs Recent Unity console messages (ring buffer, newest first)
play_mode Enter, exit, or query play mode
menu_item Invoke a Unity menu item by path
run_tests Run edit-mode or play-mode tests; returns pass/fail/skip
uuid Generate a UUID v4

Adding custom commands

Implement IAgentCommand in any Editor assembly:

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 void Execute(string uid, string requestJson)
    {
        AgentBridge.NewWriter(uid, Cmd)
            .Set("echoed", requestJson)
            .Send("ok");
    }
}

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.


LLM Agent Log window

Open via Window → General → LLM Agent Log. Live scrolling view of all commands and responses — green = ok, red = error.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选