MCP Server + Plugin for Unity Editor and Unity game. The Plugin allows to connect to MCP clients like Claude Desktop or others.
Unity Version | Editmode | Playmode | Standalone |
---|---|---|---|
2022.3.61f1 | |||
2023.2.20f1 | |||
6000.0.46f1 |
Unity-MCP is a bridge between LLM and Unity. It exposes and explains to LLM Unity's tools. LLM understands the interface and utilizes the tools in the way a user asks.
Connect Unity-MCP to LLM client such as Claude or Cursor using integrated AI Connector
window. Custom clients are supported as well.
The project is designed to let developers to add custom tools soon. After that the next goal is to enable the same features in player's build. For not it works only in Unity Editor.
The system is extensible: you can define custom tool
s directly in your Unity project codebase, exposing new capabilities to the AI or automation clients. This makes Unity-MCP a flexible foundation for building advanced workflows, rapid prototyping, or integrating AI-driven features into your development process.
GameObject
GameObject.Components
Editor
Editor.Selection
Prefabs
|
Assets
Scene
Materials
Scripts
Scriptable Object
Debug
Component
Package
|
Legend: ✅ = Implemented & available, 🔲 = Planned / Not yet implemented
openupm add com.ivanmurzak.unity.mcp
- ✅
C:/MyProjects/Project
- ❌
C:/My Projects/Project
Window/AI Connector (Unity-MCP)
.
- Install Cursor (recommended)
- Install Claude
Configure
at your MCP client.AI Connector
is "Connected" or "Connecting..." after restart.Explain my scene hierarchy
tool
⚠️ Not yet supported. There is a blocker issue in
csharp-sdk
for MCP server. Waiting for solution. Please vote up for this issue and this to bring more attention to it. The custom tool is dependent on it.
Unity-MCP is designed to support custom tool
development by project owner. MCP server takes data from Unity plugin and exposes it to a Client. So anyone in the MCP communication chain would receive the information about a new tool
. Which LLM may decide to call at some point.
To add a custom tool
you need:
McpPluginToolType
.McpPluginTool
.Description
attribute to each method argument to let LLM to understand it.string? optional = null
properties with ?
and default value to mark them as optional
for LLM.Take a look that the line
=> MainThread.Run(() =>
it allows to run the code in Main thread which is needed to interact with Unity API. If you don't need it and running the tool in background thread is fine for the tool, don't use Main thread for efficience purpose.
[McpPluginToolType]
public class Tool_GameObject
{
[McpPluginTool
(
"GameObject_Create",
Title = "Create a new GameObject",
Description = "Create a new GameObject."
)]
public string Create
(
[Description("Path to the GameObject (excluding the name of the GameObject).")]
string path,
[Description("Name of the GameObject.")]
string name
)
=> MainThread.Run(() =>
{
var targetParent = string.IsNullOrEmpty(path) ? null : GameObject.Find(path);
if (targetParent == null && !string.IsNullOrEmpty(path))
return $"[Error] Parent GameObject '{path}' not found.";
var go = new GameObject(name);
go.transform.position = new Vector3(0, 0, 0);
go.transform.rotation = Quaternion.identity;
go.transform.localScale = new Vector3(1, 1, 1);
if (targetParent != null)
go.transform.SetParent(targetParent.transform, false);
EditorUtility.SetDirty(go);
EditorApplication.RepaintHierarchyWindow();
return $"[Success] Created GameObject '{name}' at path '{path}'.";
});
}
tool
⚠️ Not yet supported. There is a blocker issue in
csharp-sdk
for MCP server. Waiting for solution. Please vote up for this issue and this to bring more attention to it. The custom tool is dependent on it.
Feel free to add new tool
into the project.
tool
in your forked repository.