You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: restructure server instructions into workflow-focused format
- Reorganized instructions from flat bullet list into categorized workflow sections
- Emphasized critical script management workflow with numbered steps
- Improved readability and scannability for AI agents using the MCP server
It doesn't make sense to repeat the fucnction tools, they're already parsed
Copy file name to clipboardExpand all lines: MCPForUnity/UnityMcpServer~/src/server.py
+25-18Lines changed: 25 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -159,25 +159,32 @@ def _emit_startup():
159
159
name="mcp-for-unity-server",
160
160
lifespan=server_lifespan,
161
161
instructions="""
162
-
This server provides tools to interact with the Unity Game Engine Editor.\n\n
163
-
Available tools:\n
164
-
- `manage_editor`: Controls editor state and queries info.\n
165
-
- `execute_menu_item`: Executes, lists and checks for the existence of Unity Editor menu items.\n
166
-
- `read_console`: Reads or clears Unity console messages, with filtering options.\n
167
-
- `manage_scene`: Manages scenes.\n
168
-
- `manage_gameobject`: Manages GameObjects in the scene.\n
169
-
- `manage_script`: Manages C# script files.\n
170
-
- `manage_asset`: Manages prefabs and assets.\n
171
-
- `manage_shader`: Manages shaders.\n
172
-
- `reload_domain`: Triggers Unity domain reload to recompile scripts and refresh assemblies.\n\n
173
-
Tips:\n
174
-
- Always reload the domain after creating or modifying scripts before attempting to use them. Use `reload_domain` immediately after script changes, then check `read_console` for compile errors.\n
175
-
- Create prefabs for reusable GameObjects.\n
176
-
- Always include a camera and main light in your scenes.\n
177
-
- Unless specified otherwise, paths are relative to the project's `Assets/` folder.\n
178
-
- After creating or modifying scripts with `manage_script`, allow Unity to recompile; use `read_console` to check for compile errors.\n
179
-
- Use `execute_menu_item` for interacting with Unity systems and third party tools like a user would.\n
162
+
This server provides tools to interact with the Unity Game Engine Editor.
180
163
164
+
Important Workflows:
165
+
166
+
Script Management:
167
+
1. After creating or modifying scripts with `manage_script`, ALWAYS call `reload_domain` immediately
168
+
2. Wait for Unity to recompile (domain reload is asynchronous)
169
+
3. Use `read_console` to check for compilation errors before proceeding
170
+
4. Only after successful compilation can new components/types be used
171
+
172
+
Scene Setup:
173
+
- Always include a Camera and main Light (Directional Light) in new scenes
174
+
- Create prefabs with `manage_asset` for reusable GameObjects
175
+
- Use `manage_scene` to load, save, and query scene information
176
+
177
+
Path Conventions:
178
+
- Unless specified otherwise, all paths are relative to the project's `Assets/` folder
179
+
- Use forward slashes (/) in paths for cross-platform compatibility
180
+
181
+
Console Monitoring:
182
+
- Check `read_console` regularly to catch errors, warnings, and compilation status
183
+
- Filter by log type (Error, Warning, Log) to focus on specific issues
184
+
185
+
Menu Items:
186
+
- Use `execute_menu_item` when you have read the menu items resource
187
+
- This let's you interact with Unity's menu system and third-party tools
Copy file name to clipboardExpand all lines: Server/server.py
+25-18Lines changed: 25 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -159,25 +159,32 @@ def _emit_startup():
159
159
name="mcp-for-unity-server",
160
160
lifespan=server_lifespan,
161
161
instructions="""
162
-
This server provides tools to interact with the Unity Game Engine Editor.\n\n
163
-
Available tools:\n
164
-
- `manage_editor`: Controls editor state and queries info.\n
165
-
- `execute_menu_item`: Executes, lists and checks for the existence of Unity Editor menu items.\n
166
-
- `read_console`: Reads or clears Unity console messages, with filtering options.\n
167
-
- `manage_scene`: Manages scenes.\n
168
-
- `manage_gameobject`: Manages GameObjects in the scene.\n
169
-
- `manage_script`: Manages C# script files.\n
170
-
- `manage_asset`: Manages prefabs and assets.\n
171
-
- `manage_shader`: Manages shaders.\n
172
-
- `reload_domain`: Triggers Unity domain reload to recompile scripts and refresh assemblies.\n\n
173
-
Tips:\n
174
-
- Always reload the domain after creating or modifying scripts before attempting to use them. Use `reload_domain` immediately after script changes, then check `read_console` for compile errors.\n
175
-
- Create prefabs for reusable GameObjects.\n
176
-
- Always include a camera and main light in your scenes.\n
177
-
- Unless specified otherwise, paths are relative to the project's `Assets/` folder.\n
178
-
- After creating or modifying scripts with `manage_script`, allow Unity to recompile; use `read_console` to check for compile errors.\n
179
-
- Use `execute_menu_item` for interacting with Unity systems and third party tools like a user would.\n
162
+
This server provides tools to interact with the Unity Game Engine Editor.
180
163
164
+
Important Workflows:
165
+
166
+
Script Management:
167
+
1. After creating or modifying scripts with `manage_script`, ALWAYS call `reload_domain` immediately
168
+
2. Wait for Unity to recompile (domain reload is asynchronous)
169
+
3. Use `read_console` to check for compilation errors before proceeding
170
+
4. Only after successful compilation can new components/types be used
171
+
172
+
Scene Setup:
173
+
- Always include a Camera and main Light (Directional Light) in new scenes
174
+
- Create prefabs with `manage_asset` for reusable GameObjects
175
+
- Use `manage_scene` to load, save, and query scene information
176
+
177
+
Path Conventions:
178
+
- Unless specified otherwise, all paths are relative to the project's `Assets/` folder
179
+
- Use forward slashes (/) in paths for cross-platform compatibility
180
+
181
+
Console Monitoring:
182
+
- Check `read_console` regularly to catch errors, warnings, and compilation status
183
+
- Filter by log type (Error, Warning, Log) to focus on specific issues
184
+
185
+
Menu Items:
186
+
- Use `execute_menu_item` when you have read the menu items resource
187
+
- This let's you interact with Unity's menu system and third-party tools
0 commit comments