Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c6969fd
docs: update repository links and Discord invite to CoplayDev organiz…
msanatan Aug 7, 2025
3dcaeca
docs: add Coplay sponsorship and logo to README
msanatan Aug 7, 2025
39ec588
Try logo at 50% width
msanatan Aug 7, 2025
164bba4
style: adjust Coplay logo size and container element in README
msanatan Aug 7, 2025
b7ea2c8
docs: update license link to use relative path
msanatan Aug 7, 2025
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
c08e4a4
Merge branch 'master' into feature/update-readme
msanatan Aug 8, 2025
cf86964
chore: revise documentation
msanatan Aug 8, 2025
6faa55f
chore: update package namespace from justinpbarnett to coplaydev
msanatan Aug 8, 2025
5d148a7
chore: update repository URLs and package name to use correct CoplayD…
msanatan Aug 8, 2025
94df819
fix: update package name from com.CoplayDev.unity-mcp to com.coplayde…
msanatan Aug 8, 2025
823bae6
docs: fix escape character in README error message
msanatan Aug 8, 2025
7087797
docs: improve README formatting and add note about package reinstalla…
msanatan Aug 8, 2025
49b0a53
docs: add Windsurf to list of supported code editors
msanatan Aug 8, 2025
a0bef61
Merge pull request #191 from msanatan/feature/update-package-and-docs
msanatan Aug 8, 2025
3288418
chore: update package metadata and license to CoplayDev organization
msanatan 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
9a5d621
Update README.md
JosvanderWesthuizen Aug 9, 2025
22ca5a7
Merge pull request #194 from CoplayDev/jos/readme
JosvanderWesthuizen Aug 9, 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
a40db48
ReadConsole: stable severity classification and filtering across Unit…
dsarno Aug 11, 2025
dc6171d
ReadConsole: lock Debug.Log classification to Log; avoid bit-based fa…
dsarno Aug 11, 2025
1938756
server: centralize reload-aware retries and single-source retry_after…
dsarno Aug 11, 2025
bbbc26a
Merge pull request #192 from dsarno/feat/bridge-stability
dsarno Aug 11, 2025
a506f9b
Update package.json version to 2.0.0
dsarno Aug 11, 2025
0743e64
Merge pull request #201 from dsarno/main
dsarno Aug 11, 2025
6439902
Merge branch 'CoplayDev:main' into fix-read-console
dsarno Aug 11, 2025
46f616d
read_console: correct compiler diagnostic categorization (CSxxxx), pr…
dsarno Aug 11, 2025
ae87e3f
read_console: remove dead types.Contains("all") branch; compute want …
dsarno Aug 12, 2025
642210c
Merge pull request #202 from dsarno/fix-read-console
dsarno Aug 12, 2025
8984ab9
feat: local-only package resolution + Claude CLI resolver; quieter in…
dsarno Aug 12, 2025
5b8c1a1
Merge branch 'CoplayDev:main' into feat/local-resolution-and-claude-cli
dsarno Aug 12, 2025
6b3a20d
chore(package): add .meta files for new helpers and bump version to 2…
dsarno Aug 12, 2025
f6f8b24
chore(uv): prepend ~/.local/bin and common bins to PATH for 'which uv…
dsarno Aug 12, 2025
efd146a
fix: Windows define UNITY_EDITOR_WIN; async stdout/stderr in TryRun a…
dsarno Aug 12, 2025
bd6114b
fix(claude): treat 'already exists' as success; improve IsClaudeConfi…
dsarno Aug 12, 2025
86198a0
Merge pull request #206 from dsarno/feat/local-resolution-and-claude-cli
dsarno Aug 12, 2025
5965158
Unity MCP: Claude Code UX improvements: dynamic not-found state with …
dsarno Aug 13, 2025
4f9017d
VSCode MCP: switch to mcp.json top-level servers schema; add type=std…
dsarno Aug 13, 2025
eb7b2e9
chore: bump Unity MCP Bridge package version
dsarno Aug 13, 2025
a52ce7a
VSCode manual config: use resolved uv path; VSCode parse init guards;…
dsarno Aug 13, 2025
b09a86f
WriteToConfig: only include type="stdio" for VSCode; omit for other c…
dsarno Aug 13, 2025
ce8ab83
Merge pull request #208 from dsarno/feature/claude-cli-detection-ui
dsarno Aug 13, 2025
9a9267c
Windows: prefer WinGet Links uv.exe and preserve existing absolute uv…
dsarno Aug 13, 2025
a2a14c1
Claude Code: after unregister, set NotConfigured, re-check, and repai…
dsarno Aug 13, 2025
b6b8d47
Windows: robust Claude CLI resolution (prefer .cmd, fallback .ps1, wh…
dsarno Aug 13, 2025
cd70728
dev: add generic mcp_source.py helper to switch MCP package source (u…
dsarno Aug 13, 2025
5583327
mcp_source.py: remove duplicate mac-only script; keep cross-platform …
dsarno Aug 13, 2025
4e1b905
chore: bump version to 2.1.0; Windows uv resolver improvements; prese…
dsarno Aug 13, 2025
370a360
docs: update README with client-specific config flows and mcp_source.…
dsarno Aug 13, 2025
f8c76db
Fix Unity Package Manager Git URL format in mcp_source.py
dsarno Aug 13, 2025
a7af0cd
Merge pull request #209 from dsarno/patch/uv-links-prefer
dsarno Aug 13, 2025
6e22721
feat: preserve existing client config; prefer installed server path; …
dsarno Aug 14, 2025
6e59b8f
fix: linux XDG config paths; prefer installed server; robust cursor d…
dsarno Aug 14, 2025
616d399
chore: bump package version to 2.1.1
dsarno Aug 14, 2025
fae347b
revert: remove protocol framing changes from config-stability PR (kee…
dsarno Aug 14, 2025
80d311e
chore(windows): WinGet Links resolution uses ProgramFiles (machine-wi…
dsarno Aug 14, 2025
cf8f5d4
Merge pull request #210 from dsarno/fix/config-stability
dsarno Aug 14, 2025
108dd80
Update README.md
dsarno Aug 14, 2025
b33ae0b
Merge pull request #212 from CoplayDev/dsarno-readme-patch-1
dsarno Aug 14, 2025
401e276
Unity MCP: stable framing handshake + non-blocking script writes; rem…
dsarno Aug 15, 2025
7eeac65
Bridge framing hardening: 64MiB cap, zero-length reject, timeout Read…
dsarno Aug 15, 2025
eafe309
ManageScript: improve method span parsing and validation behavior for…
dsarno Aug 15, 2025
73d212f
Unity MCP: prefer micro-edits & resources; add script_apply_edits pri…
dsarno Aug 16, 2025
a12dcab
test: add initial script and asset edit tests
dsarno Aug 16, 2025
92a6825
Merge pull request #3 from dsarno/codex/refactor-mcp-editing-tools-wi…
dsarno Aug 16, 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
85 changes: 85 additions & 0 deletions CursorHelp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
### 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.

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

#### Real-world example
- Wrong/fragile path (auto-picked):
- `C:\Users\mrken.local\bin\uv.exe` (malformed, not standard)
- `C:\Users\mrken\AppData\Local\Microsoft\WinGet\Packages\astral-sh.uv_Microsoft.Winget.Source_8wekyb3d8bbwe\uv.exe`
- Correct/stable path (works with Cursor):
- `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:
- `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.
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.

#### Verify the fix
- Confirm global Cursor config is at: `%USERPROFILE%\\.cursor\\mcp.json`
- You should see something like:

```json
{
"mcpServers": {
"unityMCP": {
"command": "C:\\Users\\YOU\\AppData\\Local\\Microsoft\\WinGet\\Links\\uv.exe",
"args": [
"--directory",
"C:\\Users\\YOU\\AppData\\Local\\Programs\\UnityMCP\\UnityMcpServer\\src",
"run",
"server.py"
]
}
}
}
```

- Manually run the same command in PowerShell to confirm it launches:

```powershell
"C:\Users\YOU\AppData\Local\Microsoft\WinGet\Links\uv.exe" --directory "C:\Users\YOU\AppData\Local\Programs\UnityMCP\UnityMcpServer\src" run server.py
```

If that runs without error, restart Cursor and it should connect.

#### Why this happens
- On Windows, multiple `uv.exe` can exist (WinGet Packages path, a WinGet Links shim, Python Scripts, etc.). The Links shim is the most stable target for GUI apps to launch.
- Prior versions of the auto-config could pick the first found path and re-write config on refresh. Choosing a path via the MCP window pins a known‑good absolute path and prevents auto-rewrites.

#### Extra notes
- Restart Cursor after changing `mcp.json`; it doesn’t always hot-reload that file.
- If you also have a project-scoped `.cursor\\mcp.json` in your Unity project folder, that file overrides the global one.


### Why pin the WinGet Links shim (and not the Packages path)

- Windows often has multiple `uv.exe` installs and GUI clients (Cursor/Windsurf/VSCode) may launch with a reduced `PATH`. Using an absolute path is safer than `"command": "uv"`.
- WinGet publishes stable launch shims in these locations:
- User scope: `%LOCALAPPDATA%\Microsoft\WinGet\Links\uv.exe`
- Machine scope: `C:\Program Files\WinGet\Links\uv.exe`
These shims survive upgrades and are intended as the portable entrypoints. See the WinGet notes: [discussion](https://github.com/microsoft/winget-pkgs/discussions/184459) • [how to find installs](https://superuser.com/questions/1739292/how-to-know-where-winget-installed-a-program)
- The `Packages` root is where payloads live and can change across updates, so avoid pointing your config at it.

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

- WinGet portable Links: [GitHub discussion](https://github.com/microsoft/winget-pkgs/discussions/184459)
- WinGet install locations: [Super User](https://superuser.com/questions/1739292/how-to-know-where-winget-installed-a-program)
- GUI client PATH caveats (Cursor): [Cursor community thread](https://forum.cursor.com/t/mcp-feature-client-closed-fix/54651?page=4)
- uv tools install location (`~/.local/bin`): [Astral docs](https://docs.astral.sh/uv/concepts/tools/)


2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Justin P Barnett
Copyright (c) 2025 CoplayDev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
41 changes: 35 additions & 6 deletions README-DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Deploys your development code to the actual installation locations for testing.
3. Enter server path (or use default: `%LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer\src`)
4. Enter backup location (or use default: `%USERPROFILE%\Desktop\unity-mcp-backup`)

**Note:** Dev deploy skips `.venv`, `__pycache__`, `.pytest_cache`, `.mypy_cache`, `.git`; reduces churn and avoids copying virtualenvs.

### `restore-dev.bat`
Restores original files from backup.

Expand All @@ -46,16 +48,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@<version-or-hash>
```
X:\UnityProject\Library\PackageCache\com.justinpbarnett.unity-mcp@1.0.0
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 All @@ -66,6 +75,23 @@ To find it:
5. **Restore** original files when done using `restore-dev.bat`


## Switching MCP package sources quickly

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

**Usage:**
```bash
python mcp_source.py [--manifest /path/to/manifest.json] [--repo /path/to/unity-mcp] [--choice 1|2|3]
```

**Options:**
- **1** Upstream main (CoplayDev/unity-mcp)
- **2** Remote current branch (origin + branch)
- **3** Local workspace (file: UnityMcpBridge)

After switching, open Package Manager and Refresh to re-resolve packages.


## Troubleshooting

### "Path not found" errors running the .bat file
Expand All @@ -81,4 +107,7 @@ To find it:
### "Backup not found" errors
- Run `deploy-dev.bat` first to create initial backup
- Check backup directory permissions
- Verify backup directory path is correct
- 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.
Loading