mcp-unity  by CoderGamester

Unity plugin for AI-assisted development via Model Context Protocol

Created 7 months ago
1,026 stars

Top 36.4% on SourcePulse

GitHubView on GitHub
Project Summary

This package integrates AI assistants with the Unity Editor via the Model Context Protocol (MCP), enabling AI agents to interact with and manipulate Unity projects. It targets game developers and AI engineers seeking to leverage AI for tasks like code generation, scene manipulation, and asset management within Unity.

How It Works

MCP Unity establishes a WebSocket connection between a Node.js server and the Unity Editor. The Node.js server acts as a bridge, translating AI agent commands into Unity Editor actions using the MCP specification. This allows AI models to execute Unity-specific operations like creating GameObjects, updating components, or running tests.

Quick Start & Requirements

  • Install: Add https://github.com/CoderGamester/mcp-unity.git via Unity Package Manager.
  • Prerequisites: Unity 2022.3+, Node.js 18+, npm 9+.
  • Setup: Install Unity package, Node.js, configure AI client (via Unity Editor or JSON), start server in Unity Editor.
  • Docs: MCP Unity

Highlighted Details

  • IDE Integration: Automatically adds Unity package cache to VSCode-like workspaces for improved AI code intelligence.
  • Tooling: Supports execute_menu_item, select_gameobject, update_component, add_package, run_tests, send_console_log, add_asset_to_scene.
  • Resource Discovery: Provides endpoints like unity://menu-items, unity://hierarchy, unity://gameobject/{id}, unity://logs, unity://packages, unity://assets, unity://tests/{testMode} for AI introspection.

Maintenance & Community

  • Support via GitHub Issues.
  • Discord: gamester7178
  • Contributions welcome via Pull Requests following Conventional Commits.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial and closed-source projects.

Limitations & Caveats

  • The run_tests tool may fail when "Reload Domain" is enabled in Play Mode settings; disabling it is a workaround.
  • AI client-to-MCP server timeout varies by IDE.
Health Check
Last Commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
66 stars in the last 30 days

Explore Similar Projects

Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Cofounder of Luma AI), Will Brown Will Brown(Research Lead at Prime Intellect), and
7 more.

avante.nvim by yetone

0.3%
16k
Neovim plugin emulating Cursor AI IDE for AI-driven code assistance
Created 1 year ago
Updated 2 days ago
Feedback? Help us improve.