Unity-MCP
If you are the rightful owner of Unity-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Unity-MCP is a bridge between LLM and Unity, allowing for integration and automation of Unity tools through AI clients.
Unity MCP (AI Connector)
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.
AI Tools
Unity-MCP supports a wide range of tools. Each tool is a small connector between LLM and Unity Engine. You may create your own tools
by using API, take a look at add custom tool.
Here is the list of default AI tools. All of them are available after installation Unity-MCP into your project.
Legend: ✅ = Implemented & available, 🔲 = Planned / Not yet implemented
GameObject
GameObject.Components
Editor
Editor.Selection
Prefabs
Package
|
Assets
Scene
Materials
Shader
Scripts
Scriptable Object
Debug
Component
|
Installation
- Open command line in Unity project folder
- Run the command
openupm add com.ivanmurzak.unity.mcp
Usage
- Make sure your project path doesn't have a space symbol " ".
- ✅
C:/MyProjects/Project
- ❌
C:/My Projects/Project
- Open Unity project, go 👉
Window/AI Connector (Unity-MCP)
.
- Install MCP client
- Install Cursor (recommended)
- Install Claude
- Sign-in into MCP client
- Click
Configure
at your MCP client.
- Restart your MCP client.
- Make sure
AI Connector
is "Connected" or "Connecting..." after restart. - Test AI connection in your Client (Cursor, Claude Desktop). Type any question or task into the chat. Something like:
Explain my scene hierarchy
Add custom tool
⚠️ It only works with MCP client that supports dynamic tool list update.
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:
- To have a class with attribute
McpPluginToolType
. - To have a method in the class with attribute
McpPluginTool
. - [optional] Add
Description
attribute to each method argument to let LLM to understand it. - [optional] Use
string? optional = null
properties with?
and default value to mark them asoptional
for LLM.
Take a look that the line
MainThread.Instance.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 efficiency purpose.
[McpPluginToolType]
public class Tool_GameObject
{
[McpPluginTool
(
"MyCustomTask",
Title = "Create a new GameObject"
)]
[Description("Explain here to LLM what is this, when it should be called.")]
public string CustomTask
(
[Description("Explain to LLM what is this.")]
string inputData
)
{
// do anything in background thread
return MainThread.Instance.Run(() =>
{
// do something in main thread if needed
return $"[Success] Operation completed.";
});
}
}
Add custom in-game tool
⚠️ Not yet supported. The work is in progress
Running PlayMode tests
To be able to run Play Mode tests via the TestRunner MCP tool, you should consider configuring Unity to not perform a domain reload when entering Play Mode (Edit -> Project Settings -> Editor -> Enter Play Mode Settings
- set to Reload Scene only
or Do not reload Domain or Scene
). Otherwise, starting the Play Mode tests will interrupt the TestRunner MCP tool, leading to a cycle of tests restarting.
Contribution
Feel free to add a new tool
into the project.
- Fork the project.
- Clone the fork and open the resulting folder in Unity.
- Implement the new
tool
in your forked repository. - Create Pull Request into original Unity-MCP repository.