Unity Integration (Advanced)

Unity Integration (Advanced)

Seamless MCP integration for Unity Editor enabling AI to interact, fetch data, and execute code.

94
Stars
24
Forks
1
Releases

Overview

This MCP server provides a bridge between the Model Context Protocol and the Unity Editor, enabling real-time interaction with Unity projects through AI assistants. It exposes editor state, scene hierarchy, game object information, and project settings to clients over WebSocket, and allows executing C# code directly within the Unity Editor. In addition to code execution, it includes robust filesystem tools for reading, writing, editing, and listing files, confined to the Unity project assets directory for security. The server works in tandem with a Unity plugin (C#) and a Node.js-based MCP server (TypeScript/JavaScript), communicating via JSON over WebSocket to transfer commands and data. Key capabilities include retrieving editor state, obtaining current scene details, inspecting objects, reading and modifying files, and managing logs and errors. It also supports monitoring and controlling the Editor’s play mode, and provides convenient methods to locate assets by type and enumerate project files. This setup is suitable for AI-assisted development, asset creation, script editing, debugging, and automated workflows within Unity.

Details

Owner
quazaai
Language
C#
License
MIT License
Updated
2025-12-07

Features

Browse and manipulate project files directly

AI assistants can browse and modify files within the Unity project through the MCP integration.

Access real-time information about your Unity project

Real-time project and editor data available to clients via MCP.

Understand your scene hierarchy and game objects

Expose scene structure and components to AI for analysis and manipulation.

Execute C# code directly in the Unity Editor

Run C# commands inside Editor context to perform changes, tests, or diagnostics.

Monitor logs and errors

Stream Unity console logs and error messages to the MCP client for debugging.

Control the Editor's play mode

Manage play mode from MCP (start/stop/play/pause).

Wait For Code Execution

Provide synchronization by waiting for code execution to finish before proceeding.

Audience

AI assistantsEnable real-time Unity project interaction and automation via MCP inside the Editor.

Tags

UnityMCPUnity MCPEditorAI assistantsWebSocketFilesystemCode executionScene hierarchyLogsPlay modeC#TypeScriptNode.js