Back to MCP Catalog

Unity Editor Integration MCP Server

GamingC#
Connect Unity Editor with AI models for game development assistance
Available Tools

get_scene_hierarchy

Retrieves the current scene hierarchy in Unity, showing all GameObjects and their parent-child relationships

get_gameobject_details

Gets detailed information about a specific GameObject including its components and properties

get_component_details

Retrieves detailed information about a specific component attached to a GameObject

get_script_content

Gets the content of a C# script in the project

update_script_content

Updates the content of a C# script in the project

create_script

Creates a new C# script in the project

update_component

Updates properties of a component attached to a GameObject

update_gameobject

Updates or creates a GameObject with specified properties

get_console_logs

Retrieves the Unity console logs

get_project_structure

Gets the structure of the Unity project assets

Unity Editor Integration provides a seamless connection between the Unity game engine and AI model clients like Claude Desktop, Windsurf, and Cursor. This MCP server enables developers to leverage AI assistance directly within their Unity projects, allowing for more efficient game development workflows. With this integration, game developers can query AI models about Unity-specific concepts, get help with scripting, scene management, and game object manipulation - all while the AI has direct access to your Unity project context. The server bridges the gap between powerful AI language models and the Unity development environment.

Overview

The Unity Editor Integration MCP server allows you to connect your Unity projects with AI assistants, enabling them to understand and interact with your game development environment. This integration helps streamline game development by allowing AI models to provide contextual assistance based on your Unity project.

Installation

Prerequisites

Setup Instructions

  1. Add to your Unity project:

    • Open your Unity project
    • Navigate to Window > Package Manager
    • Click the "+" button and select "Add package from git URL..."
    • Enter: https://github.com/CoderGamester/mcp-unity.git
    • Click "Add"
  2. Configure the MCP Server:

    • In Unity, go to Edit > Preferences > MCP Unity
    • Set your preferred port (default is 3100)
    • Click "Apply"
  3. Configure your AI client:

    • Add the MCP server configuration to your AI client (Claude Desktop, Windsurf, Cursor, etc.)
    • Use the installation JSON provided below, adjusting the port if you changed it from the default

Usage

  1. Start the MCP Server:

    • In Unity, go to Window > MCP Unity > Start Server
    • You should see a confirmation message that the server is running
  2. Connect with your AI client:

    • Open your AI client (Claude Desktop, Windsurf, Cursor, etc.)
    • Ensure the MCP server is selected/enabled in your client settings
    • Start a new conversation
  3. Working with the AI:

    • You can now ask the AI about your Unity project
    • The AI can access information about your scene hierarchy, game objects, components, and scripts
    • Request help with scripting, scene setup, debugging, or other Unity-related tasks

Example Prompts

  • "Help me understand the structure of my current scene"
  • "Create a simple player movement script for my character"
  • "Analyze my GameObject hierarchy and suggest optimizations"
  • "Debug why my collision detection isn't working properly"
  • "Help me implement a camera follow system"

Troubleshooting

  • If the connection fails, ensure the port is not being used by another application
  • Check that your firewall is not blocking the connection
  • Verify that both Unity and your AI client are running on the same machine
  • Restart the MCP server from Unity if you encounter any issues

Additional Resources

Related MCPs

VRChat API
GamingTypeScript

Access and interact with the VRChat API

Godot
GamingTypeScript

Interface with the Godot game engine to launch, run, and debug projects

OpenDota
GamingPython

Access real-time Dota 2 statistics, match data, and player information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.