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
+39-48Lines changed: 39 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,28 @@
1
1
# Unity MCP ✨
2
2
3
+
#### Proudly sponsored and maintained by [Coplay](https://www.coplay.dev/?ref=unity-mcp), the AI assistant for Unity. [Read the backstory here.](https://www.coplay.dev/blog/coplay-and-open-source-unity-mcp-join-forces)
Unity MCP 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.
13
17
14
18
## 💬 Join Our Community
15
19
16
-
### [Discord](https://discord.gg/vhTUxXaqYr)
20
+
### [Discord](https://discord.gg/y4p8KfzrN4)
17
21
18
22
**Get help, share ideas, and collaborate with other Unity MCP developers!**
19
23
20
-
21
24
---
22
25
23
-
24
26
## Key Features 🚀
25
27
26
28
***🗣️ Natural Language Control:** Instruct your LLM to perform Unity tasks.
@@ -35,7 +37,7 @@ Unity MCP acts as a bridge, allowing AI assistants (like Claude, Cursor) to inte
35
37
36
38
*`read_console`: Gets messages from or clears the console.
* [Visual Studio Code Copilot](https://code.visualstudio.com/docs/copilot/overview)
80
+
* [Windsurf](https://windsurf.com)
79
81
**(Others may work with manual config)*
80
82
*<details><summary><strong>[Optional] Roslyn for Advanced Script Validation</strong></summary>
81
83
@@ -95,9 +97,8 @@ Unity MCP connects your tools using two components:
95
97
3. Ensure .NET compatibility settings are correct
96
98
4. Add `USE_ROSLYN` to Scripting Define Symbols
97
99
5. Restart Unity
98
-
99
-
**Note:** Without Roslyn, script validation falls back to basic structural checks. Roslyn enables full C# compiler diagnostics with precise error reporting.</details>
100
100
101
+
**Note:** Without Roslyn, script validation falls back to basic structural checks. Roslyn enables full C# compiler diagnostics with precise error reporting.</details>
101
102
102
103
### Step 1: Install the Unity Package (Bridge)
103
104
@@ -106,11 +107,13 @@ Unity MCP connects your tools using two components:
6. The MCP Server should automatically be installed onto your machine as a result of this process.
113
114
115
+
**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.
116
+
114
117
### Step 2: Configure Your MCP Client
115
118
116
119
Connect your MCP Client (Claude, Cursor, etc.) to the Python server you installed in Step 1.
@@ -121,13 +124,13 @@ Connect your MCP Client (Claude, Cursor, etc.) to the Python server you installe
121
124
122
125
1. In Unity, go to `Window > Unity MCP`.
123
126
2. Click `Auto Configure` on the IDE you uses.
124
-
3. Look for a green status indicator 🟢 and "Connected". *(This attempts to modify the MCP Client's config file automatically)*.
127
+
3. Look for a green status indicator 🟢 and "Connected". *(This attempts to modify the MCP Client\'s config file automatically)*.
125
128
126
129
**Option B: Manual Configuration**
127
130
128
131
If Auto-Configure fails or you use a different client:
129
132
130
-
1. **Find your MCP Client's configuration file.** (Check client documentation).
133
+
1. **Find your MCP Client\'s configuration file.** (Check client documentation).
131
134
**Claude Example (macOS):*`~/Library/Application Support/Claude/claude_desktop_config.json`
132
135
**Claude Example (Windows):*`%APPDATA%\Claude\claude_desktop_config.json`
133
136
2. **Edit the file** to add/update the `mcpServers` section, using the *exact* paths from Step 1.
@@ -174,6 +177,7 @@ If Auto-Configure fails or you use a different client:
174
177
}
175
178
}
176
179
```
180
+
177
181
(Replace YOUR_USERNAME if using ~/bin)
178
182
179
183
**Linux:**
@@ -197,18 +201,18 @@ If Auto-Configure fails or you use a different client:
197
201
198
202
(Replace YOUR_USERNAME)
199
203
200
-
201
-
202
204
**For Claude Code**
203
205
204
-
If you're using Claude Code, you can register the MCP server using these commands:
206
+
If you\'re using Claude Code, you can register the MCP server using these commands:
205
207
206
208
**macOS:**
209
+
207
210
```bash
208
211
claude mcp add UnityMCP -- uv --directory /[PATH_TO]/UnityMCP/UnityMcpServer/src run server.py
209
212
```
210
213
211
214
**Windows:**
215
+
212
216
```bash
213
217
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
214
218
```
@@ -225,23 +229,26 @@ claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Roaming/Python/Python313/S
225
229
3. **Interact!** Unity tools should now be available in your MCP Client.
226
230
227
231
Example Prompt: `Create a 3D player controller`, `Create a yellow and bridge sun`, `Create a cool shader and apply it on a cube`.
228
-
232
+
229
233
---
230
234
231
235
## Future Dev Plans (Besides PR) 📝
232
236
233
237
### 🔴 High Priority
238
+
234
239
- [ ] **Asset Generation Improvements** - Enhanced server request handling and asset pipeline optimization
@@ -266,7 +274,7 @@ claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Roaming/Python/Python313/S
266
274
267
275
### Development Tools
268
276
269
-
If you're contributing to Unity MCP or want to test core changes, we have development tools to streamline your workflow:
277
+
If you\'re contributing to Unity MCP or want to test core changes, we have development tools to streamline your workflow:
270
278
271
279
- **Development Deployment Scripts**: Quickly deploy and test your changes to Unity MCP Bridge and Python Server
272
280
- **Automatic Backup System**: Safe testing with easy rollback capabilities
@@ -289,8 +297,7 @@ Help make Unity MCP better!
289
297
290
298
5. **Push** your branch.
291
299
292
-
6. **Open a Pull Request** against the master branch.
293
-
300
+
6. **Open a Pull Request** against the main branch.
294
301
295
302
---
296
303
@@ -300,53 +307,37 @@ Help make Unity MCP better!
300
307
<summary><strong>Click to view common issues and fixes...</strong></summary>
301
308
302
309
- **Unity Bridge Not Running/Connecting:**
303
-
304
310
- Ensure Unity Editor is open.
305
-
306
311
- Check the status window: Window > Unity MCP.
307
-
308
312
- Restart Unity.
309
-
310
313
- **MCP Client Not Connecting / Server Not Starting:**
311
-
312
-
- **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).
313
-
314
-
- **Verify uv:** Make sure uv is installed and working (pip show uv).
315
-
314
+
- **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).
315
+
- **Verify uv:** Make sure `uv` is installed and working (pip show uv).
316
316
- **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`
317
-
318
317
- **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.
319
-
320
318
- **Auto-Configure Failed:**
321
-
322
-
- Use the Manual Configuration steps. Auto-configure might lack permissions to write to the MCP client's config file.
323
-
319
+
- Use the Manual Configuration steps. Auto-configure might lack permissions to write to the MCP client\'s config file.
324
320
325
321
</details>
326
322
327
-
Still stuck? [Open an Issue](https://www.google.com/url?sa=E&q=https%3A%2F%2Fgithub.com%2Fjustinpbarnett%2Funity-mcp%2Fissues) or [Join the Discord](https://discord.gg/vhTUxXaqYr)!
Still stuck? [Open an Issue](https://github.com/CoplayDev/unity-mcp/issues) or [Join the Discord](https://discord.gg/y4p8KfzrN4)!
336
324
337
325
---
338
326
339
327
## License 📜
340
328
341
-
MIT License. See [LICENSE](https://www.google.com/url?sa=E&q=https%3A%2F%2Fgithub.com%2Fjustinpbarnett%2Funity-mcp%2Fblob%2Fmaster%2FLICENSE) file.
329
+
MIT License. See [LICENSE](LICENSE) file.
342
330
343
331
---
344
332
345
-
## Acknowledgments 🙏
346
-
347
-
Thanks to the contributors and the Unity team.
333
+
## Star History
348
334
335
+
[](https://www.star-history.com/#CoplayDev/unity-mcp&Date)
349
336
350
-
## Star History
337
+
## Sponsor
351
338
352
-
[](https://www.star-history.com/#justinpbarnett/unity-mcp&Date)
Debug.Log("Unity MCP: Python server installation completed successfully.");
34
+
Debug.Log("<b><color=#2EA3FF>UNITY-MCP</color></b>: Python server installation completed successfully.");
35
35
}
36
36
catch(System.Exceptionex)
37
37
{
38
-
Debug.LogError($"Unity MCP: Failed to install Python server: {ex.Message}");
39
-
Debug.LogWarning("Unity MCP: You may need to manually install the Python server. Check the Unity MCP Editor Window for instructions.");
38
+
Debug.LogError($"<b><color=#2EA3FF>UNITY-MCP</color></b>: Failed to install Python server: {ex.Message}");
39
+
Debug.LogWarning("<b><color=#2EA3FF>UNITY-MCP</color></b>: You may need to manually install the Python server. Check the Unity MCP Editor Window for instructions.");
0 commit comments