trackmcp
Back to directory
quazaai

unitymcpintegration

View on GitHub

Enable AI Agents to Control Unity

93 stars C#Developer Kits Updated Nov 3, 2025
aigame-developmentmcpunityunity-mcp

Documentation

๐Ÿš€ Advacned Unity MCP Integration

MCP
smithery badge
Unity
Node.js
TypeScript
WebSockets
Stars
Forks
License

This package provides a seamless integration between Model Context Protocol (MCP) and Unity Editor, allowing AI assistants to understand and interact with your Unity projects in real-time. With this integration, AI assistants can access information about your scene hierarchy, project settings, and execute code directly in the Unity Editor context.

๐Ÿ“š Features

  • Browse and manipulate project files directly
  • Access real-time information about your Unity project
  • Understand your scene hierarchy and game objects
  • Execute C# code directly in the Unity Editor
  • Monitor logs and errors
  • Control the Editor's play mode
  • Wait For Code Execution

๐Ÿš€ Getting Started

Prerequisites

  • Unity 2021.3 or later
  • Node.js 18+ (for running the MCP server)

Installation

1. Install Unity Package

You have several options to install the Unity package:

Option A: Package Manager (Git URL)

1. Open the Unity Package Manager (`Window > Package Manager`)

2. Click the `+` button and select `Add package from git URL...`

3. Enter the repository URL: `https://github.com/quazaai/UnityMCPIntegration.git`

4. Click `Add`

Option B: Import Custom Package

1. Clone this repository or download it as a unityPackage

2. In Unity, go to `Assets > Import Package > Custom Package`

3. Select the `UnityMCPIntegration.unitypackage` file

2. Set up the MCP Server

You have two options to run the MCP server:

Option A: Run the server directly

1. Navigate to the `mcpServer (likely \Library\PackageCache\com.quaza.unitymcp@d2b8f1260bca\mcpServer\)` directory

2. Install dependencies:

code
npm install

3. Run the server:

code
node build/index.js

Option B: Add to MCP Host configuration

Add the server to your MCP Host configuration for Claude Desktop, Custom Implementation etc

json
{
  "mcpServers": {
    "unity-mcp-server": {
      "command": "node",
      "args": [
        "path-to-project>\\Library\\PackageCache\\com.quaza.unitymcp@d2b8f1260bca\\mcpServer\\mcpServer\\build\\index.js"
      ],
      "env": {
        "MCP_WEBSOCKET_PORT": "5010"
      }
    }
  }
}

Demo Video

YouTube

Installing via Smithery

To install Unity MCP Integration for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @quazaai/unitymcpintegration --client claude

๐Ÿ”ง Usage

Debugging and Monitoring

You can open the MCP Debug window in Unity to monitor the connection and test features:

1. Go to `Window > MCP Debug`

2. Use the debug window to:

    Available Tools

    The Unity MCP integration provides several tools to AI assistants:

    Unity Editor Tools
    • get_editor_state: Get comprehensive information about the Unity project and editor state
    • get_current_scene_info: Get detailed information about the current scene
    • get_game_objects_info: Get information about specific GameObjects in the scene
    • execute_editor_command: Execute C# code directly in the Unity Editor
    • get_logs: Retrieve and filter Unity console logs
    • verify_connection: Check if there's an active connection to Unity Editor
    Filesystem Tools
    • read_file: Read contents of a file in your Unity project
    • read_multiple_files: Read multiple files at once
    • write_file: Create or overwrite a file with new content
    • edit_file: Make targeted edits to existing files with diff preview
    • list_directory: Get a listing of files and folders in a directory
    • directory_tree: Get a hierarchical view of directories and files
    • search_files: Find files matching a search pattern
    • get_file_info: Get metadata about a specific file or directory
    • find_assets_by_type: Find all assets of a specific type (e.g. Material, Prefab)
    • list_scripts: Get a listing of all C# scripts in the project

    File paths can be absolute or relative to the Unity project's Assets folder. For example, `"Scenes/MyScene.unity"` refers to `/Assets/Scenes/MyScene.unity`.

    ๐Ÿ› ๏ธ Architecture

    The integration consists of two main components:

    1. Unity Plugin (C#): Resides in the Unity Editor and provides access to Editor APIs

    2. MCP Server (TypeScript/Node.js): Implements the MCP protocol and communicates with the Unity plugin

    Communication between them happens via WebSocket, transferring JSON messages for commands and data.

    File System Access

    The Unity MCP integration now includes powerful filesystem tools that allow AI assistants to:

    • Browse, read, and edit files in your Unity project
    • Create new files and directories
    • Search for specific files or asset types
    • Analyze your project structure
    • Make targeted code changes with diff previews

    All file operations are restricted to the Unity project directory for security. The system intelligently handles both absolute and relative paths, always resolving them relative to your project's Assets folder for convenience.

    Example usages:

    • Get a directory listing: `list_directory(path: "Scenes")`
    • Read a script file: `read_file(path: "Scripts/Player.cs")`
    • Edit a configuration file: `edit_file(path: "Resources/config.json", edits: [{oldText: "value: 10", newText: "value: 20"}], dryRun: true)`
    • Find all materials: `find_assets_by_type(assetType: "Material")`

    ๐Ÿ‘ฅ Contributing

    Contributions are welcome! Here's how you can contribute:

    1. Fork the repository

    2. Create a feature branch (`git checkout -b feature/amazing-feature`)

    3. Make your changes

    4. Commit your changes (`git commit -m 'Add some amazing feature'`)

    5. Push to the branch (`git push origin feature/amazing-feature`)

    6. Open a Pull Request

    Development Setup

    Unity Side:

    • Open the project in Unity
    • Modify the C# scripts in the `UnityMCPConnection/Editor` directory

    Server Side:

    • Navigate to the `mcpServer` directory
    • Install dependencies: `npm install`
    • Make changes to the TypeScript files in the `src` directory
    • Build the server: `npm run build`
    • Run the server: `node build/index.js`

    ๐Ÿ“„ License

    This project is licensed under the MIT License - see the LICENSE file for details.

    ๐Ÿ“ž Support

    If you encounter any issues or have questions, please file an issue on the GitHub repository.

    Frequently asked questions

    What is unitymcpintegration?

    unitymcpintegration is Enable AI Agents to Control Unity

    How do I install unitymcpintegration?

    Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

    Is unitymcpintegration open source?

    Yes โ€” it is hosted on GitHub at https://github.com/quazaai/UnityMCPIntegration and has 93 stars.

    Related MCP tools

    justinpbarnettunity-mcp

    An MCP server that allows MCP clients like Claude Desktop or Cursor to perform actions in the Unity Editor C#-based implementation.

    3,727 C#
    aiai-integrationanthropic+15
    CoderGamestermcp-unity

    Model Context Protocol (MCP) plugin to connect with Unity Editor โ€” designed for OpenAI, Gemini, Claude, Deepseek and Grok interoperability

    1,061 C#
    aiclaude-aiclaudecode+13
    zhayujiechatgpt-on-wechat

    ๅŸบไบŽๅคงๆจกๅž‹ๆญๅปบ็š„่Šๅคฉๆœบๅ™จไบบ๏ผŒๅŒๆ—ถๆ”ฏๆŒ ๅพฎไฟกๅ…ฌไผ—ๅทใ€ไผไธšๅพฎไฟกๅบ”็”จใ€้ฃžไนฆใ€้’‰้’‰ ็ญ‰ๆŽฅๅ…ฅ๏ผŒๅฏ้€‰ๆ‹ฉChatGPT/Claude/DeepSeek/ๆ–‡ๅฟƒไธ€่จ€/่ฎฏ้ฃžๆ˜Ÿ็ซ/้€šไน‰ๅƒ้—ฎ/ Gemini/GLM-4/Kimi/LinkAI๏ผŒ่ƒฝๅค„็†ๆ–‡ๆœฌใ€่ฏญ้Ÿณๅ’Œๅ›พ็‰‡๏ผŒ่ฎฟ้—ฎๆ“ไฝœ็ณป็ปŸๅ’Œไบ’่”็ฝ‘๏ผŒๆ”ฏๆŒๅŸบไบŽ่‡ชๆœ‰็Ÿฅ่ฏ†ๅบ“่ฟ›่กŒๅฎšๅˆถไผไธšๆ™บ่ƒฝๅฎขๆœใ€‚

    39,573 Python
    aiai-agentchatgpt+17
    mudlerlocalai

    :robot: The free, Open Source alternative to OpenAI, Claude and others. Self-hosted and local-first. Drop-in replacement for OpenAI, running on consumer-gra...

    36,790 Go
    aiapiaudio-generation+17
    danny-avilalibrechat

    Enhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini...

    31,284 TypeScript
    aianthropicartifacts+17
    ComposioHQcomposio

    Composio equips your AI agents & LLMs with 100+ high-quality integrations via function calling for the Model Context Protocol. Enhance AI assistants with powerf

    25,863 TypeScript
    agentic-aiagentsai+14

    Run your own MCP server? See who uses it and what to fix.

    Measure it with TrackMCP