Unity MCP MCP server

Enables real-time manipulation of Unity scenes through a WebSocket protocol that supports GameObject creation, component management, transform operations, and property access for game development workflows.
Back to servers
Setup instructions
Provider
YazzyYaz
Release date
Mar 21, 2025
Language
Python

This Unity MCP plugin enables AI-powered scene manipulation and automation in the Unity Editor through the Model Context Protocol, allowing for two-way communication between AI systems and your Unity project.

Features

  • Two-way communication between AI and Unity Editor
  • Scene manipulation and automation
  • GameObject creation and modification
  • Component management
  • Asset import and management
  • Editor window control

Requirements

  • Unity 2022.3 or newer
  • .NET Framework 4.7.1 or newer
  • Python 3.10 or newer (for MCP server)

Installation

To install the Unity MCP plugin:

  1. Clone the repository to your local machine
  2. Open your Unity project
  3. Import the UnityMCP folder into your project's Assets directory
  4. The plugin will automatically appear in the Unity Editor under the Window menu

Usage

Getting Started

  1. Open the Unity MCP window by navigating to Window > Unity MCP in the Unity Editor
  2. Click the "Start Server" button to initiate the MCP server and begin listening for AI commands
  3. Configure your AI client to connect to the MCP server
  4. Begin sending commands from your AI to manipulate your Unity scene

Configuration

The MCP server can be configured through the Unity MCP window, allowing you to set:

  • Connection ports
  • Communication protocols
  • Response handling preferences

Example Commands

Your AI can send various commands to manipulate the Unity scene, such as:

{
  "command": "createGameObject",
  "name": "ExampleObject",
  "position": {"x": 0, "y": 1, "z": 0}
}
{
  "command": "addComponent",
  "gameObject": "ExampleObject",
  "componentType": "Rigidbody"
}

Troubleshooting

If you encounter connection issues:

  • Ensure the MCP server is running (check the "Start Server" button in the Unity MCP window)
  • Verify your AI client is configured with the correct connection parameters
  • Check Unity console for any error messages related to the MCP server

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "unity-mcp" '{"command":"python","args":["-m","unity_mcp.server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "unity-mcp": {
            "command": "python",
            "args": [
                "-m",
                "unity_mcp.server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

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

2. Add this to your configuration file:

{
    "mcpServers": {
        "unity-mcp": {
            "command": "python",
            "args": [
                "-m",
                "unity_mcp.server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later