agentleFS
IdoCohen560IdoCohen560/claude-unity-game-studio/unity-mcp/CLAUDE.md

claude-unity-game-studio / unity-mcp

CLAUDE.md17 starsChanged 8 months agoMITView on GitHub

Unity-MCP bridges LLMs (Claude, Cursor, Copilot, etc.) with Unity Editor and Runtime via the Model Context Protocol. It consists of these sub-projects: Version is sourced from Unity-MCP-Plugin/Assets/root/package.json. Bump with .\commands\bump-version.ps1 <version>. See .github/workflows/ for all pipelines. PRs from untrusted contributors require a ci-ok label from a maintainer before CI runs. These apply across both C# sub-projects: Non-negotiable principles and architecture constraints: .specify/memory/constitution.md Code review: You MUST read the constitution before performing any code review. It contains critical rules for code…

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All Unity API calls must use MainThread.Instance.Run(() => ...) or RunAsync()

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Repository Overview

Unity-MCP bridges LLMs (Claude, Cursor, Copilot, etc.) with Unity Editor and Runtime via the Model Context Protocol. It consists of these sub-projects:

Sub-projectLocationDescription
MCP ServerUnity-MCP-Server/C# ASP.NET Core server — bridges MCP clients and Unity Plugin via SignalR
MCP PluginUnity-MCP-Plugin/Unity Editor/Runtime plugin — executes MCP tools and manages connection
CLIcli/Command-line interface for Unity-MCP
InstallerInstaller/Unity package that installs the plugin and its dependencies
Unity-TestsUnity-Tests/Test project for Unity-MCP

System Architecture

MCP Client (Claude/Cursor/etc.)
      ↕ stdio or streamableHttp
Unity-MCP-Server  (ASP.NET Core + MCP SDK)
      ↕ SignalR
Unity-MCP-Plugin  (Unity Editor/Runtime)
      ↕ Unity API (main thread)
Unity Engine
  • The MCP Server is a standalone binary downloaded automatically by the plugin to Library/mcp-server/{platform}/. It is also published to Docker Hub and NuGet.
  • The MCP Plugin auto-starts the server binary on Unity Editor load ([InitializeOnLoad]). Port is deterministic: SHA256 hash of project path, mapped to 20000–29999.
  • Communication inside Unity always runs on the main thread via MainThread.Instance.Run().

Release & Versioning

Version is sourced from Unity-MCP-Plugin/Assets/root/package.json. Bump with .\commands\bump-version.ps1 <version>.

CI/CD

See .github/workflows/ for all pipelines. PRs from untrusted contributors require a ci-ok label from a maintainer before CI runs.

Key Coding Conventions

These apply across both C# sub-projects:

  • #nullable enable at the top of every file
  • Copyright box comment header in every file
  • MCP tool classes are partial — one operation per file (e.g., Tool_GameObject.Create.cs)
  • MCP tools MUST return structured types (data models, List<T>, void, or Task) — avoid raw string returns
  • All Unity API calls must use MainThread.Instance.Run(() => ...) or RunAsync()
  • Tool/prompt names use kebab-case with category prefix (e.g., gameobject-create, assets-find)
  • Namespace pattern: com.IvanMurzak.Unity.MCP.[Tier].[Component]
  • No Reflection for private access — C# Reflection (System.Reflection) MUST NOT be used to access private, internal, or non-public members. Exception: ReflectorNet library usage is allowed.

Project Constitution

Non-negotiable principles and architecture constraints: .specify/memory/constitution.md

Code review: You MUST read the constitution before performing any code review. It contains critical rules for code quality, safety, and project governance that all reviews must verify against.

Documentation

README.md                                                        ← Root project documentation
Unity-MCP-Plugin/Assets/root/README.md                           ← Copy of root README.md *
Installer/Assets/com.IvanMurzak/AI Game Dev Installer/README.md  ← Copy of root README.md *
docs/
├── README.es.md                                                 ← Spanish translation of root README *
├── README.ja.md                                                 ← Japanese translation *
└── README.zh-CN.md                                              ← Simplified Chinese translation *
Unity-MCP-Server/README.md                                       ← MCP Server documentation
Unity-MCP-Server/MCP-Test-Client/README.md                       ← Test client documentation
cli/README.md                                                    ← CLI documentation
cli/docs/
├── README.es.md                                                 ← Spanish translation of CLI README
├── README.ja.md                                                 ← Japanese translation
└── README.zh-CN.md                                              ← Simplified Chinese translation

Files marked with * MUST be kept in sync with README.md when it changes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.