Prerequisites
Before starting this tutorial, ensure you have:
- Unity installed (2022 or later recommended)
- Node.js and npm installed on your system (for Claude Code)
- Python 3.11 or higher installed
- A Unity project ready for development
- Basic familiarity with command line/terminal
Install Unity Coplay Package
First, you need to install the Coplay extension inside Unity Editor.
- Open your Unity project
- Install the Coplay package from the Unity Package Manager with the Git URL: https://github.com/CoplayDev/unity-plugin.git#beta
- Ensure the Coplay extension is enabled and running
Install Claude Code CLI
The Claude Code CLI is required to manage MCP server connections.Open your terminal (PowerShell on Windows, Terminal on macOS/Linux) and run:Verify the installation by running:
Add Coplay MCP Server
Now connect the Coplay MCP server to Claude Code. This enables communication between Claude and your Unity Editor.Run the following command in your terminal:Command Breakdown:
--scope user: Installs the server for your user account--transport stdio: Uses standard input/output for communication--env MCP_TOOL_TIMEOUT=720000: Sets a 12-minute timeout for long operationsuvx --python ">=3.11": Uses Python 3.11 or higher to run the server
Verify the Connection
Check that the Coplay MCP server is properly connected:You should see output similar to:
Open Unity and Start Using Claude Code
With everything installed, you can now control Unity through Claude Code:
- Open your Unity project in Unity Editor
- Start a conversation with Claude Code in your terminal or IDE
-
Ask Claude to list open Unity projects:
- List and navigate the scene hierarchy
- Create and modify GameObjects
- Add and configure components
- Generate materials and textures
- Set up Input Actions
- Create UI elements
- Debug and fix scripts
- And much more!
Example: Your First Unity Command
Try a simple command to test the integration:Prompt:Claude will:
- Set the Unity project root
- Create a GameObject with a Cube primitive
- Position it at the specified coordinates
- Create and assign a red material
🎥 Video Tutorials
Watch these guides to see the setup process in action:Installing Coplay in Unity
Step-by-step installation of the Coplay Unity package
Coplay Quick Start
Quick overview of getting started with Coplay
🔧 Troubleshooting
'claude' command not found
'claude' command not found
Solution: Ensure Node.js and npm are properly installed, then run:Restart your terminal after installation.
MCP server not connecting
MCP server not connecting
Solution:
-
Verify Python 3.11+ is installed:
python --version -
Remove and re-add the server:
- Restart Claude Code
Unity project not detected
Unity project not detected
Solution:
- Ensure Unity Editor is open with your project loaded
- Try explicitly setting the project root in Claude Code
- Verify the Coplay Unity package is installed and enabled
Timeout errors on large operations
Timeout errors on large operations
Solution: The default timeout is already set to 12 minutes. For even longer operations, increase the
MCP_TOOL_TIMEOUT value:Pro Tip: Use the
@ symbol to reference specific Unity assets, scripts, or GameObjects in your prompts. For example: “Modify the @PlayerController.cs script to add jump functionality.”Next Steps
Now that Coplay MCP is set up, explore what you can do:- Create GameObjects and Prefabs with natural language
- Generate 3D scenes from text descriptions
- Fix and debug scripts by describing the issue
- Set up Input Actions for player controls
- Build UI systems with automatic layout and styling
- Generate textures and materials with AI