Skip to main content
Coplay MCP (Model Context Protocol) bridges Claude Code and Unity Editor, allowing you to control Unity directly from your AI assistant. This integration enables you to create GameObjects, modify components, generate scenes, and debug your Unity projects through natural language commands.
1

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
2

Install Unity Coplay Package

First, you need to install the Coplay extension inside Unity Editor.
  1. Open your Unity project
  2. Install the Coplay package from the Unity Package Manager with the Git URL: https://github.com/CoplayDev/unity-plugin.git#beta
  3. Ensure the Coplay extension is enabled and running
3

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:
After installation, you may need to restart your terminal for the claude command to be recognized.
Verify the installation by running:
4

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 operations
  • uvx --python ">=3.11": Uses Python 3.11 or higher to run the server
5

Verify the Connection

Check that the Coplay MCP server is properly connected:
You should see output similar to:
If you see an error or the server isn’t listed, try restarting your terminal and running the verification command again.
6

Open Unity and Start Using Claude Code

With everything installed, you can now control Unity through Claude Code:
  1. Open your Unity project in Unity Editor
  2. Start a conversation with Claude Code in your terminal or IDE
  3. Ask Claude to list open Unity projects:
Claude will now have access to your Unity project and can:
  • 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!
7

Example: Your First Unity Command

Try a simple command to test the integration:Prompt:
Claude will:
  1. Set the Unity project root
  2. Create a GameObject with a Cube primitive
  3. Position it at the specified coordinates
  4. Create and assign a red material
Check your Unity Scene view to see the result!
8

Set Unity Project Root (Optional)

If you’re working with multiple Unity projects, you can explicitly set which project Claude should work with:Prompt:
This ensures all Unity commands target the correct project.

🎥 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

Solution: Ensure Node.js and npm are properly installed, then run:
Restart your terminal after installation.
Solution:
  1. Verify Python 3.11+ is installed: python --version
  2. Remove and re-add the server:
  3. Restart Claude Code
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
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
Start by asking Claude: “What can you do with Unity through Coplay MCP?”