Unity
Unity MCP is an MCP server implementation that connects your Unity Editor to Large Language Models.
It enables your LLM to execute commands to manage assets, manipulate scenes, write or modify C# scripts, and generally interact with the editor.
Features
- 🗣️ Natural Language Commands: You can instruct your connected LLM to perform various actions within the Unity Editor using plain English (or whichever language your LLM understands).
- 🛠️ Editor Toolset: The system provides the LLM with a suite of functions to interact with many parts of Unity – assets, scenes, C# scripts, materials, and even editor-level operations like saving the project.
- 🤖 Workflow Automation: Repetitive sequences of actions in Unity are good candidates for automation through LLM commands.
- 🧩 MCP Client Compatibility: It’s built to work with MCP clients, with specific support mentioned for Claude and Cursor, though others might be configurable.
Use Cases
- Rapid Prototyping: You could quickly scaffold parts of a scene or basic game mechanics. For instance, asking the LLM to “Create a new C# script named ‘PlayerMovement’, add variables for speed and jump height, and a basic Update method” could get you started faster.
- Batch Operations: If you need to perform the same action on multiple assets – say, renaming a batch of textures according to a pattern, or adjusting material properties across several items – you could formulate a command for your LLM to execute this, rather than clicking through the editor manually.
- Automated Testing Setups: You might use it to programmatically set up specific scene configurations or GameObject states before running automated tests, reducing manual setup time for test environments.
How To Use It
Getting Unity MCP up and running involves a couple of main components: a Unity package (the Bridge) that lives in your Unity project, and a Python server that runs locally. The LLM, through its MCP client, talks to the Python server, which then talks to the Unity Bridge.
Prerequisites:
- Git CLI: You need this to clone the server repository.
- Python: Version 3.12 or newer is specified.
- Unity Hub & Editor: Version 2020.3 LTS or a more recent version.
- uv (Python package manager): Install it with
pip install uv. - An MCP Client: Claude Desktop or Cursor are recommended. Others might work but could require more manual setup.
1. Install the Unity Package (Bridge)
- Open your Unity project.
- Navigate to
Window > Package Manager. - Click the
+icon, then selectAdd package from git URL.... - Input this URL:
https://github.com/justinpbarnett/unity-mcp.git?path=/UnityMcpBridge - Click
Add.
The documentation mentions that the MCP Server should be automatically installed as part of this process. This is a nice touch if it works smoothly.
2. Configure Your MCP Client
Option A: Auto-Configure (Recommended for Claude/Cursor)
- Inside Unity, go to
Window > Unity MCP. - You should see buttons like
Auto Configure ClaudeorAuto Configure Cursor. Click the relevant one. - A green status indicator (🟢) and a “Connected” message are what you’re looking for. This method tries to update your MCP Client’s configuration file directly.
Option B: Manual Configuration
If the auto-configure option doesn’t work, or if you’re using a different MCP client, you’ll need to edit the client’s configuration file by hand.
- Claude (macOS):
~/Library/Application Support/Claude/claude_desktop_config.json - Claude (Windows):
%APPDATA%\Claude\claude_desktop_config.json - You’ll need to check your specific client’s documentation for the exact location if it’s not Claude.
Windows:
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\UnityMCP\\UnityMcpServer\\src",
"server.py"
]
}
}
}macOS:
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/usr/local/bin/UnityMCP/UnityMcpServer/src", // Or ~/bin/UnityMCP/UnityMcpServer/src if you installed it there
"server.py"
]
}
}
}Linux:
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/home/YOUR_USERNAME/bin/UnityMCP/UnityMcpServer/src",
"server.py"
]
}
}
}Available Tools (Functions for your LLM):
read_console: To get messages from the Unity console or clear it.manage_script: For C# script operations – create, read, update, delete.manage_editor: To control or query editor state and settings.manage_scene: Scene operations like load, save, create, get hierarchy.manage_asset: Asset operations – import, create, modify, delete.manage_gameobject: For creating, modifying, deleting, finding GameObjects, and working with their components.execute_menu_item: Lets the LLM trigger Unity menu items by their path, like “File/Save Project”.
Usage:
- Open your Unity Project. The Unity MCP Bridge (the package you installed) should connect automatically. You can check its status via
Window > Unity MCP. - Start your MCP Client (Claude, Cursor, etc.). This should automatically launch the Python-based Unity MCP Server based on your configuration.
- Now, you’re able to issue commands to Unity through your LLM. For example, you could try:
Create a new C# script named 'EnemyAI' and add a public float variable called 'health'.
FAQs
Q: What if the Unity MCP window in Unity says “Disconnected” even after installation?
A: First, ensure your Unity Editor is actually open and running the project where you installed the Unity MCP Bridge package. Try restarting Unity. Also, check if there are any error messages in the Unity console that might give a clue.
Q: My MCP Client (Claude/Cursor) isn’t connecting, or the Python server doesn’t seem to start. What’s wrong?
A: The most common issue here is an incorrect path in your MCP Client’s JSON configuration. Double, triple-check that the --directory path for the UnityMcpServer/src folder is absolutely correct. If you’re unsure, navigate to that src directory in your terminal and try running uv run server.py directly. This will often show you any Python errors or other issues preventing the server from starting. On macOS or Linux, if you installed the server in a system-wide location like /usr/local/bin, it could be a permissions issue; the user running your MCP client needs to be able to execute uv and access those files. Sometimes installing it in your user’s ~/bin directory is easier.
Q: The ‘Auto Configure’ option failed. What now?
A: Fall back to the Manual Configuration steps. Auto-configure needs permission to write to your MCP client’s configuration file, and sometimes it doesn’t have it, or the client’s file structure might be unexpected. Manual setup gives you direct control.
Latest MCP Servers
Excalidraw
Claude Context Mode
Context+
Featured MCP Servers
Excalidraw
Claude Context Mode
Context+
FAQs
Q: What exactly is the Model Context Protocol (MCP)?
A: MCP is an open standard, like a common language, that lets AI applications (clients) and external data sources or tools (servers) talk to each other. It helps AI models get the context (data, instructions, tools) they need from outside systems to give more accurate and relevant responses. Think of it as a universal adapter for AI connections.
Q: How is MCP different from OpenAI's function calling or plugins?
A: While OpenAI's tools allow models to use specific external functions, MCP is a broader, open standard. It covers not just tool use, but also providing structured data (Resources) and instruction templates (Prompts) as context. Being an open standard means it's not tied to one company's models or platform. OpenAI has even started adopting MCP in its Agents SDK.
Q: Can I use MCP with frameworks like LangChain?
A: Yes, MCP is designed to complement frameworks like LangChain or LlamaIndex. Instead of relying solely on custom connectors within these frameworks, you can use MCP as a standardized bridge to connect to various tools and data sources. There's potential for interoperability, like converting MCP tools into LangChain tools.
Q: Why was MCP created? What problem does it solve?
A: It was created because large language models often lack real-time information and connecting them to external data/tools required custom, complex integrations for each pair. MCP solves this by providing a standard way to connect, reducing development time, complexity, and cost, and enabling better interoperability between different AI models and tools.
Q: Is MCP secure? What are the main risks?
A: Security is a major consideration. While MCP includes principles like user consent and control, risks exist. These include potential server compromises leading to token theft, indirect prompt injection attacks, excessive permissions, context data leakage, session hijacking, and vulnerabilities in server implementations. Implementing robust security measures like OAuth 2.1, TLS, strict permissions, and monitoring is crucial.
Q: Who is behind MCP?
A: MCP was initially developed and open-sourced by Anthropic. However, it's an open standard with active contributions from the community, including companies like Microsoft and VMware Tanzu who maintain official SDKs.



