You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-95Lines changed: 59 additions & 95 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# MCP for Unity ✨
1
+
<imgwidth="676"height="380"alt="MCP for Unity"src="https://github.com/user-attachments/assets/b712e41d-273c-48b2-9041-82bd17ace267" />
2
2
3
3
#### Proudly sponsored and maintained by [Coplay](https://www.coplay.dev/?ref=unity-mcp) -- the best AI assistant for Unity. [Read the backstory here.](https://www.coplay.dev/blog/coplay-and-open-source-unity-mcp-join-forces)
4
4
@@ -15,9 +15,9 @@
15
15
16
16
MCP for Unity acts as a bridge, allowing AI assistants (like Claude, Cursor) to interact directly with your Unity Editor via a local **MCP (Model Context Protocol) Client**. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
@@ -50,37 +50,36 @@ MCP for Unity acts as a bridge, allowing AI assistants (like Claude, Cursor) to
50
50
51
51
---
52
52
53
-
## How It Works 🤔
53
+
## How It Works
54
54
55
55
MCP for Unity connects your tools using two components:
56
56
57
57
1.**MCP for Unity Bridge:** A Unity package running inside the Editor. (Installed via Package Manager).
58
58
2.**MCP for Unity Server:** A Python server that runs locally, communicating between the Unity Bridge and your MCP Client. (Installed automatically by the package on first run or via Auto-Setup; manual setup is available as a fallback).
59
59
60
-
**Flow:**`[Your LLM via MCP Client] <-> [MCP for Unity Server (Python)] <-> [MCP for Unity Bridge (Unity Editor)]`
* [Visual Studio Code Copilot](https://code.visualstudio.com/docs/copilot/overview)
82
-
* [Windsurf](https://windsurf.com)
83
-
**(Others may work with manual config)*
80
+
81
+
***An MCP Client:**: [Claude Desktop](https://claude.ai/download) | [Claude Code](https://github.com/anthropics/claude-code) | [Cursor](https://www.cursor.com/en/downloads) | [Visual Studio Code Copilot](https://code.visualstudio.com/docs/copilot/overview) | [Windsurf](https://windsurf.com) | Others work with manual config
82
+
84
83
*<details><summary><strong>[Optional] Roslyn for Advanced Script Validation</strong></summary>
85
84
86
85
For **Strict** validation level that catches undefined namespaces, types, and methods:
@@ -102,7 +101,8 @@ MCP for Unity connects your tools using two components:
102
101
103
102
**Note:** Without Roslyn, script validation falls back to basic structural checks. Roslyn enables full C# compiler diagnostics with precise error reporting.</details>
104
103
105
-
### 🌟Step 1: Install the Unity Package🌟
104
+
---
105
+
### 🌟 Step 1: Install the Unity Package
106
106
107
107
#### To install via Git URL
108
108
@@ -118,14 +118,13 @@ MCP for Unity connects your tools using two components:
118
118
119
119
#### To install via OpenUPM
120
120
121
-
1. Instal the [OpenUPM CLI](https://openupm.com/docs/getting-started-cli.html)
121
+
1. Install the [OpenUPM CLI](https://openupm.com/docs/getting-started-cli.html)
122
122
2. Open a terminal (PowerShell, Terminal, etc.) and navigate to your Unity project directory
123
123
3. Run `openupm add com.coplaydev.unity-mcp`
124
124
125
125
**Note:** If you installed the MCP Server before Coplay's maintenance, you will need to uninstall the old package before re-installing the new one.
126
126
127
-
### Step 2: Configure Your MCP Client
128
-
127
+
### 🛠️ Step 2: Configure Your MCP Client
129
128
Connect your MCP Client (Claude, Cursor, etc.) to the Python server set up in Step 1 (auto) or via Manual Configuration (below).
@@ -147,14 +146,31 @@ Connect your MCP Client (Claude, Cursor, etc.) to the Python server set up in St
147
146
148
147
If Auto-Setup fails or you use a different client:
149
148
150
-
1. **Find your MCP Client\'s configuration file.** (Check client documentation).
149
+
1. **Find your MCP Client's configuration file.** (Check client documentation).
151
150
**Claude Example (macOS):*`~/Library/Application Support/Claude/claude_desktop_config.json`
152
151
**Claude Example (Windows):*`%APPDATA%\Claude\claude_desktop_config.json`
153
152
2. **Edit the file** to add/update the `mcpServers` section, using the *exact* paths from Step 1.
154
153
155
154
<details>
156
155
<summary><strong>Click for Client-Specific JSON Configuration Snippets...</strong></summary>
157
156
157
+
---
158
+
**Claude Code**
159
+
160
+
If you're using Claude Code, you can register the MCP server using the below commands:
161
+
🚨**make sure to run these from your Unity project's home directory**🚨
162
+
163
+
**macOS:**
164
+
165
+
```bash
166
+
claude mcp add UnityMCP -- uv --directory /Users/USERNAME/Library/AppSupport/UnityMCP/UnityMcpServer/src run server.py
167
+
```
168
+
169
+
**Windows:**
170
+
171
+
```bash
172
+
claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Local/Microsoft/WinGet/Links/uv.exe" --directory "C:/Users/USERNAME/AppData/Local/UnityMCP/UnityMcpServer/src" run server.py
173
+
```
158
174
**VSCode (all OS)**
159
175
160
176
```json
@@ -181,7 +197,7 @@ On Windows, set `command` to the absolute shim, e.g. `C:\\Users\\YOU\\AppData\\L
@@ -234,21 +250,7 @@ On Windows, set `command` to the absolute shim, e.g. `C:\\Users\\YOU\\AppData\\L
234
250
235
251
(Replace YOUR_USERNAME)
236
252
237
-
**For Claude Code**
238
-
239
-
If you\'re using Claude Code, you can register the MCP server using these commands:
240
253
241
-
**macOS:**
242
-
243
-
```bash
244
-
claude mcp add UnityMCP -- uv --directory /[PATH_TO]/UnityMCP/UnityMcpServer/src run server.py
245
-
```
246
-
247
-
**Windows:**
248
-
249
-
```bash
250
-
claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Roaming/Python/Python313/Scripts/uv.exe" --directory "C:/Users/USERNAME/AppData/Local/Programs/UnityMCP/UnityMcpServer/src" run server.py
251
-
```
252
254
</details>
253
255
254
256
---
@@ -261,58 +263,19 @@ claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Roaming/Python/Python313/S
261
263
262
264
3. **Interact!** Unity tools should now be available in your MCP Client.
263
265
264
-
Example Prompt: `Create a 3D player controller`, `Create a yellow and bridge sun`, `Create a cool shader and apply it on a cube`.
265
-
266
-
---
267
-
268
-
## Future Dev Plans (Besides PR) 📝
269
-
270
-
### 🔴 High Priority
271
-
272
-
- [ ] **Asset Generation Improvements** - Enhanced server request handling and asset pipeline optimization
- [x] **Shader Generation** - Generate shaders using CGProgram template
293
-
- [x] **Advanced Script Validation** - Multi-level validation with semantic analysis, namespace/type checking, and Unity best practices (Will need Roslyn Installed, see [Prerequisite](#prerequisites)).
294
-
</details>
295
-
296
-
### 🔬 Research & Exploration
297
-
298
-
- [ ] **AI-Powered Asset Generation** - Integration with AI tools for automatic 3D models, textures, and animations
299
-
- [ ] **Real-time Collaboration** - Live editing sessions between multiple developers *(Currently in progress)*
- [ ] **AR/VR Tool Integration** - Extended support for immersive development workflows
266
+
Example Prompt: `Create a 3D player controller`, `Create a tic-tac-toe game in 3D`, `Create a cool shader and apply to a cube`.
303
267
304
268
---
305
269
306
-
## For Developers 🛠️
270
+
## Development & Contributing 🛠️
307
271
308
-
### Development Tools
272
+
### For Developers
309
273
310
-
If you\'re contributing to MCP for Unity or want to test core changes, we have development tools to streamline your workflow:
274
+
If you're contributing to MCP for Unity or want to test core changes, we have development tools to streamline your workflow:
311
275
312
276
- **Development Deployment Scripts**: Quickly deploy and test your changes to MCP for Unity Bridge and Python Server
313
277
- **Automatic Backup System**: Safe testing with easy rollback capabilities
314
278
- **Hot Reload Workflow**: Fast iteration cycle for core development
315
-
- **More coming!**
316
279
317
280
📖 **See [README-DEV.md](README-DEV.md)** for complete development setup and workflow documentation.
318
281
@@ -321,15 +284,10 @@ If you\'re contributing to MCP for Unity or want to test core changes, we have d
321
284
Help make MCP for Unity better!
322
285
323
286
1. **Fork** the main repository.
324
-
325
287
2. **Create a branch** (`feature/your-idea` or `bugfix/your-fix`).
326
-
327
288
3. **Make changes.**
328
-
329
289
4. **Commit** (feat: Add cool new feature).
330
-
331
290
5. **Push** your branch.
332
-
333
291
6. **Open a Pull Request** against the main branch.
334
292
335
293
---
@@ -344,12 +302,18 @@ Help make MCP for Unity better!
344
302
- Check the status window: Window > MCP for Unity.
345
303
- Restart Unity.
346
304
- **MCP Client Not Connecting / Server Not Starting:**
347
-
- **Verify Server Path:** Double-check the --directory path in your MCP Client\'s JSON config. It must exactly match the location where you cloned the UnityMCP repository in Installation Step 1 (e.g., .../Programs/UnityMCP/UnityMcpServer/src).
348
-
- **Verify uv:** Make sure `uv` is installed and working (pip show uv).
349
-
- **Run Manually:** Try running the server directly from the terminal to see errors: `# Navigate to the src directory first! cd /path/to/your/UnityMCP/UnityMcpServer/src uv run server.py`
350
-
- **Permissions (macOS/Linux):** If you installed the server in a system location like /usr/local/bin, ensure the user running the MCP client has permission to execute uv and access files there. Installing in~/bin might be easier.
305
+
- **Verify Server Path:** Double-check the --directory path in your MCP Client's JSON config. It must exactly match the installation location:
0 commit comments