
Unity MCP (Server + Plugin)

Unity Version | Editmode | Playmode | Standalone |
---|---|---|---|
2022.3.61f1 | |||
2023.2.20f1 | |||
6000.0.46f1 |
AI gate to Unity Editor and Unity player's build.
Supports custom tool
if any exists in your source code of a Unity project.
AI Tools
GameObject
Component
Prefabs
Editor
|
Assets
Scene
Materials
Scripts
|
Installation
- Open command line in Unity project folder
- Run the command
openupm add com.ivanmurzak.unity.mcp
Usage
- Go 👉
Tools/Unity-MCP/Server/Print Config
. It prints intoConsole
window in Unity Editor the json string. - Copy the json string.
- Insert the json string into your MCP Client app:
- Claude dekstop
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
Add custom tool
⚠️ Not yet supported. There is a blocker issue in
csharp-sdk
for MCP server. Waiting for solution.
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.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}'.";
});
}
Contribution
Feel free to add new tool
into the project.
- Fork the project.
- Implement new
tool
in your forked repository. - Create Pull Request into original Unity-MCP repository.
相关推荐
I find academic articles and books for research and literature reviews.
Confidential guide on numerology and astrology, based of GG33 Public information
Converts Figma frames into front-end code for various mobile frameworks.
Advanced software engineer GPT that excels through nailing the basics.
Take an adjectivised noun, and create images making it progressively more adjective!
Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.
Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.
Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx
Mirror ofhttps://github.com/agentience/practices_mcp_server
The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.
Mirror ofhttps://github.com/bitrefill/bitrefill-mcp-server
Reviews

user_Mmr1YH98
Unity-MCP is an invaluable tool for Unity developers. IvanMurzak has crafted an intuitive and powerful application that greatly streamlines project management. The easy-to-use interface and seamless integration with Unity make it a must-have for anyone looking to enhance their development workflow. Highly recommended!