How ivanmurzak/unity-mcp works
Unity-MCP connects AI agents to the Unity Editor and, optionally, a running game through MCP; its CLI offers terminal workflows alongside the plugin. The primary flow is an agent or CLI sending tool calls through a chosen MCP server to plugin-registered tools, which operate on Editor state and return results. RQL is a major query-and-mutate capability; other documented branches include code execution, tests, screenshots, generated Skills, runtime tools, extensions, and dependency resolution. Relationships beyond the README-described integration are limited because most implementation files were not sampled.
Main entry points: Startup.cs Unity Editor plugin · Rql.cs RQL tool · lib.ts CLI operations · index.ts Unity MCP CLI
Components 21
Agent connectivity
- Unity MCP CLI
cli/src/index.ts - CLI operations
cli/src/lib.ts - Tool transport
cli/src/lib/run-tool.ts - MCP server
Editor workflows
- Unity Editor plugin
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/Startup.cs - Editor tools
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/API/Tool/Script.Execute.cs - Scene workflows
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/API/Prompt/SceneManagement.cs - C# execution
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/CodeExec/Core/CodeRunner.cs - Test runs
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/API/Tool/Tests.Run.cs - Screenshots
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/API/Tool/Screenshot.cs - Generated Skills
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/API/SystemTool/Skills.Generate.cs
RQL and Unity data
- RQL tool
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/API/Tool/Rql.cs - RQL Editor API
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/Rql/RqlEditorApi.cs - RQL Unity engine
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/Rql/RqlUnity.cs
Runtime and extensions
- Game runtime tools
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Runtime/Data/ObjectRef.cs - Optional extensions
extensions/Animation/Packages/com.ivanmurzak.unity.mcp.animation/Editor/Scripts/Rql/UnityEngine_AnimationClip_Adapter.cs
Plugin support
- Dependency pins
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/DependencyResolver/NuGetConfig.cs - Dependency model
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/DependencyResolver/NuGetPackage.cs - Runtime log levels
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Runtime/Utils/LogLevel.cs - File log storage
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Runtime/Unity/Logs/FileLogStorage.cs
Other components
- AI agent
Connections 15
- AI agent → MCP server: calls tools
README.md - MCP server → Unity Editor plugin: routes tool calls
README.md - Unity Editor plugin → MCP server: registers tools
README.md - Unity MCP CLI → CLI operations: invokes operations
- CLI operations → Tool transport: runs tools
cli/src/lib.ts - Unity Editor plugin → Editor tools: exposes tools
README.md - MCP server → RQL tool: dispatches RQL calls
README.md - MCP server → C# execution: dispatches code calls
README.md - MCP server → Test runs: dispatches test calls
README.md - MCP server → Screenshots: dispatches screenshot calls
README.md - MCP server → Generated Skills: offers Skills
README.md - MCP server → Game runtime tools: calls game tools
README.md - RQL tool → RQL Editor API: uses Editor operations
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/Rql/RqlEditorApi.cs - RQL tool → RQL Unity engine: queries Unity state
Unity-MCP-Plugin/Packages/com.ivanmurzak.unity.mcp/Editor/Scripts/Rql/RqlUnity.cs - MCP server → Optional extensions: loads optional tools
README.md