Unity MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOGGING | No | Enable console logging | false |
| UNITY_HOST | No | Unity WebSocket server host | localhost |
| UNITY_PORT | No | Unity WebSocket server port | 8090 |
| RAG_DB_PATH | No | Path to RAG database | |
| LOGGING_FILE | No | Enable file logging | false |
| RAG_PYTHON_PATH | No | Path to Python executable | |
| RAG_SERVER_PATH | No | Path to RAG server directory |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| execute_menu_itemB | Executes a Unity menu item by path |
| select_gameobjectA | Sets the selected GameObject in the Unity editor by path, name or instance ID |
| add_packageA | Adds packages into the Unity Package Manager |
| add_external_dllA | Downloads a raw DLL (or any binary asset) from a URL and installs it under the Unity project's Assets//. Use this for native plugins, NuGet DLLs, and CDN-hosted libraries that aren't published as Unity packages — e.g. zxing.unity.dll, Newtonsoft.Json.dll, custom .so/.aar bundles. The Node MCP server downloads the URL to a temp file and asks the Unity Editor to copy it into the Assets tree and refresh the AssetDatabase. Use add_package (source=github) for git-hosted UPM packages instead. |
| run_testsC | Runs Unity's Test Runner tests |
| send_console_logB | Sends console log messages to the Unity console |
| get_console_logsA | Retrieves logs from the Unity console with pagination support to avoid token limits |
| update_componentA | Updates component fields on a GameObject or adds it to the GameObject if it does not contain the component |
| add_asset_to_sceneA | Adds an asset from the AssetDatabase to the Unity scene |
| update_gameobjectA | Updates properties of a GameObject in the Unity scene by its instance ID or path. If the GameObject does not exist at the specified path, it will be created. |
| create_prefabB | Creates a prefab with optional MonoBehaviour script and serialized field values |
| create_sceneB | Creates a new scene and saves it to the specified path |
| delete_sceneA | Deletes a scene by path or name and removes it from Build Settings |
| load_sceneB | Loads a scene by path or name. Supports additive loading (default: false) |
| recompile_scriptsB | Recompiles all scripts in the Unity project. |
| get_gameobjectA | Retrieves detailed information about a specific GameObject by instance ID, name, or hierarchical path (e.g., 'Parent/Child/MyObject'). Returns all component properties including Transform position, rotation, scale, and more. |
| delete_gameobjectA | Deletes a GameObject from the scene by path, name, or instance ID |
| duplicate_gameobjectB | Duplicates a GameObject in the scene, optionally with a new name |
| play_modeA | Controls Unity Editor play mode: enter, exit, pause, unpause, step, or get current state |
| manage_assetB | Manages assets in the project: move, delete, rename, copy, create_folder, get_path |
| find_gameobjectsA | Finds GameObjects in the scene by name pattern, tag, layer, or component type |
| editor_selectionB | Gets or sets the current Unity Editor selection (GameObjects, assets, etc.) |
| search_unity_knowledgeA | Search the Unity knowledge base for relevant documentation and assets. Args: query: The search query string to find relevant Unity knowledge. filter_source: Optional filter to limit results by source type. Valid values: 'api', 'manual', 'local_asset', 'reach_ui'. If not provided, searches all sources. Returns: Formatted string containing relevant search results with source info. |
| project_settingsA | Manages Unity Project Settings including PlayerSettings, QualitySettings, GraphicsSettings, PhysicsSettings, and more. Actions: get (read settings), set (modify settings), list_categories (show available categories). Categories: player, quality, graphics, physics, time, audio, editor, input, tags_layers, preset_manager |
| script_managementB | Manages Unity scripting configuration including:
|
| profilerC | Controls Unity's Profiler for performance analysis. Actions:
|
| build_pipelineC | Comprehensive Unity build pipeline control. Actions:
|
| editor_controlB | Controls Unity Editor windows and UI elements. Actions:
|
| undo_redoA | Controls Unity's Undo/Redo system. Actions:
|
| watch_consoleA | Monitors the Unity console for new logs with filtering and waiting capabilities. Perfect for recursive iteration - wait for specific messages, errors, or compilation results. Actions:
|
| debuggerB | Unity debugging utilities for inspection and troubleshooting. Actions:
|
| asset_importA | Manages Unity asset import settings and reimport operations. Actions:
|
| animationB | Controls Unity Animation and Timeline systems. Actions:
|
| physicsB | Unity Physics system control and queries. Actions:
|
| material_shaderC | Manages Unity materials and shaders. Actions:
|
| lightingC | Controls Unity lighting and rendering environment. Actions:
|
| unity_hubA | Controls Unity Hub to create projects, manage installations, and open projects. This tool works INDEPENDENTLY of the Unity Editor connection. Editor installs use the Unity Hub CLI; project creation and template listing use the installed Editor and its bundled templates directly (the Hub CLI has no create/templates subcommands). Actions:
Note: Unity Hub must be installed. Default paths:
|
| asset_storeA | Manages Unity Asset Store assets and Package Manager integration. Actions:
Note: Most actions require Unity 2020.1+ and being logged into Unity Hub/Editor. search_store and list_cached_assets work without authentication. Assets must be purchased through the Asset Store website before downloading. |
| execute_codeA | Execute arbitrary C# code in the Unity Editor context. This is the most powerful tool — it can do anything the Unity Editor API allows. The code runs with full access to UnityEngine, UnityEditor, System, and all project assemblies. For simple expressions, just provide the expression (e.g., "Selection.activeGameObject.name"). For multi-statement code, write full C# statements. A return statement determines the output. For void operations, the code runs and any Debug.Log output is captured. Pre-imported namespaces: System, System.Collections.Generic, System.Linq, System.Reflection, System.IO, UnityEngine, UnityEditor, UnityEditor.SceneManagement, UnityEngine.SceneManagement, UnityEngine.UI Examples:
|
| file_operationsA | Read, write, list, and search files within the Unity project. Actions:
Paths can be absolute or relative to the project root. Examples:
Security: All paths must be within the Unity project directory. |
| scriptable_objectB | Manage Unity ScriptableObjects. Actions:
|
| prefabB | Advanced Unity prefab operations. Actions:
|
| audio_mixerB | Manage Unity AudioMixers and AudioSources. Actions:
|
| terrainA | Manage Unity Terrains. Actions:
|
| navmeshC | Manage Unity NavMesh navigation system. Actions:
|
| physics2dA | Manage Unity 2D Physics: rigidbodies, colliders, raycasts, joints, effectors. Actions:
|
| tilemapA | Manage Unity Tilemaps for 2D level design. Actions:
|
| spriteA | Manage Unity Sprites and SpriteAtlases. Actions:
|
| particle_systemA | Manage Unity ParticleSystems in detail. Actions:
|
| playtestB | Autonomous playtesting: observe game state, simulate taps, click UI elements, capture screenshots, and interact with game objects during Unity play mode |
| restart_serverA | Rebuild TypeScript and restart the MCP server to pick up code changes. Use after modifying TS tools, C# handlers, or prompts. The server will exit and be auto-restarted by the host (Claude Code). |
| setup_xreal_projectA | Sets up a Unity project for XREAL One Pro development. Configures Android build target, XR Plugin Management, and imports NRSDK. This is the first step for any new XREAL mixed reality project. |
| configure_android_buildA | Configures Android build settings optimized for XREAL One Pro on Samsung S24. Sets up ARM64 architecture, IL2CPP scripting backend, minimum API level, and other required settings for mobile XR. |
| import_nrsdkA | Imports the NRSDK (XREAL SDK) into the Unity project. Can import from a local unitypackage file or download a specific version. Configures initial SDK settings after import. |
| validate_xreal_setupA | Validates the Unity project configuration for XREAL development. Checks NRSDK installation, Android build settings, XR Plugin Management, required permissions, and reports any issues that need to be fixed. |
| get_xreal_device_infoA | Gets information about the connected XREAL device including model, connection status, tracking state, battery level, and supported features. Works in both Editor simulation and on-device. |
| set_tracking_modeA | Sets the tracking mode for the XREAL glasses. 0DoF provides rotation only, 3DoF adds positional tracking relative to start, and 6DoF provides full positional and rotational tracking. |
| calibrate_glassesB | Triggers calibration procedures for XREAL glasses including IPD (interpupillary distance) adjustment, display brightness, and tracking recalibration. |
| get_camera_frameA | Captures a frame from the XREAL RGB camera for computer vision or AR development. Returns image data or saves to a file. Useful for debugging image tracking and mixed reality features. |
| enable_hand_trackingA | Enables or disables hand tracking on XREAL glasses. When enabled, the system tracks hand poses, joint positions, and recognizes gestures. Required for hand-based interactions. |
| get_hand_stateB | Gets the current state of tracked hands including joint positions, detected gestures, pinch strength, and tracking confidence. Returns detailed hand pose data. |
| configure_hand_gesturesA | Configures which hand gestures are recognized and their sensitivity. Gestures include pinch, grab, point, open palm, thumbs up, and more. |
| create_hand_interactableA | Adds hand interaction components to a GameObject, making it respond to hand gestures like pinch-to-grab, poke, or hover. Sets up the necessary colliders and interaction scripts. |
| enable_plane_detectionA | Enables or disables plane detection for spatial mapping. Detects horizontal surfaces (floors, tables) and vertical surfaces (walls) in the real environment. |
| get_detected_planesA | Gets information about all currently detected planes in the environment. Returns plane positions, orientations, boundaries, and classifications. |
| create_spatial_anchorA | Creates a spatial anchor at a specified position or on a detected plane. Spatial anchors persist across sessions and maintain their position in the real world. |
| manage_spatial_anchorsA | Manages spatial anchors: load from persistence, save current anchors, delete anchors, or query anchor information. Essential for persistent MR experiences. |
| enable_meshingA | Enables or disables spatial meshing to generate 3D mesh geometry of the real environment. Used for occlusion, physics collisions, and spatial understanding. |
| add_tracking_imageB | Adds an image to the image tracking database. The system will detect and track this image in the camera feed, returning its pose in 3D space. |
| configure_image_trackingC | Configures image tracking settings including how many images can be tracked simultaneously, tracking quality, and update frequency. |
| get_tracked_imagesA | Gets the current state of tracked images including which images are detected, their poses, and tracking quality. |
| configure_passthroughA | Configures the camera passthrough for mixed reality mode. Passthrough shows the real world through the glasses with virtual content overlaid. |
| set_render_modeB | Sets the rendering mode for the XREAL experience. VR mode renders only virtual content, AR mode overlays on passthrough, MR mode enables full mixed reality with occlusion. |
| configure_occlusionC | Configures depth-based occlusion settings. Occlusion allows real-world objects to properly hide virtual objects that are behind them, creating realistic mixed reality. |
| build_xreal_apkA | Queues an asynchronous Android APK build for XREAL One Pro and returns immediately with a jobId. Unity's BuildPipeline.BuildPlayer blocks the editor for minutes; this tool dispatches the build via EditorApplication.delayCall so the MCP request doesn't time out. Poll get_build_status with the returned jobId to follow progress and pick up the final BuildReport summary (output path, size, build time, errors, warnings). |
| get_build_statusA | Returns the current status of an asynchronous build started by build_xreal_apk. Provide the jobId returned from that tool. State transitions: Queued -> Building -> Succeeded | Failed. When state is Succeeded the response includes outputPath, fileSizeMb, buildSeconds, and (if runAfterBuild was set) a deployment summary. When state is Failed the response includes an errors array. Omit jobId to get a list of every known build job in this editor session. |
| get_connected_devicesA | Lists all Android devices connected via ADB. Shows device IDs, models, Android versions, and connection status. Useful for verifying device setup before deployment. |
| setup_xr_interactionB | Sets up the XR Interaction Toolkit for XREAL development. Configures interaction systems, input actions, and default interactors for hand-based or controller-based interaction. |
| create_xr_rigA | Creates an XR Origin (camera rig) configured for XREAL One Pro. Sets up the head-mounted display camera, hand tracking origins, and interaction components. |
| add_xr_interactorA | Adds XR interaction components to a GameObject. Interactors enable selection and manipulation of XR Interactables via ray casting or direct touch. |
| create_xr_uiA | Creates a world-space UI canvas configured for XR interaction. Sets up proper scaling, interaction raycasting, and visual settings for comfortable viewing in mixed reality. |
| get_xr_performance_metricsA | Gets real-time XR performance metrics including frame rate, frame times, GPU/CPU usage, thermal state, and memory usage. Essential for optimizing mobile XR experiences. |
| profile_xr_sceneB | Analyzes the current scene for XR performance issues. Checks draw calls, triangle counts, texture memory, shader complexity, and provides optimization recommendations. |
| capture_xr_screenshotA | Captures a screenshot from the XR camera perspective. Can capture mono, stereo (side-by-side), or individual eye views. Useful for documentation and debugging. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| gameobject_handling_strategy | Defines the proper workflow for handling gameobjects in Unity |
| script_workflow | Workflow for creating, editing, and attaching C# scripts in Unity |
| scene_setup | Workflow for setting up and configuring Unity scenes |
| debugging_workflow | Systematic approach to debugging Unity issues |
| performance_optimization | Profile and optimize Unity project performance |
| ui_development | Workflow for building Unity UI: Canvas setup, layout, text, buttons, panels |
| 2d_game_development | Workflow for building 2D games: sprites, tilemaps, 2D physics, animation |
| world_building | Workflow for building 3D worlds: terrain, lighting, NavMesh, environment |
| audio_design | Workflow for Unity audio: AudioMixer, AudioSources, spatial audio, music |
| xreal_project_setup | Step-by-step guide for setting up a new XREAL mixed reality project in Unity |
| hand_interaction_strategy | Best practices and workflow for implementing hand tracking interactions in XREAL |
| spatial_anchor_workflow | Workflow for creating persistent mixed reality experiences using spatial anchors |
| xreal_optimization_guide | Performance optimization guide for XREAL mobile mixed reality applications |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| get_menu_items | List of available menu items in Unity to execute |
| get_scenes_hierarchy | Retrieve all GameObjects in the Unity loaded scenes with their active state (scenes hierarchy) |
| get_packages | Retrieve all packages from the Unity Package Manager |
| get_assets | Retrieve assets from the Unity Asset Database |
| Unity Editor State | Current Unity Editor state including: - Play mode status (editing, playing, paused) - Compilation state - Editor focus - Active scene - Selection - Inspector lock state - Current tool - Grid settings |
| get_xreal_device_state | Real-time XREAL device state including connection status, tracking quality, battery level, and thermal state |
| get_spatial_anchors | List of all spatial anchors in the current scene with their positions, rotations, persistence status, and custom metadata |
| get_detected_planes_resource | List of all detected planes in the environment including floor, walls, tables, and other surfaces with their poses and boundaries |
| get_tracked_images_resource | List of all currently tracked images with their poses, tracking states, and detected sizes |
| get_xreal_build_settings | Current Android and XREAL build configuration including SDK versions, graphics settings, XR plugin settings, and player settings |
| List only 'EditMode' tests | List only 'EditMode' tests from Unity's test runner |
| List only 'PlayMode' tests | List only 'PlayMode' tests from Unity's test runner |
| List all tests | List of all tests in Unity's test runner, this includes PlayMode and EditMode tests |
| All logs | All Unity console logs (newest first). Set includeStackTrace=false to save tokens. |
| Error logs | Error logs only. Start with includeStackTrace=false for quick overview. |
| Warning logs | Warning logs only. Use includeStackTrace=false by default to save tokens. |
| Info logs | Info logs only. Stack traces excluded by default to minimize tokens. |
| Frame Timing Data | Frame times, FPS, and frame budget utilization |
| Memory Usage | Memory breakdown by category (Native, Managed, Graphics, etc.) |
| Rendering Stats | Draw calls, triangles, vertices, batches, set pass calls |
| CPU Usage | CPU time breakdown by Unity area |
| GC Allocations | Garbage collection allocations this frame |
| Physics Stats | Active rigidbodies, contacts, collision pairs |
| Build Settings | Current build target, output path, and options |
| Build Scenes | Scenes included in the build |
| Build Report | Last build report with sizes and warnings |
| Available Platforms | Installed build platforms and their status |
| Player Settings | Company, product name, version, icons, splash, scripting |
| Quality Settings | Quality levels, shadows, textures, anti-aliasing |
| Graphics Settings | Render pipeline, transparency sort, shaders |
| Physics Settings | Gravity, layer collision matrix, solver iterations |
| Time Settings | Fixed timestep, max timestep, time scale |
| Audio Settings | Global volume, DSP buffer, sample rate |
| Editor Settings | Version control, asset serialization, sprite packer |
| Input Settings | Input axes and button mappings |
| Tags and Layers | Custom tags and sorting layers |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/joel-wehr/unity-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server