@akiojin/unity-editor-mcp
v2.13.27
Published
MCP server for Unity Editor integration - enables AI assistants to control Unity Editor
Downloads
128
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
- 70 comprehensive tools across 13 categories for Unity Editor automation
- GameObject management - Create, find, modify, delete GameObjects with full hierarchy control
- Component system - Add, remove, modify components with property control
- Scene management - Create, load, save, list scenes with build settings integration
- Scene analysis - Deep inspection, component analysis, and performance metrics
- Asset management - Create and modify prefabs, materials, scripts with full control
- UI automation - Find, click, and interact with UI elements programmatically
- Input simulation - Simulate keyboard, mouse, gamepad, and touch input
- Play mode controls - Start, pause, stop Unity play mode for testing
- Project settings - Read and update Unity project settings safely
- Editor operations - Console logs, screenshots, compilation monitoring
- Editor control - Manage tags, layers, selection, windows, and tools
Quick Start
Using npx (Recommended)
npx @akiojin/unity-editor-mcp@latestGlobal Installation
npm install -g @akiojin/unity-editor-mcp
unity-editor-mcpLocal Installation
npm install @akiojin/unity-editor-mcp
npx unity-editor-mcpUnity Setup
- Install the Unity package from:
https://github.com/akiojin/unity-editor-mcp.git?path=UnityEditorMCP/Packages/unity-editor-mcp - Open Unity Package Manager → Add package from git URL
- The package will automatically start a TCP server on port 6400
MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"unity-editor-mcp": {
"command": "npx",
"args": ["@akiojin/unity-editor-mcp@latest"]
}
}
}Alternative (if globally installed)
{
"mcpServers": {
"unity-editor-mcp": {
"command": "unity-editor-mcp"
}
}
}Available Tools (70 Tools)
System & Core Tools (2 tools)
ping- Test connection to Unity Editor and verify server statusrefresh_assets- Refresh Unity assets and trigger recompilation
GameObject Management (5 tools)
create_gameobject- Create GameObjects with primitives, transforms, tags, and layersfind_gameobject- Find GameObjects by name, tag, layer with pattern matchingmodify_gameobject- Modify GameObject properties (transform, name, active state, parent)delete_gameobject- Delete single or multiple GameObjects with child handlingget_hierarchy- Get scene hierarchy with components and depth control
Component System (5 tools)
add_component- Add Unity components to GameObjects with initial propertiesremove_component- Remove components from GameObjects with safety checksmodify_component- Modify component properties with nested property supportlist_components- List all components on a GameObject with type informationget_component_types- Discover available component types with filtering
Scene Management (5 tools)
create_scene- Create new scenes with build settings integrationload_scene- Load scenes in Single or Additive modesave_scene- Save current scene with Save As functionalitylist_scenes- List all scenes in project with filtering optionsget_scene_info- Get detailed scene information including GameObject counts
Scene Analysis (7 tools)
get_gameobject_details- Deep inspection of GameObjects with component detailsanalyze_scene_contents- Comprehensive scene statistics and performance metricsget_component_values- Get all properties and values of specific componentsfind_by_component- Find GameObjects by component type with scope filteringget_object_references- Analyze references between objects and assetsget_animator_state- Get current Animator state, parameters, and transitionsget_animator_runtime_info- Get runtime Animator info (Play mode only)
Asset Management (11 tools)
create_prefab- Create prefabs from GameObjects or templatesmodify_prefab- Modify existing prefabs with property changesinstantiate_prefab- Instantiate prefabs in scenes with transform optionsopen_prefab- Open prefabs in Unity's prefab mode for editingexit_prefab_mode- Exit prefab mode with save/discard optionssave_prefab- Save prefab changes or apply instance overridescreate_material- Create new materials with shader and propertiesmodify_material- Modify material properties and shadersmanage_asset_import_settings- Manage asset import settings and presetsmanage_asset_database- Asset database operations (find, move, copy, delete)analyze_asset_dependencies- Analyze asset dependencies and find unused assets
Script Management (6 tools)
create_script- Create new C# scripts with templates (MonoBehaviour, ScriptableObject, etc.)read_script- Read script file contents with syntax highlightingupdate_script- Modify existing scripts with validationdelete_script- Delete script files with dependency checkinglist_scripts- List all scripts in project with filtering and metadatavalidate_script- Validate script syntax and Unity compatibility
Play Mode Controls (4 tools)
play_game- Start Unity play mode for testingpause_game- Pause or resume Unity play modestop_game- Stop Unity play mode and return to edit modeget_editor_state- Get current editor state and compilation status
UI Automation (5 tools)
find_ui_elements- Locate UI elements by type, tag, or nameclick_ui_element- Simulate clicking on UI elements (buttons, toggles)get_ui_element_state- Get UI element properties and interaction stateset_ui_element_value- Set values for input fields, sliders, dropdownssimulate_ui_input- Execute complex UI interaction sequences
Input System Simulation (5 tools)
simulate_keyboard- Simulate keyboard input with key combos and text typingsimulate_mouse- Simulate mouse movement, clicks, drags, and scrollingsimulate_gamepad- Simulate gamepad buttons, sticks, triggers, and d-padsimulate_touch- Simulate touch gestures (tap, swipe, pinch, multi-touch)get_current_input_state- Get current state of all input devices
Editor Operations (5 tools)
execute_menu_item- Execute Unity menu items programmaticallyclear_console- Clear Unity console logs with filtering optionsread_console- Read console logs with advanced filtering and searchcapture_screenshot- Take screenshots of Game View or Scene Viewanalyze_screenshot- Analyze screenshot content with image analysis
Editor Control & Automation (6 tools)
manage_tags- Manage Unity project tags (add, remove, list)manage_layers- Manage Unity project layers with index conversionmanage_selection- Manage Editor selection (get, set, clear)manage_windows- Manage Editor windows (list, focus, get state)manage_tools- Manage Editor tools and pluginsget_compilation_state- Get current compilation state and errors
Project Settings Management (2 tools)
get_project_settings- Read Unity project settings with granular control- Player, Graphics, Quality, Physics, Audio, Time settings
- Build settings, Tags and layers configuration
update_project_settings- Safely update project settings- Requires explicit confirmation for safety
- Supports partial updates to specific categories
Requirements
- Unity: 2020.3 LTS or newer (Unity 6 supported)
- 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 6400 is not blocked by firewall
Installation Issues
# Clear npm cache
npm cache clean --force
# Reinstall
npm uninstall -g @akiojin/unity-editor-mcp
npm install -g @akiojin/unity-editor-mcpRepository
Full source code and documentation: https://github.com/akiojin/unity-editor-mcp
License
MIT License - see LICENSE file for details.
