Unity MCP Integration

by quazaai

331 downloads
Not rated
GitHub

About

An MCP server for Unity, enabling AI assistants to interact with projects in real-time, access scene data, and execute code.

Details

Author
quazaai
Downloads
331
Categories
Other, Developer Tools

- Real‑time access to Unity Editor and project state
- Retrieve detailed information about the current scene and GameObjects
- Execute C# code directly in the Unity Editor via a tool call
- Fetch and filter Unity console logs
- Control the Editor’s play mode through AI assistants

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Unity MCP Integration
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the Unity package via the Package Manager using the Git URL or import the custom package. Then, navigate to the mcpServer directory, run npm install and node build/index.js to start the MCP server, or add the server configuration to your MCP Host. Use the MCP Debug window (Window > MCP Debug) to monitor the connection and test features.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "unity mcp integration": {
            "unity-mcp-server": {
                "command": "node",
                "args": [
                    "<path-to-project>/mcpServer/build/index.js"
                ]
            }
        }
    }
}

McpServers

{
    "unity-mcp-server": {
        "command": "node",
        "args": [
            "<path-to-project>/mcpServer/build/index.js"
        ]
    }
}

An MCP server for Unity, enabling AI assistants to interact with projects in real-time, access scene data, and execute code.

This package provides a seamless integration betweenModel 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.

- 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

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

You have several options to install the Unity package:
- Open the Unity Package Manager (Window > Package Manager)
- Click the+button and selectAdd package from git URL...
- Enter the repository URL:https://github.com/quazaai/UnityMCPIntegration.git
- ClickAdd
- Clone this repository or
download it as a unityPackage
- In Unity, go toAssets > Import Package > Custom Package
- Select theUnityMCPIntegration.unitypackagefile

You have two options to run the MCP server:
- Navigate to themcpServer (likely <path-to-project>\Library\PackageCache\com.quaza.unitymcp@d2b8f1260bca\mcpServer\)directory
- Install dependencies:

npm install

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

{ "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" } } } }

To install Unity MCP Integration for Claude Desktop automatically viaSmithery:

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

You can open the MCP Debug window in Unity to monitor the connection and test features:
- Go toWindow > MCP Debug
- Use the debug window to:

- Check connection status
- Test code execution
- View logs
- Monitor events

The Unity MCP integration provides several tools to AI assistants:

- 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

- 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<project>/Assets/Scenes/MyScene.unity.

The integration consists of two main components:
- Unity Plugin (C#): Resides in the Unity Editor and provides access to Editor APIs
- 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.

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.

- 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")

Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Make your changes
- Commit your changes (git commit -m 'Add some amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request

- Open the project in Unity
- Modify the C# scripts in theUnityMCPConnection/Editordirectory

- Navigate to themcpServerdirectory
- Install dependencies:npm install
- Make changes to the TypeScript files in thesrcdirectory
- Build the server:npm run build
- Run the server:node build/index.js

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

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

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Godot Engine integration: 17 tools for game development

Fennara MCP connects AI agents like Codex, Cursor, Claude Code, and Claude Desktop to Godot-aware tools for real Godot projects. It focuses on feedback from Godot: GDScript diagnostics, scene validation, runtime errors, scene inspection, node properties, screenshots, SemanticSearch, and patch-and-rerun workflows.

The intelligent MCP server for AI-assisted Godot 4 development. 35 tools for spatial intelligence, code understanding, flow tracing, and visual debugging. 22 free, full suite $19.

A secure, 100% native GDScript Server-Sent Events (SSE) server bridging Claude, Cursor, and Windsurf directly to Godot 4.x scene trees. No Node.js or C# dependencies required.

An MCP server that helps coding agents to work with Minecraft mod development

Free, open-source MCP server for Roblox Studio. Push-based SSE transport, editor-safe script edits, 29 token-lean tools.

Connect AI coding agents to a live Roblox Studio session.

A template project demonstrating interaction between a TypeScript-based MCP server and a Unity client.

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

Local stdio MCP server that lets AI coding agents read and maintain structured architecture, rules, and decisions directly from your repository.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.