UnityMCP  by Arodoid

Unity editor plugin for AI assistant integration via Model Context Protocol

created 6 months ago
459 stars

Top 66.9% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Unity Editor plugin and a companion Node.js server to enable AI assistants to interact with and control the Unity game engine. It targets Unity developers and AI researchers looking to integrate AI-driven workflows into game development, offering real-time editor state monitoring, remote command execution, and logging.

How It Works

The system uses a WebSocket-based Model Context Protocol (MCP) for real-time, bidirectional communication. A Unity Editor plugin (C#) acts as the client, monitoring editor state, executing C# code, and logging events. A Node.js server exposes these functionalities via standardized tools, allowing AI assistants to query editor state, execute arbitrary C# code within the Unity environment, and retrieve logs. This approach allows AI models to directly manipulate and query the Unity editor state, facilitating complex automation and debugging tasks.

Quick Start & Requirements

  • Install via Smithery: npx -y @smithery/cli install @Arodoid/unitymcp --client claude
  • Prerequisites: Unity 2022.3+, Node.js 18+, npm 9+.
  • Unity Plugin Setup: Copy UnityMCPPlugin folder to Unity project's Assets.
  • MCP Server Setup: cd unity-mcp-server && npm install && npm run build.
  • Start Server: cd unity-mcp-server && node build/index.js.
  • Connect from Unity: Open UnityMCP Debug Window (Window > UnityMCP > Debug Window).
  • Docs: [Not explicitly linked, but implied by the README structure.]

Highlighted Details

  • Real-time Unity Editor state monitoring (GameObjects, selection, play mode).
  • Remote C# code execution with full UnityEngine and UnityEditor API access.
  • Comprehensive logging retrieval with filtering and buffer management.
  • WebSocket communication on port 8080 using JSON messages.
  • Automatic reconnection and command timeout protection.

Maintenance & Community

  • Contributing: Standard GitHub pull request workflow.
  • Community: No explicit links to Discord, Slack, or forums provided in the README.

Licensing & Compatibility

  • License: Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).
  • Compatibility: Non-commercial use only. Commercial use or integration into closed-source projects is restricted by the CC BY-NC 4.0 license.

Limitations & Caveats

The CC BY-NC 4.0 license strictly prohibits commercial use, limiting adoption for professional game development studios. The README does not detail specific performance benchmarks or extensive testing across different Unity versions or operating systems.

Health Check
Last commit

4 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
36 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.