Cover image
Try Now
2025-04-14

3 years

Works with Finder

1

Github Watches

0

Github Forks

6

Github Stars

Unity MCP (Server + Plugin)

openupm License Stand With Ukraine

Stats
Unity Version Editmode Playmode Standalone
2022.3.61f1 2022.3.61f1 2022.3.61f1 2022.3.61f1
2023.2.20f1 2023.2.20f1 2023.2.20f1 2023.2.20f1
6000.0.46f1 6000.0.46f1 6000.0.46f1 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

  • ✅ Create
  • ✅ Destroy
  • ✅ Add Component
  • ✅ Remove Component
  • ✅ Find by name (optional recursive)
  • ✅ Find by path (optional recursive)

Component

  • ✅ Get All from the project (optional search by substring)
  • 🔲 Remove
  • 🔲 Modify

Prefabs

  • ✅ Instantiate
  • 🔲 Create from scene

Editor

  • 🔲 Run Tests
  • 🔲 Start/stop Playmode in Editor

Assets

  • ✅ Search
  • 🔲 Import
  • 🔲 Read

Scene

  • ✅ Get hierarchy
  • 🔲 Create scene
  • 🔲 Save scene
  • 🔲 Open scene

Materials

  • 🔲 Create
  • 🔲 Update
  • 🔲 Assign to a Component on a GameObject

Scripts

  • 🔲 Create

Installation

  1. Install .NET 9.0
  2. Install OpenUPM-CLI
  • Open command line in Unity project folder
  • Run the command
openupm add com.ivanmurzak.unity.mcp

Usage

  1. Go 👉 Tools/Unity-MCP/Server/Print Config. It prints into Console window in Unity Editor the json string.
  2. Copy the json string.
  3. 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

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:

  1. To have a class with attribute McpPluginToolType.
  2. To have a method in the class with attribute McpPluginTool.
  3. [optional] Add Description attribute to each method argument to let LLM to understand it.
  4. [optional] Use 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}'.";
    });
}

Contribution

Feel free to add new tool into the project.

  1. Fork the project.
  2. Implement new tool in your forked repository.
  3. Create Pull Request into original Unity-MCP repository.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • 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.

  • 林乔安妮
  • A fashion stylist GPT offering outfit suggestions for various scenarios.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • rahulc0dy
  • 测试您的MCP服务器。

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

    Reviews

    3 (1)
    Avatar
    user_Mmr1YH98
    2025-04-16

    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!