Unity MCP Server
Enables AI agents to query and control the Unity Editor, supporting scene management, GameObject manipulation, asset browsing, play mode control, and real-time editor operations through 52+ tools.
README
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 Manager - Click
+>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 status - Click "Copy Config to Clipboard"
- Paste into your MCP client's configuration file
Available Tools (52 Total)
GameObject Tools
| Tool | Description |
|---|---|
unity_create_gameobject |
Create new GameObjects (primitives supported) |
unity_delete_gameobject |
Delete GameObjects from scene |
unity_set_transform |
Set position, rotation, scale |
unity_add_component |
Add components to GameObjects |
unity_remove_component |
Remove components |
unity_set_component_property |
Set component property values |
Hierarchy Tools
| Tool | Description |
|---|---|
unity_get_hierarchy |
Get scene GameObject hierarchy |
unity_get_gameobject |
Get details of a specific GameObject |
unity_get_components |
List components on a GameObject |
Prefab Tools
| Tool | Description |
|---|---|
unity_instantiate_prefab |
Instantiate prefabs in scene |
unity_get_prefab_info |
Get prefab structure |
unity_create_prefab |
Create prefab from GameObject |
unity_unpack_prefab |
Unpack prefab instances |
Scene Tools
| Tool | Description |
|---|---|
unity_get_scenes |
List all scenes in project |
unity_open_scene |
Open a scene |
unity_save_scene |
Save current scene |
unity_new_scene |
Create new scene |
unity_close_scene |
Close a scene |
unity_set_active_scene |
Set active scene |
Asset & Editor Tools
| Tool | Description |
|---|---|
unity_get_assets |
List assets in a folder |
unity_get_project_settings |
Get project configuration |
unity_get_console_logs |
Get recent console logs |
unity_clear_console |
Clear the console |
unity_execute_menu |
Execute a menu item |
unity_select_object |
Select a GameObject |
unity_get_selection |
Get current selection |
unity_get_editor_state |
Get editor play/pause state |
Compilation Tools
| Tool | Description |
|---|---|
unity_get_compilation_status |
Get compile errors/warnings |
unity_recompile_scripts |
Force recompilation |
unity_get_assemblies |
List project assemblies |
Screenshot & Search Tools (v2.1)
| Tool | Description |
|---|---|
unity_take_screenshot |
Capture Game View or Scene View as base64 PNG |
unity_search_project |
Search by name, content, or asset references |
Play Mode & Input Tools (v2.1)
| Tool | Description |
|---|---|
unity_enter_play_mode |
Enter play mode |
unity_exit_play_mode |
Exit play mode |
unity_pause_play_mode |
Pause/unpause play mode |
unity_simulate_key |
Simulate keyboard input |
unity_simulate_mouse |
Simulate mouse clicks |
unity_click_ui_element |
Click UI buttons/toggles by name |
Animation Tools (v2.2)
| Tool | Description |
|---|---|
unity_set_animator_parameter |
Set bool/float/int/trigger parameters |
unity_get_animator_info |
Get animator state, parameters, layers |
unity_play_animation |
Play animation state by name |
Material & Shader Tools (v2.2)
| Tool | Description |
|---|---|
unity_get_material_info |
Get material properties and shader |
unity_set_material_property |
Set color/float/int/vector properties |
unity_set_material |
Assign material to renderer |
Physics Tools (v2.2)
| Tool | Description |
|---|---|
unity_raycast |
Cast ray and get hit info |
unity_overlap_sphere |
Find colliders in radius |
unity_add_force |
Apply force to Rigidbody |
Asset Creation Tools (v2.2)
| Tool | Description |
|---|---|
unity_create_folder |
Create project folders |
unity_create_material |
Create material assets |
unity_create_script |
Create C# scripts with templates |
unity_move_asset |
Move/rename assets |
unity_duplicate_asset |
Duplicate assets |
AI Context Tools (v2.2)
| Tool | Description |
|---|---|
unity_get_scene_summary |
Compact scene overview for AI |
unity_get_component_schema |
Get component properties schema |
unity_get_type_info |
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):
{
"mcpServers": {
"unity": {
"command": "node",
"args": ["path/to/Packages/com.community.unity-mcp/Bridge/mcp-bridge.js"]
}
}
}
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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。