unity-editor-mcp
v1.3.1
Published
MCP server for Unity Editor integration - enables AI assistants to control Unity Editor
Maintainers
Readme
Unity Editor MCP Server
MCP (Model Context Protocol) server for Unity Editor integration. Enables AI assistants like Claude and Cursor to interact directly with Unity Editor for automated game development.
Features
- 33 comprehensive tools for Unity Editor automation
- GameObject management - Create, find, modify, delete GameObjects
- Scene management - Create, load, save, list scenes
- Scene analysis - Deep inspection and component analysis
- UI interactions - Find, click, and interact with UI elements
- Asset management - Create and modify prefabs and materials
- Play mode controls - Start, pause, stop Unity play mode
- System tools - Console logs, asset refresh, connection testing
Quick Start
Using npx (Recommended)
npx unity-editor-mcpGlobal Installation
npm install -g unity-editor-mcp
unity-editor-mcpLocal Installation
npm install unity-editor-mcp
npx unity-editor-mcpUnity Setup
- Install the Unity package from:
https://github.com/ozankasikci/unity-mcp.git?path=unity-editor-mcp - Open Unity Package Manager → Add package from git URL
- The package will automatically start a TCP server on port 6402
MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"unity-editor-mcp": {
"command": "npx",
"args": ["unity-editor-mcp"]
}
}
}Alternative (if globally installed)
{
"mcpServers": {
"unity-editor-mcp": {
"command": "unity-editor-mcp"
}
}
}Available Tools
System & Core (3 tools)
ping- Test Unity Editor connectionread_logs- Read Unity console logsrefresh_assets- Trigger asset recompilation
GameObject Management (5 tools)
create_gameobject- Create GameObjects with primitives and transformsfind_gameobject- Find GameObjects by name, tag, layermodify_gameobject- Modify GameObject propertiesdelete_gameobject- Delete GameObjectsget_hierarchy- Get scene hierarchy
Scene Management (5 tools)
create_scene- Create new scenesload_scene- Load scenes (Single/Additive)save_scene- Save current scenelist_scenes- List project scenesget_scene_info- Get scene details
Scene Analysis (5 tools)
get_gameobject_details- Deep GameObject inspectionanalyze_scene_contents- Scene statistics and analysisget_component_values- Component property inspectionfind_by_component- Find objects by component typeget_object_references- Analyze object relationships
Play Mode Controls (4 tools)
play_game- Start Unity play modepause_game- Pause/resume play modestop_game- Stop play modeget_editor_state- Get editor state
UI Interactions (5 tools)
find_ui_elements- Find UI elements by type, tag, or nameclick_ui_element- Click on UI buttons and interactive elementsget_ui_element_state- Get UI element properties and stateset_ui_element_value- Set values for input fields and sliderssimulate_ui_input- Simulate keyboard and mouse input on UI
Asset Management (5 tools)
create_prefab- Create prefabs from GameObjectsmodify_prefab- Modify existing prefab propertiesinstantiate_prefab- Instantiate prefabs in the scenecreate_material- Create new materials with shadersmodify_material- Modify material properties and textures
Requirements
- Unity: 2020.3 LTS or newer
- Node.js: 18.0.0 or newer
- MCP Client: Claude Desktop, Cursor, or compatible client
Troubleshooting
Connection Issues
- Ensure Unity Editor is running with the Unity package installed
- Check Unity console for connection messages
- Verify port 6402 is not blocked by firewall
Installation Issues
# Clear npm cache
npm cache clean --force
# Reinstall
npm uninstall -g unity-editor-mcp
npm install -g unity-editor-mcpRepository
Full source code and documentation: https://github.com/ozankasikci/unity-mcp
License
MIT License - see LICENSE file for details.
