SuperAPI AI Directory

mcp-unity

mcp-unity is a Model Context Protocol (MCP) implementation for the Unity Editor, used to let AI assistants interact with Unity projects. This package provides a bridge between Unity and a Node.js server that implements the MCP protocol, enabling AI agents such as Cursor, Windsurf, Claude Code, Codex CLI, GitHub Copilot, Google Antigravity, and OpenCode to perform operations in the Unity Editor. It supports manipulating and querying Unity scenes and GameObjects through MCP tools, and can automatically add the Unity Library/PackedCache folder for VSCode-like IDEs to enhance code intelligence.

Open website

About this tool

Purpose mcp-unity is a Model Context Protocol (MCP) implementation for the Unity Editor, intended to let AI assistants interact with Unity projects. It provides a bridge between Unity and a Node.js server that implements the MCP protocol, enabling AI agents such as Cursor, Windsurf, Claude Code, Codex CLI, GitHub Copilot, Google Antigravity, and OpenCode to perform operations within the Unity Editor.

Main capabilities This package provides a set of MCP server tools for manipulating and querying Unity scenes and GameObjects, including:

  • Menus and selection: execute_menu_item (executes a menu item with the MenuItem attribute), select_gameobject (selects a hierarchy object by path or instance ID).
  • Objects and components: update_gameobject (updates or creates the core properties of a GameObject, such as name, tag, layer, active/static state), update_component (updates or adds component fields), get_gameobject (gets detailed information about the specified GameObject, including all components), duplicate_gameobject, delete_gameobject, reparent_gameobject.
  • Transform: move_gameobject, rotate_gameobject, scale_gameobject, set_transform (sets position, rotation, and scale at once).
  • Packages and tests: add_package (installs a new package in the Unity Package Manager), run_tests (runs tests using the Unity Test Runner), recompile_scripts (recompiles all scripts).
  • Scenes: create_scene, load_scene, delete_scene, save_scene, get_scene_info, unload_scene.
  • Assets and materials: add_asset_to_scene, create_prefab, create_material, assign_material, modify_material, get_material_info.
  • Logs and console: send_console_log, get_console_logs.
  • Batch processing: batch_execute (executes multiple tool operations in a single batch request, reducing round trips, and supports atomic operations with optional rollback on failure).
  • Play mode: get_play_mode_status, set_play_mode_status (supports play, pause, stop, step).
  • Dashboard: show_unity_dashboard (opens the Unity dashboard MCP App in VS Code, requires VS Code 1.109+). In addition, it provides MCP server resources: unity://menu-items (lists all available menu items), unity://scenes-hierarchy (lists all game objects in the current scene hierarchy), unity://gameobject/{id} (gets detailed information about the specified GameObject by instance ID or object path, including its serialized properties and fields), unity://logs (lists Unity console logs), unity://packages (lists information about installed and available packages in the Unity Package Manager), unity://assets (gets information about assets in the Unity Asset Database).

Usage The official text provides example prompts for each tool, such as: "Execute the menu item 'GameObject/Create Empty' to create a new empty GameObject", "Select the Main Camera object in my scene", "Add a Rigidbody component to the Player object and set its mass to 5", "Create a new scene called 'Level1' in the Scenes folder", "Set the Cube's position to (0, 5, 0), rotation to (0, 90, 0), and scale to (2, 2, 2)", "Create 10 empty GameObjects named Enemy_1 through Enemy_10 in a single batch operation", "Start Unity play mode", etc. In addition, MCP Unity can automatically integrate with VSCode-like IDEs (Visual Studio Code, Cursor, Windsurf, Google Antigravity), improving code intelligence for Unity packages by adding the Unity Library/PackedCache folder to the workspace, providing better autocompletion and type information, and helping AI programming assistants understand project dependencies.

Use cases Suitable for scenarios where AI programming assistants or agents are used in Unity projects to query and execute editor operations, such as creating and modifying scenes, GameObjects, components, materials, and prefabs through natural language, installing packages, running tests, controlling play mode, etc.

Limitations The specific installation steps, system requirements, supported Unity versions, Node.js environment requirements, and licensing method are not yet provided in the supplied materials.