Enables AI agents to query and control the Unity Editor, including scene hierarchy management, GameObject creation and modification, component control, prefab operations, asset browsing, play mode control, input simulation, animation control, material and shader manipulation, physics operations, and asset creation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Unity MCP Servercreate a cube at position (0, 2, 0) with a red material"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Unity MCP Server
A Model Context Protocol (MCP) server for Unity that enables AI agents to query and control the Unity Editor.
What is MCP?
MCP is an open standard by Anthropic that allows AI systems to access external tools and data. This package turns Unity into an MCP server, letting AI assistants like Antigravity, Claude, and Cursor query your scenes, assets, and execute editor commands.
Features
๐ฎ Scene Hierarchy - Query GameObjects, components, and structure
โ๏ธ Write Operations - Create, delete, and modify GameObjects in real-time
๐งฉ Component Control - Add, remove, and configure components
๐ฌ Scene Management - Open, save, create, and manage scenes
๐ท๏ธ Prefab Tools - Instantiate, create, and inspect prefabs
๐ฆ Asset Browser - List and search project assets
๐ Resource Access - Read scripts, prefabs, and ScriptableObjects
๐ Console Access - Read and clear Unity console logs
โ๏ธ Editor Control - Execute menu items, select objects
๐ง Compilation Status - Monitor build errors and warnings
๐ท Screenshots - Capture Game View or Scene View (v2.1)
๐ Project Search - Search by name, content, or references (v2.1)
โถ๏ธ Play Mode Control - Enter/exit/pause play mode (v2.1)
๐ฎ Input Simulation - Keyboard, mouse, and UI interactions (v2.1)
๐ Schema Support - Full JSON Schema for all tool parameters (v2.1)
๐ Secure - Localhost only, no external access
Installation
Via Git URL (Recommended)
Open
Window > Package ManagerClick
+>Add package from git URL...Enter:
https://github.com/usmanbutt-dev/unity-mcp.git
Quick Start
The server auto-starts when Unity loads
Open
Window > MCP Serverto view statusClick "Copy Config to Clipboard"
Paste into your MCP client's configuration file
Available Tools (52 Total)
GameObject Tools
Tool | Description |
| Create new GameObjects (primitives supported) |
| Delete GameObjects from scene |
| Set position, rotation, scale |
| Add components to GameObjects |
| Remove components |
| Set component property values |
Hierarchy Tools
Tool | Description |
| Get scene GameObject hierarchy |
| Get details of a specific GameObject |
| List components on a GameObject |
Prefab Tools
Tool | Description |
| Instantiate prefabs in scene |
| Get prefab structure |
| Create prefab from GameObject |
| Unpack prefab instances |
Scene Tools
Tool | Description |
| List all scenes in project |
| Open a scene |
| Save current scene |
| Create new scene |
| Close a scene |
| Set active scene |
Asset & Editor Tools
Tool | Description |
| List assets in a folder |
| Get project configuration |
| Get recent console logs |
| Clear the console |
| Execute a menu item |
| Select a GameObject |
| Get current selection |
| Get editor play/pause state |
Compilation Tools
Tool | Description |
| Get compile errors/warnings |
| Force recompilation |
| List project assemblies |
Screenshot & Search Tools (v2.1)
Tool | Description |
| Capture Game View or Scene View as base64 PNG |
| Search by name, content, or asset references |
Play Mode & Input Tools (v2.1)
Tool | Description |
| Enter play mode |
| Exit play mode |
| Pause/unpause play mode |
| Simulate keyboard input |
| Simulate mouse clicks |
| Click UI buttons/toggles by name |
Animation Tools (v2.2)
Tool | Description |
| Set bool/float/int/trigger parameters |
| Get animator state, parameters, layers |
| Play animation state by name |
Material & Shader Tools (v2.2)
Tool | Description |
| Get material properties and shader |
| Set color/float/int/vector properties |
| Assign material to renderer |
Physics Tools (v2.2)
Tool | Description |
| Cast ray and get hit info |
| Find colliders in radius |
| Apply force to Rigidbody |
Asset Creation Tools (v2.2)
Tool | Description |
| Create project folders |
| Create material assets |
| Create C# scripts with templates |
| Move/rename assets |
| Duplicate assets |
AI Context Tools (v2.2)
Tool | Description |
| Compact scene overview for AI |
| Get component properties schema |
| Discover Unity component types |
MCP Resources
The server also provides resource access via MCP resources protocol:
Scripts - Read C# source files
Scenes - Get scene metadata
Prefabs - Read prefab structure
ScriptableObjects - Read SO data as JSON
MCP Client Configuration
Add to your MCP client config (e.g., mcp_config.json):
Note: Use the "Copy Config to Clipboard" button in
Window > MCP Serverto get the correct path.
Example Queries
Once connected, ask your AI assistant:
"Create a red cube at position (0, 2, 0)"
"Add a Rigidbody to the Player object"
"What GameObjects are in my current scene?"
"Show me the components on the Player object"
"Open the MainMenu scene"
"What compilation errors do I have?"
Requirements
Unity 2021.3 or later
Node.js (for the MCP bridge)
Related Packages
Antigravity IDE Support - IDE integration for Unity
License
MIT License - see LICENSE