Get the FREE Ultimate OpenClaw Setup Guide →

unity-editor

An MCP server and client for LLMs to interact with Unity Projects

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ozankasikci-unity-editor-mcp npx unity-editor-mcp@latest

How to use

Unity Editor MCP enables AI assistants like Claude Desktop or Cursor to interface directly with the Unity Editor, enabling AI-assisted game development and automation. The server exposes a wide range of tools organized into categories such as System & Core, GameObject Management, Component System, Scene Management, Scene Analysis, Asset Management, Script Management, Play Mode Controls, and UI Automation. After starting the MCP server, clients connect to Unity on the default MCP port (6400) and can send commands to inspect, modify, and orchestrate Unity objects, scenes, assets, and editor states. The included tools allow creating and modifying GameObjects, managing components, handling prefabs and assets, analyzing scenes, running play mode, and automating Unity UI and editor actions. To connect, configure your MCP client (Claude Desktop or Cursor) with the server name unity-editor-mcp and unit port 6400, and ensure your Unity project has the Unity Editor MCP package installed as described in the installation steps.

How to install

Prerequisites:

  • Unity Editor 2020.3 LTS or newer
  • Node.js 18.0.0 or newer
  • An MCP client (e.g., Claude Desktop or Cursor)

Step-by-step installation:

  1. Install the MCP server package

    • Using npm (recommended):
    npm install -g unity-editor-mcp
    
  2. Install Unity package to enable MCP server within your project

    Unity will automatically start the MCP server on port 6400

  3. Start the MCP server (if not started automatically)

    • The server is typically started automatically when using the npm package in step 1. If needed, run:
    npx unity-editor-mcp@latest
    
  4. Configure your MCP client (Claude Desktop or Cursor)

    • For Claude Desktop: add to your config (macOS example path shown)

      • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
      • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Example config:

    {
      "mcpServers": {
        "unity-editor-mcp": {
          "command": "npx",
          "args": ["unity-editor-mcp@latest"]
        }
      }
    }
    
    • For Cursor: use the same MCP server configuration in Cursor's MCP settings
  5. Verify connection

    • Restart your MCP client (Claude Desktop or Cursor)
    • Check Unity Console for: [Unity Editor MCP] Client connected
    • You are ready to start issuing commands to Unity via MCP

Additional notes

Tips and caveats:

  • The server starts on port 6400 by default; ensure this port is accessible to your MCP client
  • Unity Editor MCP supports a large suite of tools across many categories; start with common tasks like ping, read_logs, find_gameobject, create_gameobject, and get_editor_state to verify connectivity
  • Some Unity editor actions may require the Unity project to be open and the correct scene loaded
  • When using component and asset operations, be mindful of Unity's serialization and asset database state to avoid conflicts
  • If you encounter connection issues, ensure the MCP package is properly added to the Unity project and that the npm-based server process is running without errors
  • The npm package name is unity-editor-mcp; the server is named unity-editor-mcp in the MCP ecosystem

Related MCP Servers

Sponsor this space

Reach thousands of developers