Skip to content

Commit d43d3a9

Browse files
authored
Merge pull request #177 from Scriptwonder/master
Developer Update 0
2 parents 41f0a57 + ab4bcab commit d43d3a9

File tree

4 files changed

+417
-6
lines changed

4 files changed

+417
-6
lines changed

README-DEV.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Unity MCP Development Tools
2+
3+
Welcome to the Unity MCP development environment! This directory contains tools and utilities to streamline Unity MCP core development.
4+
5+
## 🚀 Available Development Features
6+
7+
### ✅ Development Deployment Scripts
8+
Quick deployment and testing tools for Unity MCP core changes.
9+
10+
### 🔄 Coming Soon
11+
- **Development Mode Toggle**: Built-in Unity editor development features
12+
- **Hot Reload System**: Real-time code updates without Unity restarts
13+
- **Plugin Development Kit**: Tools for creating custom Unity MCP extensions
14+
- **Automated Testing Suite**: Comprehensive testing framework for contributions
15+
- **Debug Dashboard**: Advanced debugging and monitoring tools
16+
17+
---
18+
19+
## Development Deployment Scripts
20+
21+
These deployment scripts help you quickly test changes to Unity MCP core code.
22+
23+
## Scripts
24+
25+
### `deploy-dev.bat`
26+
Deploys your development code to the actual installation locations for testing.
27+
28+
**What it does:**
29+
1. Backs up original files to a timestamped folder
30+
2. Copies Unity Bridge code to Unity's package cache
31+
3. Copies Python Server code to the MCP installation folder
32+
33+
**Usage:**
34+
1. Run `deploy-dev.bat`
35+
2. Enter Unity package cache path (example provided)
36+
3. Enter server path (or use default: `%LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer\src`)
37+
4. Enter backup location (or use default: `%USERPROFILE%\Desktop\unity-mcp-backup`)
38+
39+
### `restore-dev.bat`
40+
Restores original files from backup.
41+
42+
**What it does:**
43+
1. Lists available backups with timestamps
44+
2. Allows you to select which backup to restore
45+
3. Restores both Unity Bridge and Python Server files
46+
47+
## Finding Unity Package Cache Path
48+
49+
Unity package cache is typically located at:
50+
```
51+
X:\UnityProject\Library\PackageCache\[email protected]
52+
```
53+
54+
To find it:
55+
1. Open Unity Package Manager
56+
2. Select "Unity MCP" package
57+
3. Right click on the package and "Show in Explorer"
58+
4. Navigate to the path above with your username and version
59+
60+
## Workflow
61+
62+
1. **Make changes** to your source code in this directory
63+
2. **Deploy** using `deploy-dev.bat`
64+
3. **Test** in Unity (restart Unity Editor first)
65+
4. **Iterate** - repeat steps 1-3 as needed
66+
5. **Restore** original files when done using `restore-dev.bat`
67+
68+
69+
## Troubleshooting
70+
71+
### "Path not found" errors running the .bat file
72+
- Verify Unity package cache path is correct
73+
- Check that Unity MCP package is actually installed
74+
- Ensure server is installed via MCP client
75+
76+
### "Permission denied" errors
77+
- Run cmd as Administrator
78+
- Close Unity Editor before deploying
79+
- Close any MCP clients before deploying
80+
81+
### "Backup not found" errors
82+
- Run `deploy-dev.bat` first to create initial backup
83+
- Check backup directory permissions
84+
- Verify backup directory path is correct

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# Unity MCP ✨
22

3-
43
[![](https://img.shields.io/badge/Unity-000000?style=flat&logo=unity&logoColor=blue 'Unity')](https://unity.com/releases/editor/archive)
54
[![python](https://img.shields.io/badge/Python-3.12-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)
65
[![](https://badge.mcpx.dev?status=on 'MCP Enabled')](https://modelcontextprotocol.io/introduction)
76
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/justinpbarnett/unity-mcp)
87
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/justinpbarnett/unity-mcp)
98
[![](https://img.shields.io/badge/License-MIT-red.svg 'MIT License')](https://opensource.org/licenses/MIT)
109

10+
**Create your Unity apps with LLMs!**
1111

12+
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.
1213

14+
## 💬 Join Our Community
1315

14-
**Create your Unity apps with LLMs!**
16+
### [Discord](https://discord.gg/vhTUxXaqYr)
17+
18+
**Get help, share ideas, and collaborate with other Unity MCP developers!**
1519

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

1821
---
1922

@@ -194,9 +197,9 @@ If Auto-Configure fails or you use a different client:
194197

195198
(Replace YOUR_USERNAME)
196199

197-
</details>
198200

199-
**Option C: Claude Code Registration**
201+
202+
**For Claude Code**
200203

201204
If you're using Claude Code, you can register the MCP server using these commands:
202205
@@ -209,6 +212,7 @@ claude mcp add UnityMCP -- uv --directory /[PATH_TO]/UnityMCP/UnityMcpServer/src
209212
```bash
210213
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
211214
```
215+
</details>
212216
213217
---
214218
@@ -258,7 +262,20 @@ claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Roaming/Python/Python313/S
258262
259263
---
260264
261-
## Contributing 🤝
265+
## For Developers 🛠️
266+
267+
### Development Tools
268+
269+
If you're contributing to Unity MCP or want to test core changes, we have development tools to streamline your workflow:
270+
271+
- **Development Deployment Scripts**: Quickly deploy and test your changes to Unity MCP Bridge and Python Server
272+
- **Automatic Backup System**: Safe testing with easy rollback capabilities
273+
- **Hot Reload Workflow**: Fast iteration cycle for core development
274+
- **More coming!**
275+
276+
📖 **See [README-DEV.md](README-DEV.md)** for complete development setup and workflow documentation.
277+
278+
### Contributing 🤝
262279

263280
Help make Unity MCP better!
264281

deploy-dev.bat

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
echo ===============================================
5+
echo Unity MCP Development Deployment Script
6+
echo ===============================================
7+
echo.
8+
9+
:: Configuration
10+
set "SCRIPT_DIR=%~dp0"
11+
set "BRIDGE_SOURCE=%SCRIPT_DIR%UnityMcpBridge"
12+
set "SERVER_SOURCE=%SCRIPT_DIR%UnityMcpServer\src"
13+
set "DEFAULT_BACKUP_DIR=%USERPROFILE%\Desktop\unity-mcp-backup"
14+
set "DEFAULT_SERVER_PATH=%LOCALAPPDATA%\Programs\UnityMCP\UnityMcpServer\src"
15+
16+
:: Get user inputs
17+
echo Please provide the following paths:
18+
echo.
19+
20+
:: Package cache location
21+
echo Unity Package Cache Location:
22+
echo Example: X:\UnityProject\Library\PackageCache\[email protected]
23+
set /p "PACKAGE_CACHE_PATH=Enter Unity package cache path: "
24+
25+
if "%PACKAGE_CACHE_PATH%"=="" (
26+
echo Error: Package cache path cannot be empty!
27+
pause
28+
exit /b 1
29+
)
30+
31+
:: Server installation path (with default)
32+
echo.
33+
echo Server Installation Path:
34+
echo Default: %DEFAULT_SERVER_PATH%
35+
set /p "SERVER_PATH=Enter server path (or press Enter for default): "
36+
if "%SERVER_PATH%"=="" set "SERVER_PATH=%DEFAULT_SERVER_PATH%"
37+
38+
:: Backup location (with default)
39+
echo.
40+
echo Backup Location:
41+
echo Default: %DEFAULT_BACKUP_DIR%
42+
set /p "BACKUP_DIR=Enter backup directory (or press Enter for default): "
43+
if "%BACKUP_DIR%"=="" set "BACKUP_DIR=%DEFAULT_BACKUP_DIR%"
44+
45+
:: Validation
46+
echo.
47+
echo ===============================================
48+
echo Validating paths...
49+
echo ===============================================
50+
51+
if not exist "%BRIDGE_SOURCE%" (
52+
echo Error: Bridge source not found: %BRIDGE_SOURCE%
53+
pause
54+
exit /b 1
55+
)
56+
57+
if not exist "%SERVER_SOURCE%" (
58+
echo Error: Server source not found: %SERVER_SOURCE%
59+
pause
60+
exit /b 1
61+
)
62+
63+
if not exist "%PACKAGE_CACHE_PATH%" (
64+
echo Error: Package cache path not found: %PACKAGE_CACHE_PATH%
65+
pause
66+
exit /b 1
67+
)
68+
69+
if not exist "%SERVER_PATH%" (
70+
echo Error: Server installation path not found: %SERVER_PATH%
71+
pause
72+
exit /b 1
73+
)
74+
75+
:: Create backup directory
76+
if not exist "%BACKUP_DIR%" (
77+
echo Creating backup directory: %BACKUP_DIR%
78+
mkdir "%BACKUP_DIR%"
79+
)
80+
81+
:: Create timestamped backup subdirectory
82+
set "TIMESTAMP=%date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%%time:~6,2%"
83+
set "TIMESTAMP=%TIMESTAMP: =0%"
84+
set "TIMESTAMP=%TIMESTAMP::=-%"
85+
set "TIMESTAMP=%TIMESTAMP:/=-%"
86+
set "BACKUP_SUBDIR=%BACKUP_DIR%\backup_%TIMESTAMP%"
87+
mkdir "%BACKUP_SUBDIR%"
88+
89+
echo.
90+
echo ===============================================
91+
echo Starting deployment...
92+
echo ===============================================
93+
94+
:: Backup original files
95+
echo Creating backup of original files...
96+
if exist "%PACKAGE_CACHE_PATH%\Editor" (
97+
echo Backing up Unity Bridge files...
98+
xcopy "%PACKAGE_CACHE_PATH%\Editor" "%BACKUP_SUBDIR%\UnityBridge\Editor\" /E /I /Y > nul
99+
if !errorlevel! neq 0 (
100+
echo Error: Failed to backup Unity Bridge files
101+
pause
102+
exit /b 1
103+
)
104+
)
105+
106+
if exist "%SERVER_PATH%" (
107+
echo Backing up Python Server files...
108+
xcopy "%SERVER_PATH%\*" "%BACKUP_SUBDIR%\PythonServer\" /E /I /Y > nul
109+
if !errorlevel! neq 0 (
110+
echo Error: Failed to backup Python Server files
111+
pause
112+
exit /b 1
113+
)
114+
)
115+
116+
:: Deploy Unity Bridge
117+
echo.
118+
echo Deploying Unity Bridge code...
119+
xcopy "%BRIDGE_SOURCE%\Editor\*" "%PACKAGE_CACHE_PATH%\Editor\" /E /Y > nul
120+
if !errorlevel! neq 0 (
121+
echo Error: Failed to deploy Unity Bridge code
122+
pause
123+
exit /b 1
124+
)
125+
126+
:: Deploy Python Server
127+
echo Deploying Python Server code...
128+
xcopy "%SERVER_SOURCE%\*" "%SERVER_PATH%\" /E /Y > nul
129+
if !errorlevel! neq 0 (
130+
echo Error: Failed to deploy Python Server code
131+
pause
132+
exit /b 1
133+
)
134+
135+
:: Success
136+
echo.
137+
echo ===============================================
138+
echo Deployment completed successfully!
139+
echo ===============================================
140+
echo.
141+
echo Backup created at: %BACKUP_SUBDIR%
142+
echo.
143+
echo Next steps:
144+
echo 1. Restart Unity Editor to load new Bridge code
145+
echo 2. Restart any MCP clients to use new Server code
146+
echo 3. Use restore-dev.bat to rollback if needed
147+
echo.
148+
pause

0 commit comments

Comments
 (0)