2025-08-21 03:59:49 +08:00
# MCP for Unity Development Tools
2025-07-30 04:07:21 +08:00
2025-08-21 03:59:49 +08:00
Welcome to the MCP for Unity development environment! This directory contains tools and utilities to streamline MCP for Unity core development.
2025-07-30 04:07:21 +08:00
## 🚀 Available Development Features
### ✅ Development Deployment Scripts
2025-08-21 03:59:49 +08:00
Quick deployment and testing tools for MCP for Unity core changes.
2025-07-30 04:07:21 +08:00
### 🔄 Coming Soon
- **Development Mode Toggle**: Built-in Unity editor development features
- **Hot Reload System**: Real-time code updates without Unity restarts
2025-08-21 03:59:49 +08:00
- **Plugin Development Kit**: Tools for creating custom MCP for Unity extensions
2025-07-30 04:07:21 +08:00
- **Automated Testing Suite**: Comprehensive testing framework for contributions
- **Debug Dashboard**: Advanced debugging and monitoring tools
---
## Development Deployment Scripts
2025-08-21 03:59:49 +08:00
These deployment scripts help you quickly test changes to MCP for Unity core code.
2025-07-30 04:07:21 +08:00
## Scripts
### `deploy-dev.bat`
Deploys your development code to the actual installation locations for testing.
**What it does:**
1. Backs up original files to a timestamped folder
2. Copies Unity Bridge code to Unity's package cache
3. Copies Python Server code to the MCP installation folder
**Usage:**
1. Run `deploy-dev.bat`
2. Enter Unity package cache path (example provided)
3. Enter server path (or use default: `%LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer\src` )
4. Enter backup location (or use default: `%USERPROFILE%\Desktop\unity-mcp-backup` )
2025-08-14 05:23:52 +08:00
**Note:** Dev deploy skips `.venv` , `__pycache__` , `.pytest_cache` , `.mypy_cache` , `.git` ; reduces churn and avoids copying virtualenvs.
2025-07-30 04:07:21 +08:00
### `restore-dev.bat`
Restores original files from backup.
**What it does:**
1. Lists available backups with timestamps
2. Allows you to select which backup to restore
3. Restores both Unity Bridge and Python Server files
## Finding Unity Package Cache Path
2025-08-10 06:38:11 +08:00
Unity stores Git packages under a version-or-hash folder. Expect something like:
2025-07-30 04:07:21 +08:00
```
2025-08-10 06:38:11 +08:00
X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@< version-or-hash >
```
Example (hash):
```
X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@272123cfd97e
2025-08-11 02:57:07 +08:00
2025-07-30 04:07:21 +08:00
```
2025-08-10 06:38:11 +08:00
To find it reliably:
2025-07-30 04:07:21 +08:00
1. Open Unity Package Manager
2025-08-21 03:59:49 +08:00
2. Select "MCP for Unity" package
2025-08-10 06:38:11 +08:00
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.
2025-07-30 04:07:21 +08:00
## Workflow
1. **Make changes** to your source code in this directory
2. **Deploy** using `deploy-dev.bat`
3. **Test** in Unity (restart Unity Editor first)
4. **Iterate** - repeat steps 1-3 as needed
5. **Restore** original files when done using `restore-dev.bat`
2025-08-14 05:23:52 +08:00
## Switching MCP package sources quickly
2025-08-21 03:59:49 +08:00
Use `mcp_source.py` to quickly switch between different MCP for Unity package sources:
2025-08-14 05:23:52 +08:00
**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.
2025-07-30 04:07:21 +08:00
## Troubleshooting
### "Path not found" errors running the .bat file
- Verify Unity package cache path is correct
2025-08-21 03:59:49 +08:00
- Check that MCP for Unity package is actually installed
2025-07-30 04:07:21 +08:00
- Ensure server is installed via MCP client
### "Permission denied" errors
- Run cmd as Administrator
- Close Unity Editor before deploying
- Close any MCP clients before deploying
### "Backup not found" errors
- Run `deploy-dev.bat` first to create initial backup
- Check backup directory permissions
2025-08-14 05:23:52 +08:00
- Verify backup directory path is correct
### Windows uv path issues
2025-08-21 03:59:49 +08:00
- 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.