Skip to main content
Glama

Unity MCP

Unity MCP

๐ŸŽฎ Control Unity Editor โ€ข โšก Real-time automation โ€ข ๐Ÿš€ AI-powered workflows

npm MCP Server GitHub Sponsors

โœจ What It Does

Unity MCP provides real-time control of Unity Editor via the Model Context Protocol allowing you to:

Feature

Description

Editor Control

Select, move, rotate, and scale objects with natural language

Batch Operations

Align, distribute, duplicate objects with undo support

Automated Testing

Enter play mode and run test scenarios programmatically

Scene Management

Load, save, inspect scene hierarchy in real-time

๐Ÿš€ Quick Setup

๐Ÿ“‹ Prerequisites


๐Ÿ“ฅ Installation

โš ๏ธ REQUIRED: You must install Unity MCP before using any of its tools.

Method 1: Automatic Setup (Recommended) โšก

One command does everything:

claude mcp add @spark-apps/unity-mcp

โœ… Installs the package โœ… Configures your MCP client automatically โœ… Ready to use immediately after restart


Method 2: Manual Setup ๐Ÿ› ๏ธ

If you prefer to configure manually or use a different MCP client:

Step 1: Install the package globally

npm i -g @spark-apps/unity-mcp

Step 2: Add to your MCP client configuration

Edit your MCP client config file:

  • Windows %APPDATA%\\Claude\\claude_desktop_config.json

  • macOS ~/Library/Application Support/Claude/claude_desktop_config.json

  • Linux ~/.config/Claude/claude_desktop_config.json

Add this configuration:

{ "mcpServers": { "unity-mcp": {"command": "npx", "args": ["-y", "@spark-apps/unity-mcp"]} } }

Step 3: Restart your MCP client


๐ŸŽฎ Unity Editor Integration

Tell Claude to set up the integration:

Setup Unity MCP in my project at /path/to/unity/project

This installs 8 editor scripts to Assets/Editor/UnityMCP/ including:

  • HTTP server with auto-start (port 8080)

  • Control Panel UI with ๐ŸŸข๐ŸŸ ๐Ÿ”ดโšช status monitoring

  • ScriptableObject configuration for persistent settings

  • Handlers for all 30 tools

After installation:

  1. Restart Unity Editor

  2. Open Tools โ†’ Unity MCP โ†’ Control Panel

  3. Verify ๐ŸŸข Connected status

Done! Use the Control Panel to manage settings and monitor your connection.


๐Ÿ› ๏ธ Available Tools

๐ŸŽฏ Editor Control (7 tools)

Tool

Description

Setup Unity MCP

Install editor integration into Unity project

Select Objects

Select by name, tag, or pattern with framing

Transform Objects

Move, rotate, scale objects

Align Objects

Align left/right/top/bottom/center

Distribute Objects

Distribute evenly along axis

Duplicate Objects

Clone objects with undo support

Find Objects

Find by component type or pattern

๐Ÿ—บ๏ธ Scene Management (6 tools)

Tool

Description

List Scenes

List all scenes in build settings

Load Scene

Load scene by name or index

Save Scene

Save current or all scenes

Get Hierarchy

Get complete scene hierarchy

Find In Scene

Find objects in current scene

Cleanup Scene

Remove missing scripts and empty objects

๐Ÿงช Testing & Play Mode (5 tools)

Tool

Description

Enter Play Mode

Start play mode programmatically

Exit Play Mode

Exit play mode programmatically

Run Test

Execute automated test scenarios

Play Mode Status

Get play mode status and logs

Set Time Scale

Slow motion or fast forward

๐Ÿ“ฆ Assets & Console (5 tools)

Tool

Description

Get Console Logs

Retrieve Unity console logs for debugging

Clear Console

Clear all console logs

Create Prefab

Create prefab from selected GameObject

Get Assets

List project assets with filtering

Refresh Assets

Refresh Unity asset database

โšก Advanced Tools (7 tools)

Tool

Description

Execute Menu Item

Execute any Unity Editor menu command

Add Package

Install Unity packages via Package Manager

Run Unity Tests

Execute Test Runner tests (EditMode/PlayMode)

Add Asset to Scene

Add prefab or asset to current scene

Script Operations

Create, read, update, delete C# scripts

Validate Script

Validate C# script syntax

Delete Objects

Delete objects with undo support


๐Ÿ’ฌ Example Commands

  • "Select all objects with tag 'Enemy' and align them horizontally"

  • "Move the Player object to position (0, 5, 10)"

  • "Distribute selected objects evenly along the x axis"

  • "Find all objects with Camera component"

  • "Duplicate selected object 5 times"

  • "Enter play mode and move Player to (10, 0, 0) for 5 seconds"

  • "Set time scale to 0.5 for slow motion"

  • "Run a test that destroys the Boss after 2 seconds"

  • "Check play mode status and show test logs"

  • "List all scenes in the project"

  • "Load the MainMenu scene"

  • "Show me the complete hierarchy of the current scene"

  • "Find all objects with Rigidbody component"

  • "Clean up scene by removing missing scripts"


๐ŸŽ›๏ธ Unity Control Panel

Once installed, access the Control Panel via Tools โ†’ Unity MCP โ†’ Control Panel.

Features:

  • ๐ŸŸข Real-time Status Monitoring

    • ๐ŸŸข Connected - Server running normally

    • ๐ŸŸ  Starting - Server is initializing

    • ๐Ÿ”ด Error - Connection failed

    • โšช Disconnected - Server stopped

  • โš™๏ธ Server Settings (Collapsable)

    • Port configuration (default: 8080)

    • Auto-start on Unity load

    • Request timeout settings

    • Remote connections (โš ๏ธ use with caution)

  • โœจ Features (Collapsable)

    • Console monitoring (max logs configurable)

    • Auto-refresh assets on changes

    • Verbose logging for debugging

  • โšก Quick Actions (Collapsable)

    • ๐Ÿ“‹ View Console Logs

    • ๐Ÿ”„ Refresh Assets

    • ๐Ÿ’พ Save Scene

    • ๐Ÿงน Clear Console

    • ๐Ÿ“ Open Config

    • ๐Ÿ“– Documentation

  • ๐Ÿ”ง Tools Overview (Collapsable)

    • View all 30 available tools categorized by type

    • Quick reference without leaving Unity

  • โšก Advanced Settings (Collapsable)

    • Undo/Redo support

    • Auto-backup scenes

    • Reset to defaults

Configuration is stored as a ScriptableObject: Assets/Editor/UnityMCP/Resources/MCPConfig.asset

All settings persist across Unity sessions!


๐Ÿ› Troubleshooting

MCP Server Not Showing:

  1. Verify Node.js is installed: node --version

  2. Check config file path is correct

  3. Ensure JSON syntax is valid

  4. Restart MCP client completely

Unity Editor Not Responding:

  1. Ensure Unity Editor is open

  2. Check Assets/Editor/UnityMCP/ scripts are installed

  3. Verify Console for [Unity MCP] Server started on port 8080

  4. Check no errors in Unity Console

Port Already in Use:

  1. Default port is 8080

  2. Check what's using it: lsof -i :8080 (Mac/Linux) or netstat -ano | findstr :8080 (Windows)

  3. Stop conflicting process or change port in Unity scripts


๐ŸŒฑ Support & Contributions

โญ Star the repo & I power up like Mario ๐Ÿ„
โ˜• Devs run on coffee -
๐Ÿ’ฐ Crypto tips welcome - Tip in crypto
๐Ÿค Contributions are welcome - , improve, PR!
๐ŸŽฅ Need help? โ€ข

๐Ÿ’– Sponsor

Your support helps maintain and improve the tool. please consider .


Made with โค๏ธ for Game Devs โ€ข Privacy Policy โ€ข Terms of Service

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Provides real-time control of Unity Editor through natural language commands. Enables AI-powered workflows for object manipulation, scene management, automated testing, and asset operations with 30+ available tools.

  1. โœจ What It Does
    1. ๐Ÿš€ Quick Setup
      1. ๐Ÿ“‹ Prerequisites
    2. ๐Ÿ“ฅ Installation
      1. Method 1: Automatic Setup (Recommended) โšก
      2. Method 2: Manual Setup ๐Ÿ› ๏ธ
    3. ๐ŸŽฎ Unity Editor Integration
      1. ๐Ÿ› ๏ธ Available Tools
        1. ๐ŸŽฏ Editor Control (7 tools)
        2. ๐Ÿ—บ๏ธ Scene Management (6 tools)
        3. ๐Ÿงช Testing & Play Mode (5 tools)
        4. ๐Ÿ“ฆ Assets & Console (5 tools)
        5. โšก Advanced Tools (7 tools)
      2. ๐Ÿ’ฌ Example Commands
        1. ๐ŸŽ›๏ธ Unity Control Panel
          1. ๐Ÿ› Troubleshooting
            1. ๐ŸŒฑ Support & Contributions
              1. ๐Ÿ’– Sponsor

                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/muammar-yacoob/unity-mcp'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server