Rust-built Model Context Protocol server for autonomous Unity code development

Rust-built Model Context Protocol server for autonomous Unity code development

unity_code_mcp•byhackerzhuli

A lightweight MCP server that gives AI agents tools to trigger Unity asset/compilation refresh and run Unity tests, returning compile errors and test results.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides an Asset Database Refresh tool that triggers Unity compilation and asset processing and returns compile errors and warnings from the refresh.
  • •Provides a Test Execution tool that runs Unity tests with reporting and supports EditMode and PlayMode tests.
  • •Ships as a single binary with no runtime dependencies and communicates with the Unity Editor over UDP.

BEST FOR

  • •AI agents that need to write Unity code, compile, fix errors, and run tests autonomously.
  • •Developers wanting an AI workflow that iteratively fixes compile errors and test failures in a Unity project.

ABOUT UNITY_CODE_MCP

Rust-built Model Context Protocol server for autonomous Unity code development is cataloged as an MCP server attributed to hackerzhuli. A lightweight MCP server that gives AI agents tools to trigger Unity asset/compilation refresh and run Unity tests, returning compile errors and test results. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Rust-built Model Context Protocol server for autonomous Unity code development are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does Unity Code MCP require Node.js, Python, or .NET?

No. It is a single binary with no runtime dependencies.

What Unity version is required?

Unity 6.0 or higher is listed as a prerequisite.

Upstream README

View this exact version on GitHub

README.md · 8530379b6b10 · Fetched 2026-11-13 11:36:26 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

Unity Code MCP

Description

Unity Code MCP is a coding focused Model Context Protocol (MCP) server that enables AI agents to write Unity code autonomously.

🎯 Why Unity Code MCP?

Unity Code MCP is a high-performance, coding-focused MCP server built in Rust. It handles Unity's compilation cycles gracefully while providing only the essential tools needed for autonomous code development: compilation feedback and test execution.

This MCP server enables AI agents to develop Unity code autonomously with exceptional speed and reliability - write code, compile, fix compile errors, test, fix bugs, repeat, just like how a human would.

✨ Key Features

  • 🤖 Coding-Optimized: Streamlined tools designed for efficient AI agent coding workflows
  • ⚡ Lightweight and High Performance: Built in Rust for exceptional speed, minimal memory usage, and lightning-fast response times. Uses only 1MB memory when the workspace is not a Unity Project, and only 10MB when it is and Unity Editor is open for the project. Also, the communication with Unity Editor is based on UDP, so it's minimal load for your system.
  • 🎯 Efficient Communication: Minimal token usage with essential operations, only returns relevant information
  • 🧪 Test-Driven: Comprehensive test execution and reporting capabilities
  • 📦 Self-Contained: Single binary with no runtime dependencies (no Node.js, Python, or .NET required)

🛠️ MCP Server Tools

Unity Code MCP provides 2 tools for autonomous code development:

1. Asset Database Refresh

  • Triggers Unity compilation and asset processing
  • Returns compile errors and other non compile warning and errors only include the logs during the refresh
  • Handles domain reload gracefully

Asset database refresh tool in action:

Asset Database Refresh

2. Test Execution

  • Runs Unity tests with comprehensive reporting
  • Provides detailed stack traces and logs for failures
  • Supports both EditMode and PlayMode tests

Test execution tool in action:

Test Execution

🚀 Autonomous AI agent workflow example

Once configured, AI agents can develop Unity code completely autonomously:

User: "Create a player controller that moves with WASD keys and has jump functionality. Make sure it's fully tested."

AI: I'll create a complete player controller with movement and jumping, then write comprehensive tests.

1. [AI writes PlayerController.cs with movement logic]
2. [AI calls: refresh_asset_database]
   → Result: "Compilation failed: CS0246: The type or namespace name 'Rigidbody' could not be found"
3. [AI fixes the missing using UnityEngine; statement]
4. [AI calls: refresh_asset_database]
   → Result: "Compilation successful, no errors"
5. [AI writes PlayerControllerTests.cs with movement and jump tests]
6. [AI calls: run_tests]
   → Result: "5 tests passed, 2 tests failed: NullReferenceException in Jump_ShouldApplyUpwardForce, ArgumentException in Move_WithInvalidInput"
7. [AI analyzes failures and fixes null reference and input validation bugs]
8. [AI calls: refresh_asset_database]
   → Result: "Compilation successful, no errors"
9. [AI calls: run_tests]
   → Result: "All 7 tests passed successfully"

AI: ✅ Complete! Created a fully functional PlayerController with WASD movement, jump mechanics, and comprehensive test coverage. All tests are passing.

This demonstrates true autonomous development - from user request to fully tested, working Unity code without any human intervention.

AI agent in action, tell Kimi K2 to fix compile errors in Unity project with no context: Kimi K2 fix compile errors

📦 Installation

Prerequisites

  • Unity 6.0 or higher
  • Rust toolchain (for building from source)
  • CMake and a C compiler (required for building dependencies)

Step 1: Install Unity Package

Install the Visual Studio Code Editor package in your Unity project.

Important: The Visual Studio Code Editor package must be enabled (that is, you most select an external script editor provided by Visual Studio Code Editor for it to be enabled) for unity_code_mcp to work. Verify this in Unity at Preferences → External Tools → External Script Editor - it should show something like "Visual Studio Code Editor v1.0.12 enabled".

Step 2: Get the Binary

Option A: Download Release (Recommended) (Windows Only)

  • Download the latest binary from the Releases page

Option B: Build from Source

cargo build --release

Step 3: Configure Your AI Assistant

Add the MCP server to your AI assistant configuration:

For Cursor/Trae:

{
  "mcpServers": {
    "unity-code": {
      "command": "/path/to/unity-code-mcp",
      "env": {
        "UNITY_PROJECT_PATH": "${workspaceFolder}"
      }
    }
  }
}

For VS Code with MCP Extension:

{
  "mcp.servers": {
    "unity-code": {
      "command": "/path/to/unity_code_mcp",
      "env": {
        "UNITY_PROJECT_PATH": "${workspaceFolder}"
      }
    }
  }
}

For Claude Desktop:

{
  "mcpServers": {
    "unity-code": {
      "command": "/path/to/unity_code_mcp"
    }
  }
}

Note: The UNITY_PROJECT_PATH environment variable is a fallback option. If your IDE supports the MCP roots capability, the server will automatically detect Unity projects from the provided workspace roots and prioritize that over the environment variable.

Troubleshooting: If ${workspaceFolder} doesn't work in your IDE, try using an absolute path instead, e.g., "UNITY_PROJECT_PATH": "/absolute/path/to/your/unity/project". Alternatively, ask your IDE developer to add support for the MCP roots capability.

Important: Use absolute paths for the binary command.

Platform support

The code is cross platform, but I can't build or test for other platforms, because I only use Windows. If there are platform specific bugs, you have to fix them yourself.

🧪 Development & Testing

Running Tests

To run the test suite:

  1. Start Unity Editor with the embedded test project:

    # Open Unity Editor and load the project at:
    # ./UnityProject
    
  2. Run tests (single-threaded to avoid Unity conflicts):

    cargo test -- --test-threads=1
    

Note: Tests require a running Unity Editor instance with the embedded project loaded. Tests may take 30-60 seconds to complete due to Unity Editor interactions.

Building from Source

Prerequisites

  • C Compiler: Required for building aws-lc-rs dependency
    • Windows: MSVC (Visual Studio Build Tools)
    • macOS: Xcode Command Line Tools (xcode-select --install)
    • Linux: GCC (sudo apt-get install build-essential on Ubuntu/Debian)
  • CMake: Required for building the aws-lc-rs dependency
    • Windows: Follow the official guide
    • macOS: brew install cmake
    • Linux: sudo apt-get install cmake (Ubuntu/Debian)

Build Commands

# Debug build
cargo build

# Release build (recommended for production)
cargo build --release

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Run tests with cargo test -- --test-threads=1
  4. Submit a pull request

📄 License

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

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Rust-built Model Context Protocol server for autonomous Unity code development from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/unity_code_mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools