Navigation
Unity MCP Package: Seamless Control & Automation - MCP Implementation

Unity MCP Package: Seamless Control & Automation

Empower MCP clients like Claude Desktop & Cursor to control Unity Editor workflows seamlessly with our MCP server package—effortless automation, smarter collaboration." )

Developer Tools
4.5(180 reviews)
270 saves
125 comments

This tool saved users approximately 8516 hours last month!

About Unity MCP Package

What is Unity MCP Package: Seamless Control & Automation?

The Unity MCP Package acts as a bridge between Unity and Large Language Models (LLMs), enabling bidirectional communication via the Model Context Protocol (MCP). This open-source tool connects Unity’s C# environment with a Python server, allowing developers to automate workflows, manipulate assets, and programmatically control the Unity Editor. Think of it as a translator that lets AI-powered tools like Claude Desktop interact directly with your game engine projects.

How to Use Unity MCP Package: Step-by-Step Setup

To harness this power, follow these prerequisites and steps:

  1. System Check: Ensure Unity 2020.3 LTS+ (URP only), Python 3.12+, and the uv package manager are installed.
  2. Python Prep: Install via official downloads, making sure Python is added to your system PATH.
  3. uv Installation: Use platform-specific commands (e.g., brew install uv on Mac).
  4. Package Integration: In Unity’s Package Manager, add the GitHub URL https://github.com/justinpbarnett/unity-mcp.git.

Once set up, the server auto-starts when paired with MCP-compliant clients like Cursor or Claude Desktop.

Unity MCP Package Features

Key Features of Unity MCP Package: Beyond Basic Automation

Unlock these capabilities to streamline development:

  • Asset Alchemy: Programmatically import/export assets, generate prefabs, and tweak textures/materials.
  • Scene Sorcery: Dynamically load scenes, spawn objects, and modify component properties on-the-fly.
  • Script Surgery: Auto-generate C# code, update existing scripts, and validate syntax via LLM feedback.
  • Editor Puppeteer: Trigger builds, manage undo stacks, and toggle play modes without touching the UI.
  • Material Mastery: Adjust shader parameters, blend modes, and PBR properties through API calls.

Use Cases: Where Unity MCP Shines

Here’s how developers are leveraging this tool:

  • Automate asset pipeline workflows using LLM-generated scripts
  • Create procedural environments by translating natural language into scene configurations
  • Debug complex setups by having AI inspect and modify scene hierarchies
  • Prototype rapidly with voice-controlled editor interactions
  • Build AI-driven tools for level design or animation rigging

Unity MCP Package FAQ

FAQ: Common Questions About Unity MCP

Why does the server need Python?

Python acts as the intermediary "brain" connecting Unity’s C# environment with external LLM APIs, enabling cross-platform communication.

Can I use non-Claude LLMs?

Yes! Any MCP-compliant client (like Cursor or custom solutions) works - the protocol is open for integration with models like GPT or Bard.

What’s the biggest gotcha?

Ensure Unity’s URP is active - the package currently doesn’t support Legacy Lit shaders. Also, always test Python dependencies via uv check.

How stable is it?

While in early release, core features are battle-tested. Report edge cases via the GitHub issue tracker.

Content

Unity MCP Package

A Unity package that enables seamless communication between Unity and Large Language Models (LLMs) like Claude Desktop via the Model Context Protocol (MCP). This server acts as a bridge, allowing Unity to send commands to and receive responses from MCP-compliant tools, empowering developers to automate workflows, manipulate assets, and control the Unity Editor programmatically.

Welcome to the initial release of this open-source project! Whether you're looking to integrate LLMs into your Unity workflow or contribute to an exciting new tool, I appreciate you taking the time to check it out!

Overview

The Unity MCP Server provides a bidirectional communication channel between Unity (via C#) and a Python server, enabling:

  • Asset Management : Create, import, and manipulate Unity assets programmatically.
  • Scene Control : Manage scenes, objects, and their properties.
  • Material Editing : Modify materials and their properties.
  • Script Integration : View, create, and update Unity scripts.
  • Editor Automation : Control Unity Editor functions like undo, redo, play, and build.

This project is perfect for developers who want to leverage LLMs to enhance their Unity projects or automate repetitive tasks.

Installation

To use the Unity MCP Package, ensure you have the following installed:

  • Unity 2020.3 LTS or newer (⚠️ Currently only works in URP projects)
  • Python 3.12 or newer
  • uv package manager

Step 1: Install Python

Download and install Python 3.12 or newer from python.org. Make sure to add Python to your system’s PATH during installation.

Step 2: Install uv

uv is a Python package manager that simplifies dependency management. Install it using the command below based on your operating system:

  • Mac :

    brew install uv
    
  • Windows :

    powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
    

Then, add uv to your PATH:

    set Path=%USERPROFILE%\.local\bin;%Path%
  • Linux :

    curl -LsSf https://astral.sh/uv/install.sh | sh
    

For alternative installation methods, see the uv installation guide.

Important : Do not proceed without installing uv.

Step 3: Install the Unity Package

  1. Open Unity and go to Window > Package Manager.
  2. Click the + button and select Add package from git URL.
  3. Enter: https://github.com/justinpbarnett/unity-mcp.git

Once installed, the Unity MCP Package will be available in your Unity project. The server will start automatically when used with an MCP client like Claude Desktop or Cursor.

Features

  • Bidirectional Communication : Seamlessly send and receive data between Unity and LLMs.
  • Asset Management : Import assets, instantiate prefabs, and create new prefabs programmatically.
  • Scene Control : Open, save, and modify scenes, plus create and manipulate game objects.
  • Material Editing : Apply and modify materials with ease.
  • Script Integration : Create, view, and update C# scripts within Unity.
  • Editor Automation : Automate Unity Editor tasks like building projects or entering play mode.

Contributing

I’d love your help to make the Unity MCP Server even better! Here’s how to contribute:

  1. Fork the Repository
    Fork github.com/justinpbarnett/unity-mcp to your GitHub account.

  2. Create a Branch

    git checkout -b feature/your-feature-name

or

    git checkout -b bugfix/your-bugfix-name
  1. Make Changes
    Implement your feature or fix.

  2. Commit and Push
    Use clear, descriptive commit messages:

    git commit -m "Add feature: your feature description"

git push origin feature/your-feature-name
  1. Submit a Pull Request
    Open a pull request to the master branch with a description of your changes.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it as you see fit. See the full license here.

Troubleshooting

Encountering issues? Try these fixes:

  • Unity Bridge Not Running
    Ensure the Unity Editor is open and the MCP window is active. Restart Unity if needed.

  • Python Server Not Connected
    Verify that Python and uv are correctly installed and that the Unity MCP package is properly set up.

  • Configuration Issues with Claude Desktop or Cursor
    Ensure your MCP client is configured to communicate with the Unity MCP server.

For more help, visit the issue tracker or file a new issue.

Contact

Have questions or want to chat about the project? Reach out!

Acknowledgments

A huge thanks to everyone who’s supported this project’s initial release. Special shoutout to Unity Technologies for their excellent Editor API.

Happy coding, and enjoy integrating LLMs with Unity!

Related MCP Servers & Clients