--- title: "The Complete Unity CLI MCP Guide — Building Unity Games with Local AI" date: 2026-09-23 time: "17:06" model: "operator" category: knowhow summary: "Unity CLI MCP lets you connect free local AI models for game development without any paid subscription. This covers the whole process, from installation to connecting an AI agent and real-time game builds." tags: "Unity, UnityCLI, MCP, local-ai, game-dev, AI-coding, CSharp" --- # The Complete Unity CLI MCP Guide — Building Unity Games with Local AI > "With Unity CLI MCP, you can connect free local AI models and develop games without any paid subscription ($10 a month)." The old way required a Unity Pro license or a paid AI API. But by connecting local AI (Claude, Gemini, Ollama, and more) directly to the Unity engine through an MCP (Model Context Protocol) server, you can build a structure where AI writes code and even runs tests at no monthly cost. --- ## 0. What Is MCP, in a Nutshell? ``` MCP = a connecting channel between an AI model and an external program (utility) ``` It acts as a **bridge** that lets AI operate Unity directly. When you tell Claude Desktop or a local AI "make me a cube," an actual cube is created in Unity through the MCP server. --- ## Step 1: Installing Unity CLI and Setting Up the Editor Environment ### 1-1. Installing the CLI from Unity Hub You no longer need to type complicated commands in a terminal as in the past. With the latest Unity Hub, it installs in a few clicks. 1. Launch **Unity Hub (version 3.21 or later)** 2. Click the **toolbox icon** at the top 3. In the **Unity CLI** menu, click **[Install]** 4. After installation, click **[Open]** to launch the terminal ### 1-2. Logging In and Activating the License Enter the following two commands in order in the terminal window: ```bash # 1. CLI-only login via the browser unity auth login # 2. Activate the license for your account unity license activate ``` > Running `unity auth login` automatically opens a browser and logs you into your Unity account. When you return to the terminal after logging in, authentication is complete. ### 1-3. Installing the Editor and Creating a Project ```bash # Install the LTS version editor unity editors --install LTS # Create a new project unity project new [project-name] --template [template-name] ``` **Tip:** If you set the default paths for editors and projects ahead of time in Unity Hub's settings, the CLI automatically follows those default paths, which is convenient. --- ## Step 2: Connecting an AI Agent and Configuring MCP This step links Unity CLI with the AI model installed on your computer through an MCP server. ### 2-1. Building the MCP Configuration File Run the following command in the terminal: ```bash # Check the list of connectable AI platforms unity mcp configure # Add the MCP configuration for the AI you use unity mcp configure claude # when connecting Claude Desktop unity mcp configure gemini # when connecting Gemini unity mcp configure ollama # when connecting local Ollama ``` Running `unity mcp configure` shows a list of connectable AI platforms such as Claude, VS Code, Kimi, and Codex. Specify the name of the AI you use and the MCP server entry file is added automatically. ### 2-2. Injecting Unity Skills from GitHub 1. Search for **"Unity Skills"** on Google → go to the official GitHub page 2. Download the skill package **file (.zip)** → unzip it 3. Go to the **Settings → Skills tab** of the AI app you use (e.g., Claude Desktop) 4. Upload and inject the **'Unity CLI skill'** among the downloaded files > **Tip:** So that the AI can process numerous commands automatically, it is convenient to check the permission setting to **'auto-allow'**. --- ## Step 3: Real-Time Game Development with CLI MCP Once the environment is set up, a single word to the AI is enough for it to operate the Unity engine directly and build a game. ### 3-1. Linking the Project and Installing the Pipeline 1. Set the root folder of the AI project to your Unity project folder 2. Tell the AI **"run the project"** and it automatically opens the workspace through the injected skill 3. At this point the AI analyzes the project's interior and first suggests **"There's no Unity Pipeline package — shall I install it?"** 4. Answer **"yes"** and the core pipeline packages needed for development are set up automatically ### 3-2. Placing Objects and Writing Scripts with a Single Word Just say the following to the AI: ``` "Check the current state of the Scene" → the AI grasps all the hierarchy objects placed in the scene as text "Make a cube and place it in the center of the scene" → the AI creates and places a cube in Unity directly "Build a bullet-dodging game according to the design doc" → the agent judges on its own the C# scripts the design needs, generates them in real time, and places them in the Unity project ``` ### 3-3. The AI Runs Play Tests and Balances Levels by Itself 1. Tell the AI **"try a test play"** 2. The AI runs the tests itself and plays the game 3. If an error occurs during testing or the balance is off, the AI fixes the code on its own 4. It summarizes the results in a clean table and reports back 5. The user simply watches the game come together --- ## Key Summary ``` Step 1: Unity Hub → install CLI → auth login → license activate → editors --install LTS Step 2: unity mcp configure → download Unity Skills from GitHub → inject the skill into the AI app Step 3: link the project → command the AI → place objects/write scripts → the AI tests and fixes ``` > **Key point:** Even without a paid AI API ($10-$100 a month), connecting a local AI model (Ollama, etc.) through an MCP server makes free game development possible. --- ## Reference: Supported AI Platforms | AI platform | MCP connection | Cost | Notes | |-----------|---------|------|------| | **Claude Desktop** | `unity mcp configure claude` | Paid (API key required) | Most stable | | **Ollama (local)** | `unity mcp configure ollama` | Free | Local models such as Llama and Qwen | | **Gemini** | `unity mcp configure gemini` | Free credits | Google account required | | **VS Code (GitHub Copilot)** | `unity mcp configure vscode` | $10 a month | Plugin-based | | **Kimi** | `unity mcp configure kimi` | Free | Chinese service | --- ## Supplement: Frequently Asked Questions **Q. Do I need a Unity Pro license?** A. No. MCP works with the Personal license (free) as well. **Q. Which local AI model is good?** A. For coding, Qwen 2.5 Coder 7B or Llama 3.1 8B is suitable. You can install it from Ollama with `ollama run qwen2.5-coder:7b`. **Q. How is the quality of the C# scripts?** A. Simple scripts (movement, collision, UI) are nearly perfect. Complex game logic requires a process of reviewing and fixing the AI-generated code. **Q. Can it build for mobile (Android/iOS)?** A. Yes. You can build with the `unity build android` command in Unity CLI. --- **Related posts:** - [Local AI Quantization Formats Explained](/knowhow/2026-09-23-local-llm-format-deep-dive/) - [A Complete Guide to Local AI Model Recommendations by Graphics Card](/knowhow/2026-09-23-gpu-local-model-guide/) - [The Complete LM Studio + Llama Setup Guide](/knowhow/2026-09-23-lm-studio-llama-setup-guide/)