Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
32274a3
UnityMCP stability: robust auto-restart on compile/play transitions; …
dsarno Aug 7, 2025
5c4ea29
Editor Window: streamline layout, remove redundant badges; move and r…
dsarno Aug 8, 2025
673bc1b
Add PackageInstaller for automatic Python server installation on firs…
dsarno Aug 8, 2025
a0fd919
Add meta for PackageInstaller so Unity includes it in package cache
dsarno Aug 8, 2025
a65f103
feat(bridge): embed Python server into package and remove Git-based i…
dsarno Aug 8, 2025
5c632f0
fix(package): add UnityMcpServer folder meta; remove stray egg-info meta
dsarno Aug 8, 2025
5759201
fix(bridge): prefer persisted project port at start to avoid initial …
dsarno Aug 8, 2025
85202d4
fix(editor): only treat dev mode when manifest uses file: path for pa…
dsarno Aug 8, 2025
1b892dc
fix(ports): write both hashed and legacy port files; compare project …
dsarno Aug 8, 2025
f4bc7cd
fix(ports): never hop to default when stored port busy; prefer stored…
dsarno Aug 8, 2025
10903a2
fix(setup): reuse stored project port in StartAutoConnect to avoid po…
dsarno Aug 8, 2025
2f387d3
chore(ui): rename 'Re-Run Client Setup' to 'Bind to Clients'
dsarno Aug 8, 2025
06f2719
feat(editor): 2x2 layout (Server/Bridge | Clients/Validation), Auto-S…
dsarno Aug 8, 2025
f24e124
MCP: Embedded server reliability and UX\n\n- Embed-first installer: c…
dsarno Aug 8, 2025
4c72309
Bridge logs: add bold blue UNITY-MCP prefix; gate PortManager logs be…
dsarno Aug 8, 2025
c0de38e
Merge upstream/main: CoplayDev rebrand with bridge stability improvem…
dsarno Aug 9, 2025
9da9739
Package Python server under UnityMcpServer~; remove redundant .meta f…
dsarno Aug 9, 2025
32f513f
Merge branch 'feat/bridge-stability' of https://github.com/dsarno/uni…
dsarno Aug 9, 2025
07b3583
Bridge: deferred init, stop-before-reload, breadcrumb logs; stable re…
dsarno Aug 9, 2025
24ed3a2
docs: update README(s) for Auto-Setup and dev cache path
dsarno Aug 9, 2025
97614e7
Update README.md
dsarno Aug 9, 2025
b179ce1
Merge branch 'main' into feat/bridge-stability
dsarno Aug 10, 2025
1938756
server: centralize reload-aware retries and single-source retry_after…
dsarno Aug 11, 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
17 changes: 12 additions & 5 deletions README-DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,23 @@ Restores original files from backup.

## Finding Unity Package Cache Path

Unity package cache is typically located at:
Unity stores Git packages under a version-or-hash folder. Expect something like:
```
X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@1.0.0
X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@<version-or-hash>
```
Example (hash):
```
X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@272123cfd97e

```

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

Note: In recent builds, the Python server sources are also bundled inside the package under `UnityMcpServer~/src`. This is handy for local testing or pointing MCP clients directly at the packaged server.

## Workflow

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,18 @@ Unity MCP connects your tools using two components:

Connect your MCP Client (Claude, Cursor, etc.) to the Python server you installed in Step 1.

<img width="609" alt="image" src="https://github.com/user-attachments/assets/cef3a639-4677-4fd8-84e7-2d82a04d55bb" />
<img width="648" height="599" alt="UnityMCP-Readme-Image" src="https://github.com/user-attachments/assets/b4a725da-5c43-4bd6-80d6-ee2e3cca9596" />

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

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


**Option B: Manual Configuration**

If Auto-Configure fails or you use a different client:
If Auto-Setup fails or you use a different client:

1. **Find your MCP Client\'s configuration file.** (Check client documentation).
* *Claude Example (macOS):* `~/Library/Application Support/Claude/claude_desktop_config.json`
Expand Down
11 changes: 10 additions & 1 deletion UnityMcpBridge/Editor/Data/DefaultServerConfig.cs.meta

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

69 changes: 37 additions & 32 deletions UnityMcpBridge/Editor/Data/McpClients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ public class McpClients
{
public List<McpClient> clients = new()
{
// 1) Cursor
new()
{
name = "Claude Desktop",
name = "Cursor",
windowsConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Claude",
"claude_desktop_config.json"
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".cursor",
"mcp.json"
),
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Library",
"Application Support",
"Claude",
"claude_desktop_config.json"
".cursor",
"mcp.json"
),
mcpType = McpTypes.ClaudeDesktop,
mcpType = McpTypes.Cursor,
configStatus = "Not Configured",
},
// 2) Claude Code
new()
{
name = "Claude Code",
Expand All @@ -41,58 +41,63 @@ public class McpClients
mcpType = McpTypes.ClaudeCode,
configStatus = "Not Configured",
},
// 3) Windsurf
new()
{
name = "Cursor",
name = "Windsurf",
windowsConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".cursor",
"mcp.json"
".codeium",
"windsurf",
"mcp_config.json"
),
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".cursor",
"mcp.json"
".codeium",
"windsurf",
"mcp_config.json"
),
mcpType = McpTypes.Cursor,
mcpType = McpTypes.Windsurf,
configStatus = "Not Configured",
},
// 4) Claude Desktop
new()
{
name = "VSCode GitHub Copilot",
name = "Claude Desktop",
windowsConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Code",
"User",
"settings.json"
"Claude",
"claude_desktop_config.json"
),
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Library",
"Application Support",
"Code",
"User",
"settings.json"
"Claude",
"claude_desktop_config.json"
),
mcpType = McpTypes.VSCode,
mcpType = McpTypes.ClaudeDesktop,
configStatus = "Not Configured",
},
// 5) VSCode GitHub Copilot
new()
{
name = "Windsurf",
name = "VSCode GitHub Copilot",
windowsConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".codeium",
"windsurf",
"mcp_config.json"
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Code",
"User",
"settings.json"
),
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".codeium",
"windsurf",
"mcp_config.json"
"Library",
"Application Support",
"Code",
"User",
"settings.json"
),
mcpType = McpTypes.Windsurf,
mcpType = McpTypes.VSCode,
configStatus = "Not Configured",
},
};
Expand Down
11 changes: 10 additions & 1 deletion UnityMcpBridge/Editor/Data/McpClients.cs.meta

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

11 changes: 10 additions & 1 deletion UnityMcpBridge/Editor/Helpers/GameObjectSerializer.cs.meta

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

43 changes: 43 additions & 0 deletions UnityMcpBridge/Editor/Helpers/PackageInstaller.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using UnityEditor;
using UnityEngine;

namespace UnityMcpBridge.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";

static PackageInstaller()
{
// Check if this is the first time the package is loaded
if (!EditorPrefs.GetBool(InstallationFlagKey, false))
{
// Schedule the installation for after Unity is fully loaded
EditorApplication.delayCall += InstallServerOnFirstLoad;
}
}

private static void InstallServerOnFirstLoad()
{
try
{
Debug.Log("<b><color=#2EA3FF>UNITY-MCP</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.");
}
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.");
}
}
}
}
11 changes: 11 additions & 0 deletions UnityMcpBridge/Editor/Helpers/PackageInstaller.cs.meta

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

Loading