Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Unity MCP Server - AI agent integration for Unity Digital Twin simulations via MCP protocol
Jump to setup instructionsNo tool list is on record. This does not mean the server has no tools. Tools were not run.
No setup evidence yet No matching config or report on record. This does not mean the server is incompatible.
Same catalog task: Connect APIs & services.
MCP server for using Alchemy APIs
Same catalog task: Connect APIs & services.
MCP server for using the AMap Maps API
Same catalog task: Connect APIs & services.
Official MCP server for Anytype API
Fetched from the repository for this visit.
Give AI agents full control over your Unity Editor - scenes, GameObjects, components, simulation, digital twins, and more.
This open-source Unity package implements a Model Context Protocol (MCP) server that lets AI agents like Claude, Cursor, or any MCP-compatible client interact with Unity in real time. Built for any Unity project - including industrial digital twins, robotics simulation, and virtual commissioning.
Most MCP servers for Unity require you to edit Python code every time you add a new tool. This one doesn't. You define tools entirely in C# with a simple attribute - the Python server discovers them automatically:
[McpTool("Spawn an enemy at position")]
public static string SpawnEnemy(
[McpParam("Prefab name")] string prefab,
[McpParam("X position")] float x,
[McpParam("Z position")] float z)
{
// Your Unity code here - runs on main thread
}
That's it. No Python changes, no server restart, no tool registration. Just recompile in Unity and the AI agent sees your new tool.
Key advantages:
[McpTool] to any static method and it's available to AI agentsThis MCP package works standalone with any Unity project. When combined with the realvirtual framework (Unity Asset Store), you get additional MCP tools purpose-built for industrial digital twins and virtual commissioning:
drive_to, drive_jog_forward, drive_stop, drive_set_speedsensor_list, sensor_get, sensor_get_occupiedsignal_set_bool, signal_set_int, signal_set_floatik_get_state, ik_solve_target, ik_verify_fkThis enables AI agents to operate complete virtual factory simulations - move robots, control conveyors, read sensors, and interact with PLC programs in real time.
AI Agent (Claude Desktop / Claude Code / Cursor)
|
| MCP Protocol (stdio or SSE)
v
Python MCP Server --> github.com/game4automation/realvirtual-MCP
|
| WebSocket (JSON, Port 18711)
v
This Unity Package (C# WebSocket server + tool registry)
https://github.com/game4automation/io.realvirtual.mcp.gitUnity caches git packages by commit hash. To get the latest version:
If no update button appears, remove the lock entry for io.realvirtual.mcp from Packages/packages-lock.json and reopen Unity.
com.unity.nuget.newtonsoft-json)com.unity.recorder, installed automatically from the Unity Package Registry)After installing the Unity package:
git clone to download the Python server (~70 MB) into Assets/StreamingAssets/realvirtual-MCP/To update later, click Update Python Server (git pull) in the same popup.
You can also access setup via the Unity menu: Tools > realvirtual > MCP
If you prefer to set up manually or the automated setup doesn't work:
Clone the Python server repository:
cd <your-project>/Assets/StreamingAssets
git clone https://github.com/game4automation/realvirtual-MCP.git
To update later:
cd <your-project>/Assets/StreamingAssets/realvirtual-MCP
git pull
Copy a ready-to-use configuration from Tools > realvirtual > MCP > Copy MCP JSON. You can paste it into any MCP-compatible client after the Python server has been installed.
Alternatively, copy the following MCP.json and replace <your-project> with the absolute path to your Unity project (use forward slashes, including on Windows):
{
"mcpServers": {
"UnityMCP": {
"command": "<your-project>/Assets/StreamingAssets/realvirtual-MCP/python/python.exe",
"args": [
"<your-project>/Assets/StreamingAssets/realvirtual-MCP/unity_mcp_server.py"
]
}
}
}
Some clients use a different configuration filename or wrap server entries differently. The generated command and arguments remain the same.
The Python MCP server is available separately at github.com/game4automation/realvirtual-MCP.
This package runs a WebSocket server inside the Unity Editor. When an AI agent sends a tool call, the Python MCP server forwards it over WebSocket to Unity, which executes it on the main thread and returns the result.
Key components:
[McpTool] methods via reflection at startup[InitializeOnLoad])
The package includes 60+ tools organized by category:
| Category | Examples |
|---|---|
| Simulation | sim_play, sim_stop, sim_pause, sim_status |
| Scene | scene_hierarchy, scene_find, scene_get_info |
| GameObjects | game_object_create, game_object_destroy, game_object_rename |
| Components | component_get, component_set, component_add, component_remove |
| Transforms | transform_set_position, transform_set_rotation, transform_set_scale |
| Materials | material_set_color, material_get_color |
| Physics | physics_add_rigidbody, physics_add_collider |
| Prefabs | prefab_instantiate, prefab_find, prefab_open, prefab_save |
| Editor | editor_recompile, editor_read_log, editor_save_scene, editor_wait_ready |
| Screenshots | screenshot_editor, screenshot_game, screenshot_scene |
When used with the realvirtual framework, additional tools are available:
| Category | Examples |
|---|---|
| Drives | drive_list, drive_to, drive_jog_forward, drive_stop |
| Sensors | sensor_list, sensor_get, sensor_get_occupied |
| Signals | signal_list, signal_set_bool, signal_set_int, signal_set_float |
| IK | ik_get_state, ik_solve_target, ik_verify_fk |
Add [McpTool] to any public static string method. Tools are discovered automatically via reflection - no registration needed.
using realvirtual.MCP;
public static class MyTools
{
[McpTool("Get current time")]
public static string GetTime()
{
return $"{{\"time\":\"{System.DateTime.Now}\"}}";
}
[McpTool("Add two numbers")]
public static string Add(
[McpParam("First number")] float a,
[McpParam("Second number")] float b)
{
return $"{{\"result\":{a + b}}}";
}
}
Rules:
public static and return string (JSON)GetTime -> get_time)[McpParam("description")] on parameters for AI agent contextToolHelpers.FindGameObject(), ToolHelpers.Ok(), ToolHelpers.Error() for common patternsThe toolbar brain icon shows connection state:
| Color | Meaning |
|---|---|
| Gray | Server stopped |
| Yellow | Server running, no clients connected |
| Green | Client(s) connected |
| Orange | Unity compiling scripts |
The activity label next to it shows the currently executing tool with elapsed time.
The Python sidecar provides rescue tools that work even when the Unity Editor is completely frozen or dead - they run purely OS-side, without any Unity connection:
unity_kill - Force-kills the Unity Editor process of this project. Process-selective: only Unity.exe processes whose -projectpath command line matches the project are killed (including asset import workers). Other Unity instances and the Python server itself are never touched. Returns the killed PIDs.unity_restart - Kills the editor (same matching), waits until the PIDs are gone (max 15 s), then starts Unity again detached with -projectpath. The Unity exe path is remembered from the killed process; fallback is the Unity Hub installation matching ProjectSettings/ProjectVersion.txt. Follow up with editor_wait_ready.Honest editor status while the main thread hangs (the WebSocket heartbeat alone stays green because it is answered on a background thread):
unity_status reports main_thread_inactive_s and main_thread_alive (main thread pump inactivity, reported by the Unity heartbeat)editor_wait_ready returns {"status": "blocked", "main_thread_inactive_s": ..., "hint": "use unity_kill or unity_restart"} instead of ready when the main thread stays blockedTypical rescue flow after a freeze ("Hold on" dialog, tools timing out):
unity_status -> main_thread_alive: false
unity_restart -> kills + restarts the editor
editor_wait_ready -> wait until Unity is back
Known issue: the tool schema cache (tool_schema_cache.json) lives under Assets/StreamingAssets/realvirtual-MCP/. It is only rewritten when the tool schemas actually change, so reconnect loops no longer trigger Unity asset refresh cascades.
Server not starting
[MCP] log entriesTools not discovered
public static string with [McpTool] attributeTimeouts during play mode
component_set) don't work during play modeThe Python server that bridges MCP clients to this Unity package is maintained separately:
github.com/game4automation/realvirtual-MCP
It ships with an embedded Python 3.12 runtime and can be downloaded directly from the Unity toolbar popup.
This package is provided as-is with no support or service included.
For commercial customers of realvirtual, we offer professional services for digital twin development, virtual commissioning, and LLM/AI agent integration. Contact us at https://realvirtual.io for details.
MIT License - Copyright (c) 2026 realvirtual GmbH
See LICENSE.md for full text.
Loading reviews...
GitHub checked 136h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.