Starting from an empty folder, all the way to generating a playable Unity game with physics, materials, animations, and particle effects—without writing a single line of code by hand, driven entirely by natural language and voice commands. This article breaks down the complete practical workflow: you can follow along step by step, or use it as a reference for troubleshooting later.
Background: MCP (Model Context Protocol), open-sourced by Anthropic on November 25, 2024, is a unified open standard for connecting AI assistants with external tools. The development environment in this article is built on top of this protocol.
What You'll Learn
- Setting up a Claude Code + Unity AI development environment with three commands
- Understanding the difference between Skills and MCP tools, and knowing when to use each
- Using voice mode + parallel terminals to have multiple AI agents working simultaneously
- Six tricks for conserving context window, preventing AI from getting "dumber" as it works
- How to verify after installing plugins, and how to troubleshoot when problems arise
Three Commands to Set Up the AI Development Environment
The entire environment setup takes just three steps (Source: cnblogs.com, m.sohu.com):
# 1. Create a Unity project
unity-mcp-cli create-project ./MyUnityProject --unity 6000.3.1f1
# 2. Install the AI Game Developer plugin
unity-mcp-cli install-plugin ./MyUnityProject
# 3. Open the project and keep it connected
unity-mcp-cli open ./MyUnityProject --keep-connected
While Unity loads, start Claude Code in the project directory. Open the Generate Skills switch in the plugin window—it will automatically generate a batch of skill files for Claude Code to auto-discover, giving you 57 commands out of the box (Source: cnblogs.com). After restarting Claude Code, type / to see the full command list.
Skills vs. MCP Tools: The Difference Is Bigger Than You Think
The project supports both capability exposure methods, and the overhead gap is significant (Source: cnblogs.com, m.sohu.com):
| Skill | MCP Tool | |
|---|---|---|
| Per-call cost | ~8 tokens | Much heavier |
| Loading | On-demand, doesn't consume context when idle | Always attached to the prompt, whether you use it or not |
| Best for | Single tasks | Situations requiring continuous editor state access |
The judgment criterion is straightforward: when using AI to get things done, the bottleneck is never execution speed—it's the context window. When the context gets too full, AI performance visibly degrades. Therefore, it's recommended—disable MCP tools you don't need (like Gmail, Calendar, etc.), and remember to /clear between tasks, so leftover dialogue from the previous session doesn't drag down the current one (Source: cnblogs.com).
You can install thousands of skills freely at almost no cost. This design philosophy is worth copying for anyone looking to integrate AI into their own toolchain.
Voice-Driven + Parallel AI Agents
Open Claude Code's voice mode (/voice or hold the spacebar), and you can just speak. The first task is simple: "Place three balls in a row in the scene." A few seconds later, the balls appear in the scene (Source: cnblogs.com).
The next step is even more interesting—parallel AI agents. Open multiple Claude Code terminals in the same project directory; each terminal is an independent AI agent with its own context, not interfering with others (Source: cnblogs.com, m.sohu.com). In practice, one agent works on gold, silver, and glass materials while another simultaneously lays down floors and walls. Later on, often two or three agents run at the same time: one writing a WASD rotation controller, another fixing ball positions, and a third adjusting camera angles.
You Don't Need to Handle Errors Yourself
AI won't get everything right on the first try. The plugin's approach is to feed Unity's error messages back to Claude Code in full detail—which tool call failed, which C# snippet didn't compile—and the agent fixes it on its own and retries (Source: cnblogs.com, m.sohu.com).
One detail is telling: when making particle effects, the material displayed as pink (in Unity, pink = missing shader). The author simply said "this material is pink," and the AI located the cause and fixed it on its own. Later, when the particles weren't bright enough or numerous enough, it was the same story—one sentence: "brighter, triple the count."
Install Extensions Mid-Stream, No Restart Needed
The plugin has an extension system for vertical capabilities. Mid-development, the author installed two extension packages: AI Particle System and AI Animation. Once installed, the new skills appeared immediately, going from 57 to 59+ commands, ready to use right away (Source: cnblogs.com, m.sohu.com).
The levitation animation segment was similarly realistic: all decorative objects floating up and down in a loop with scaling, and the animation clips and Animator Controller were all created by the AI itself. The classic pitfall of objects being dragged back to their original positions by animation—the AI solved it with the standard "wrap in a parent GameObject" technique, showing it wasn't using showboating tricks but the everyday patterns of game development.
Six Practical Lessons for Conserving Context
This is the most valuable part of the article. The original author shared these six lessons verbatim (Source: cnblogs.com):
- Prefer skills over MCP tools—context overhead is nearly zero
/clearbetween tasks, don't carry historical baggage- Don't bring the previous task's topics into a new task
- Disable MCP tools and integrations you don't use
- Batch operations using subagents, much faster than sequential calls
- One agent, one focus
Practical result: each task consumes only 3%–5% of the context window. This is why the AI didn't "get dumber" over the entire run.
Architecture Breakdown: What Is GameDev-MCP-Server?
Some might wonder how everything connects underneath. Here we need to distinguish between two repositories (Source: cnblogs.com):
- Unity-MCP (the AI Game Developer plugin): the half that runs inside Unity Editor, providing 70+ tools covering scenes, assets, scripts, editor control, testing, and Profiler
- GameDev-MCP-Server: a standalone .NET service running in the middle as a "messenger"
The most interesting design of the GameDev-MCP-Server repository is that one codebase serves three engines simultaneously—Unity-MCP, Godot-MCP, and Unreal-MCP all share it. The repository contains no engine-specific code; the actual tools are dynamically provided by the engine plugins that connect (Source: cnblogs.com). The topology is clear:
MCP Client ⇄ gamedev-mcp-server ⇄ (SignalR) ⇄ Engine Plugin (Unity / Godot / Unreal)
Installation is equally casual: one dotnet tool install command, run from source, a single Docker command, or just use the pre-compiled cross-platform binaries from the Release (Windows/macOS/Linux, x86/ARM all available).
This "thin server + dynamic registration" approach means: regardless of what engine your team uses, the AI integration layer is the same. Switch engines, and the client-side configuration barely changes.
What the Final Product Looks Like
The final game (Source: cnblogs.com, m.sohu.com):
- WASD controls the rotating floor
- Three physics-enabled metal balls (gold, silver, glass) roll across it
- Colorful decorative objects float with looping animations
- A layer of dust particles fills the scene with atmosphere
And all of this, starting from an empty folder, built entirely through natural language instructions.
Not Just for Claude Code
Although this article uses Claude Code, the plugin itself has no client bias—Cursor, Gemini, GitHub Copilot, VS Code, any MCP-capable client can connect. The entire project is free and open source, under the Apache-2.0 license (Source: cnblogs.com).
Next Steps: Try It Now
If you want to get started, here's the concrete verification path (Source: cnblogs.com):
Quickstart docs: ai-game.dev/docs/quickstart
Download page: ai-game.dev/download
You don't even need to read the docs—just run those three commands, then tell the AI "make me three cubes arranged in a ring with radius 2," and you'll figure out the rest on your own.
Verify Immediately After Installation
After running the three commands, follow these steps to confirm the environment is truly ready:
- Check the skill list: type
/in Claude Code and confirm 57 commands appear in the list - Check the MCP connection: type
/mcpand confirm the corresponding MCP server is in the list - Do a small operation: ask the AI to "place a Cube in the scene" and confirm it actually appears in the Hierarchy
- Try a Play Mode loop: ask the AI to "enter Play Mode, run for 3 seconds, and take a screenshot of the Game view"
Troubleshooting Common Issues
If step 3 fails, check in this order:
- Is Unity Editor running? MCP requires the Editor to be running to connect
- Is the port occupied? Default port is 8765; if occupied, you can change it in the panel (Source: mcp.csdn.net)
- Is the client configuration correct? Check
.mcp.jsonor your client's MCP config file, confirming the URL ishttp://127.0.0.1:8765/ - Network listening scope: The plugin only listens on 127.0.0.1 and won't be exposed to the external network—ensure you're operating locally (Source: mcp.csdn.net)
- Unity version compatibility: Funplay MCP requires Unity 2022.3 or higher (verified on 6000.x); CoplayDev unity-mcp supports Unity 2021.3 LTS through 6.x (Source: github.com, mcp.csdn.net)
Important Reminders
A few things to think through before diving in:
- Bypass permissions mode can skip the confirmation dialog on each execution, but it means any instruction—including dangerous operations induced by malicious prompt injection—executes without confirmation. Use it only in trusted environments, and don't enable it on important machines (Source: cnblogs.com)
- Unity's official Claude Code plugin is currently in beta. Third-party tool terms are governed by Anthropic; Unity provides no warranty. It works, but don't entrust production builds entirely to it (Source: xuyi.dev)
- AI won't do your gameplay design for you. It excels at executing known patterns, batch operations, and mechanical refactoring; it's not great at novel creative work or gut-check judgment (Source: strayspark.studio)
- The context window is the bottleneck, not execution speed. The key to keeping AI efficient is using context wisely, not hoping the model gets "5% smarter" (Source: cnblogs.com)