Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
41de83e
refactor: rename namespace from UnityMcpBridge to MCPForUnity across …
msanatan Aug 18, 2025
bdb62c0
Change package display name, menu item and menu titles
msanatan Aug 18, 2025
98fe4dd
Misc name changes in logs and comments for better consistency
msanatan Aug 18, 2025
c2b00e7
chore: update editor window title from 'MCP Editor' to 'MCP for Unity'
msanatan Aug 18, 2025
fb7ebfd
refactor: update branding from UNITY-MCP to MCP-FOR-UNITY across all …
msanatan Aug 18, 2025
64cd3f1
chore: rename Unity MCP to MCP For Unity across all files and bump ve…
msanatan Aug 20, 2025
13b8a53
docs: update restore script title to clarify Unity MCP naming
msanatan Aug 20, 2025
4e06dcd
Fix usage instructions
msanatan Aug 20, 2025
bb452eb
chore: update log messages to use MCP For Unity branding instead of U…
msanatan Aug 20, 2025
8c39022
Add a README inside plugin, required for distributing via the asset s…
msanatan Aug 20, 2025
e974524
docs: update Unity port description and fix typo in troubleshooting s…
msanatan Aug 20, 2025
f5568f1
Address Rabbit feedback
msanatan Aug 20, 2025
c3ef002
Update Editor prefs to use new name
msanatan Aug 20, 2025
892e2e4
refactor: rename server logger and identifier from unity-mcp-server t…
msanatan Aug 20, 2025
c1507d8
Standardize casing of renamed project to "MCP for Unity", as it is on…
msanatan Aug 20, 2025
84a3ff4
Remove unused folder
msanatan Aug 20, 2025
9a5f87a
refactor: rename Unity MCP to MCP for Unity across codebase
msanatan Aug 20, 2025
8efc8ee
Update dangling references
msanatan Aug 20, 2025
02a9b4b
docs: update product name from UnityMCP to MCP for Unity in README
msanatan Aug 20, 2025
48f6299
Update log and comments for new name
msanatan Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions CursorHelp.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
### Cursor/VSCode/Windsurf: UV path issue on Windows (diagnosis and fix)

#### The issue
- Some Windows machines have multiple `uv.exe` locations. Our auto-config sometimes picked a less stable path, causing the MCP client to fail to launch the Unity MCP Server or for the path to be auto-rewritten on repaint/restart.
- Some Windows machines have multiple `uv.exe` locations. Our auto-config sometimes picked a less stable path, causing the MCP client to fail to launch the MCP for Unity Server or for the path to be auto-rewritten on repaint/restart.

#### Typical symptoms
- Cursor shows the UnityMCP server but never connects or reports it “can’t start.”
- Your `%USERPROFILE%\\.cursor\\mcp.json` flips back to a different `command` path when Unity or the Unity MCP window refreshes.
- Cursor shows the MCP for Unity server but never connects or reports it “can’t start.”
- Your `%USERPROFILE%\\.cursor\\mcp.json` flips back to a different `command` path when Unity or the MCP for Unity window refreshes.

#### Real-world example
- Wrong/fragile path (auto-picked):
Expand All @@ -15,13 +15,13 @@
- `C:\Users\mrken\AppData\Local\Microsoft\WinGet\Links\uv.exe`

#### Quick fix (recommended)
1) In Unity: `Window > Unity MCP` → select your MCP client (Cursor or Windsurf)
2) If you see “uv Not Found,” click “Choose UV Install Location” and browse to:
1) In MCP for Unity: `Window > MCP for Unity` → select your MCP client (Cursor or Windsurf)
2) If you see “uv Not Found,” click “Choose `uv` Install Location” and browse to:
- `C:\Users\<YOU>\AppData\Local\Microsoft\WinGet\Links\uv.exe`
3) If uv is already found but wrong, still click “Choose UV Install Location” and select the `Links\uv.exe` path above. This saves a persistent override.
3) If uv is already found but wrong, still click “Choose `uv` Install Location” and select the `Links\uv.exe` path above. This saves a persistent override.
4) Click “Auto Configure” (or re-open the client) and restart Cursor.

This sets an override stored in the Editor (key: `UnityMCP.UvPath`) so UnityMCP won’t auto-rewrite the config back to a different `uv.exe` later.
This sets an override stored in the Editor (key: `MCPForUnity.UvPath`) so MCP for Unity won’t auto-rewrite the config back to a different `uv.exe` later.

#### Verify the fix
- Confirm global Cursor config is at: `%USERPROFILE%\\.cursor\\mcp.json`
Expand Down Expand Up @@ -71,8 +71,8 @@ If that runs without error, restart Cursor and it should connect.

Recommended practice

- Prefer the WinGet Links shim paths above. If present, select one via “Choose UV Install Location”.
- If the unity window keeps rewriting to a different `uv.exe`, pick the Links shim again; Unity MCP saves a pinned override and will stop auto-rewrites.
- Prefer the WinGet Links shim paths above. If present, select one via “Choose `uv` Install Location”.
- If the unity window keeps rewriting to a different `uv.exe`, pick the Links shim again; MCP for Unity saves a pinned override and will stop auto-rewrites.
- If neither Links path exists, a reasonable fallback is `~/.local/bin/uv.exe` (uv tools bin) or a Scoop shim, but Links is preferred for stability.

References
Expand Down
18 changes: 9 additions & 9 deletions README-DEV.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Unity MCP Development Tools
# MCP for Unity Development Tools

Welcome to the Unity MCP development environment! This directory contains tools and utilities to streamline Unity MCP core development.
Welcome to the MCP for Unity development environment! This directory contains tools and utilities to streamline MCP for Unity core development.

## 🚀 Available Development Features

### ✅ Development Deployment Scripts
Quick deployment and testing tools for Unity MCP core changes.
Quick deployment and testing tools for MCP for Unity core changes.

### 🔄 Coming Soon
- **Development Mode Toggle**: Built-in Unity editor development features
- **Hot Reload System**: Real-time code updates without Unity restarts
- **Plugin Development Kit**: Tools for creating custom Unity MCP extensions
- **Plugin Development Kit**: Tools for creating custom MCP for Unity extensions
- **Automated Testing Suite**: Comprehensive testing framework for contributions
- **Debug Dashboard**: Advanced debugging and monitoring tools

---

## Development Deployment Scripts

These deployment scripts help you quickly test changes to Unity MCP core code.
These deployment scripts help you quickly test changes to MCP for Unity core code.

## Scripts

Expand Down Expand Up @@ -60,7 +60,7 @@ X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@272123cfd97e

To find it reliably:
1. Open Unity Package Manager
2. Select "Unity MCP" package
2. Select "MCP for Unity" package
3. Right click the package and choose "Show in Explorer"
4. That opens the exact cache folder Unity is using for your project

Expand All @@ -77,7 +77,7 @@ Note: In recent builds, the Python server sources are also bundled inside the pa

## Switching MCP package sources quickly

Use `mcp_source.py` to quickly switch between different Unity MCP package sources:
Use `mcp_source.py` to quickly switch between different MCP for Unity package sources:

**Usage:**
```bash
Expand All @@ -96,7 +96,7 @@ After switching, open Package Manager and Refresh to re-resolve packages.

### "Path not found" errors running the .bat file
- Verify Unity package cache path is correct
- Check that Unity MCP package is actually installed
- Check that MCP for Unity package is actually installed
- Ensure server is installed via MCP client

### "Permission denied" errors
Expand All @@ -110,4 +110,4 @@ After switching, open Package Manager and Refresh to re-resolve packages.
- Verify backup directory path is correct

### Windows uv path issues
- On Windows, when testing GUI clients, prefer the WinGet Links `uv.exe`; if multiple `uv.exe` exist, use "Choose UV Install Location" to pin the Links shim.
- On Windows, when testing GUI clients, prefer the WinGet Links `uv.exe`; if multiple `uv.exe` exist, use "Choose `uv` Install Location" to pin the Links shim.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Unity MCP ✨
# MCP for Unity

#### 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)

Expand All @@ -13,13 +13,13 @@

**Create your Unity apps with LLMs!**

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.
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.

## 💬 Join Our Community

### [Discord](https://discord.gg/y4p8KfzrN4)

**Get help, share ideas, and collaborate with other Unity MCP developers!**
**Get help, share ideas, and collaborate with other MCP for Unity developers!**

---

Expand Down Expand Up @@ -49,12 +49,12 @@ Unity MCP acts as a bridge, allowing AI assistants (like Claude, Cursor) to inte

## How It Works 🤔

Unity MCP connects your tools using two components:
MCP for Unity connects your tools using two components:

1. **Unity MCP Bridge:** A Unity package running inside the Editor. (Installed via Package Manager).
2. **Unity MCP Server:** A Python server that runs locally, communicating between the Unity Bridge and your MCP Client. (Installed manually).
1. **MCP for Unity Bridge:** A Unity package running inside the Editor. (Installed via Package Manager).
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).

**Flow:** `[Your LLM via MCP Client] <-> [Unity MCP Server (Python)] <-> [Unity MCP Bridge (Unity Editor)]`
**Flow:** `[Your LLM via MCP Client] <-> [MCP for Unity Server (Python)] <-> [MCP for Unity Bridge (Unity Editor)]`

---

Expand Down Expand Up @@ -111,7 +111,7 @@ Unity MCP connects your tools using two components:
https://github.com/CoplayDev/unity-mcp.git?path=/UnityMcpBridge
```
5. Click `Add`.
6. The MCP Server should automatically be installed onto your machine as a result of this process.
6. The MCP server is installed automatically by the package on first run or via Auto-Setup. If that fails, use Manual Configuration (below).

#### To install via OpenUPM

Expand All @@ -123,20 +123,20 @@ Unity MCP connects your tools using two components:

### Step 2: Configure Your MCP Client

Connect your MCP Client (Claude, Cursor, etc.) to the Python server you installed in Step 1.
Connect your MCP Client (Claude, Cursor, etc.) to the Python server set up in Step 1 (auto) or via Manual Configuration (below).

<img width="648" height="599" alt="UnityMCP-Readme-Image" src="https://github.com/user-attachments/assets/b4a725da-5c43-4bd6-80d6-ee2e3cca9596" />
<img width="648" height="599" alt="MCPForUnity-Readme-Image" src="https://github.com/user-attachments/assets/b4a725da-5c43-4bd6-80d6-ee2e3cca9596" />

**Option A: Auto-Setup (Recommended for Claude/Cursor/VSC Copilot)**

1. In Unity, go to `Window > Unity MCP`.
1. In Unity, go to `Window > MCP for Unity`.
2. Click `Auto-Setup`.
3. Look for a green status indicator 🟢 and "Connected ✓". *(This attempts to modify the MCP Client\'s config file automatically).*

<details><summary><strong>Client-specific troubleshooting</strong></summary>

- **VSCode**: uses `Code/User/mcp.json` with top-level `servers.unityMCP` and `"type": "stdio"`. On Windows, Unity MCP writes an absolute `uv.exe` (prefers WinGet Links shim) to avoid PATH issues.
- **Cursor / Windsurf** [(**help link**)](https://github.com/CoplayDev/unity-mcp/wiki/1.-Fix-Unity-MCP-and-Cursor,-VSCode-&-Windsurf): if `uv` is missing, the Unity MCP window shows "uv Not Found" with a quick [HELP] link and a "Choose UV Install Location" button.
- **VSCode**: uses `Code/User/mcp.json` with top-level `servers.unityMCP` and `"type": "stdio"`. On Windows, MCP for Unity writes an absolute `uv.exe` (prefers WinGet Links shim) to avoid PATH issues.
- **Cursor / Windsurf** [(**help link**)](https://github.com/CoplayDev/unity-mcp/wiki/1.-Fix-Unity-MCP-and-Cursor,-VSCode-&-Windsurf): if `uv` is missing, the MCP for Unity window shows "uv Not Found" with a quick [HELP] link and a "Choose `uv` Install Location" button.
- **Claude Code** [(**help link**)](https://github.com/CoplayDev/unity-mcp/wiki/2.-Fix-Unity-MCP-and-Claude-Code): if `claude` isn't found, the window shows "Claude Not Found" with [HELP] and a "Choose Claude Location" button. Unregister now updates the UI immediately.</details>


Expand Down Expand Up @@ -252,9 +252,9 @@ claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Roaming/Python/Python313/S

## Usage ▶️

1. **Open your Unity Project.** The Unity MCP Bridge (package) should connect automatically. Check status via Window > Unity MCP.
1. **Open your Unity Project.** The MCP for Unity package should connect automatically. Check status via Window > MCP for Unity.

2. **Start your MCP Client** (Claude, Cursor, etc.). It should automatically launch the Unity MCP Server (Python) using the configuration from Installation Step 3.
2. **Start your MCP Client** (Claude, Cursor, etc.). It should automatically launch the MCP for Unity Server (Python) using the configuration from Installation Step 2.

3. **Interact!** Unity tools should now be available in your MCP Client.

Expand Down Expand Up @@ -304,9 +304,9 @@ claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Roaming/Python/Python313/S

### Development Tools

If you\'re contributing to Unity MCP or want to test core changes, we have development tools to streamline your workflow:
If you\'re contributing to MCP for Unity or want to test core changes, we have development tools to streamline your workflow:

- **Development Deployment Scripts**: Quickly deploy and test your changes to Unity MCP Bridge and Python Server
- **Development Deployment Scripts**: Quickly deploy and test your changes to MCP for Unity Bridge and Python Server
- **Automatic Backup System**: Safe testing with easy rollback capabilities
- **Hot Reload Workflow**: Fast iteration cycle for core development
- **More coming!**
Expand All @@ -315,7 +315,7 @@ If you\'re contributing to Unity MCP or want to test core changes, we have devel

### Contributing 🤝

Help make Unity MCP better!
Help make MCP for Unity better!

1. **Fork** the main repository.

Expand All @@ -338,7 +338,7 @@ Help make Unity MCP better!

- **Unity Bridge Not Running/Connecting:**
- Ensure Unity Editor is open.
- Check the status window: Window > Unity MCP.
- Check the status window: Window > MCP for Unity.
- Restart Unity.
- **MCP Client Not Connecting / Server Not Starting:**
- **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).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using Newtonsoft.Json;
using NUnit.Framework;
using UnityMcpBridge.Editor.Tools;
using MCPForUnity.Editor.Tools;

namespace UnityMCPTests.EditMode
namespace MCPForUnityTests.Editor
{
public class CommandRegistryTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "UnityMCPTests.EditMode",
"name": "MCPForUnityTests.EditMode",
"rootNamespace": "",
"references": [
"UnityMcpBridge.Editor",
"MCPForUnity.Editor",
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
],
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions UnityMcpBridge/Editor/Data/DefaultServerConfig.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using UnityMcpBridge.Editor.Models;
using MCPForUnity.Editor.Models;

namespace UnityMcpBridge.Editor.Data
namespace MCPForUnity.Editor.Data
{
public class DefaultServerConfig : ServerConfig
{
Expand Down
4 changes: 2 additions & 2 deletions UnityMcpBridge/Editor/Data/McpClients.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using UnityMcpBridge.Editor.Models;
using MCPForUnity.Editor.Models;

namespace UnityMcpBridge.Editor.Data
namespace MCPForUnity.Editor.Data
{
public class McpClients
{
Expand Down
4 changes: 2 additions & 2 deletions UnityMcpBridge/Editor/Helpers/ExecPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
using System.Runtime.InteropServices;
using UnityEditor;

namespace UnityMcpBridge.Editor.Helpers
namespace MCPForUnity.Editor.Helpers
{
internal static class ExecPath
{
private const string PrefClaude = "UnityMCP.ClaudeCliPath";
private const string PrefClaude = "MCPForUnity.ClaudeCliPath";

// Resolve Claude CLI absolute path. Pref → env → common locations → PATH.
internal static string ResolveClaude()
Expand Down
4 changes: 2 additions & 2 deletions UnityMcpBridge/Editor/Helpers/GameObjectSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
using UnityMcpBridge.Runtime.Serialization; // For Converters
using MCPForUnity.Runtime.Serialization; // For Converters

namespace UnityMcpBridge.Editor.Helpers
namespace MCPForUnity.Editor.Helpers
{
/// <summary>
/// Handles serialization of GameObjects and Components for MCP responses.
Expand Down
12 changes: 6 additions & 6 deletions UnityMcpBridge/Editor/Helpers/PackageInstaller.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using UnityEditor;
using UnityEngine;

namespace UnityMcpBridge.Editor.Helpers
namespace MCPForUnity.Editor.Helpers
{
/// <summary>
/// Handles automatic installation of the Python server when the package is first installed.
/// </summary>
[InitializeOnLoad]
public static class PackageInstaller
{
private const string InstallationFlagKey = "UnityMCP.ServerInstalled";
private const string InstallationFlagKey = "MCPForUnity.ServerInstalled";

static PackageInstaller()
{
Expand All @@ -25,18 +25,18 @@ private static void InstallServerOnFirstLoad()
{
try
{
Debug.Log("<b><color=#2EA3FF>UNITY-MCP</color></b>: Installing Python server...");
Debug.Log("<b><color=#2EA3FF>MCP-FOR-UNITY</color></b>: Installing Python server...");
ServerInstaller.EnsureServerInstalled();

// Mark as installed
EditorPrefs.SetBool(InstallationFlagKey, true);

Debug.Log("<b><color=#2EA3FF>UNITY-MCP</color></b>: Python server installation completed successfully.");
Debug.Log("<b><color=#2EA3FF>MCP-FOR-UNITY</color></b>: Python server installation completed successfully.");
}
catch (System.Exception ex)
{
Debug.LogError($"<b><color=#2EA3FF>UNITY-MCP</color></b>: Failed to install Python server: {ex.Message}");
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.");
Debug.LogError($"<b><color=#2EA3FF>MCP-FOR-UNITY</color></b>: Failed to install Python server: {ex.Message}");
Debug.LogWarning("<b><color=#2EA3FF>MCP-FOR-UNITY</color></b>: You may need to manually install the Python server. Check the MCP for Unity Editor Window for instructions.");
}
}
}
Expand Down
Loading