Skip to content

Commit dbda5ea

Browse files
server instruction cleanup (#345)
* clean up unused prompt and add server instructions * simplify claude code instructions with global installation
1 parent bbf6cac commit dbda5ea

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

MCPForUnity/UnityMcpServer~/src/server.py

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,26 @@ def _emit_startup():
157157
# Initialize MCP server
158158
mcp = FastMCP(
159159
name="mcp-for-unity-server",
160-
lifespan=server_lifespan
160+
lifespan=server_lifespan,
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\n
172+
- Tips:\n
173+
- Create prefabs for reusable GameObjects.\n
174+
- Always include a camera and main light in your scenes.\n
175+
- Unless specified otherwise, paths are relative to the project's `Assets/` folder.\n
176+
- After creating or modifying scripts with `manage_script`, allow Unity to recompile; use `read_console` to check for compile errors.\n
177+
- Use `execute_menu_item` for interacting with Unity systems and third party tools like a user would.\n
178+
179+
"""
161180
)
162181

163182
# Register all tools
@@ -167,28 +186,6 @@ def _emit_startup():
167186
register_all_resources(mcp)
168187

169188

170-
@mcp.prompt()
171-
def asset_creation_strategy() -> str:
172-
"""Guide for discovering and using MCP for Unity tools effectively."""
173-
return (
174-
"Available MCP for Unity Server Tools:\n\n"
175-
"- `manage_editor`: Controls editor state and queries info.\n"
176-
"- `execute_menu_item`: Executes, lists and checks for the existence of Unity Editor menu items.\n"
177-
"- `read_console`: Reads or clears Unity console messages, with filtering options.\n"
178-
"- `manage_scene`: Manages scenes.\n"
179-
"- `manage_gameobject`: Manages GameObjects in the scene.\n"
180-
"- `manage_script`: Manages C# script files.\n"
181-
"- `manage_asset`: Manages prefabs and assets.\n"
182-
"- `manage_shader`: Manages shaders.\n\n"
183-
"Tips:\n"
184-
"- Create prefabs for reusable GameObjects.\n"
185-
"- Always include a camera and main light in your scenes.\n"
186-
"- Unless specified otherwise, paths are relative to the project's `Assets/` folder.\n"
187-
"- After creating or modifying scripts with `manage_script`, allow Unity to recompile; use `read_console` to check for compile errors.\n"
188-
"- Use `execute_menu_item` for interacting with Unity systems and third party tools like a user would.\n"
189-
)
190-
191-
192189
def main():
193190
"""Entry point for uvx and console scripts."""
194191
mcp.run(transport='stdio')

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,17 @@ If Auto-Setup fails or you use a different client:
171171
**Claude Code**
172172

173173
If you're using Claude Code, you can register the MCP server using the below commands:
174-
🚨**make sure to run these from your Unity project's home directory**🚨
175174
176175
**macOS:**
177176
178177
```bash
179-
claude mcp add UnityMCP -- uv --directory /Users/USERNAME/Library/AppSupport/UnityMCP/UnityMcpServer/src run server.py
178+
claude mcp add --scope user UnityMCP -- uv --directory /Users/USERNAME/Library/AppSupport/UnityMCP/UnityMcpServer/src run server.py
180179
```
181180
182181
**Windows:**
183182
184183
```bash
185-
claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Local/Microsoft/WinGet/Links/uv.exe" --directory "C:/Users/USERNAME/AppData/Local/UnityMCP/UnityMcpServer/src" run server.py
184+
claude mcp add --scope user UnityMCP -- "C:/Users/USERNAME/AppData/Local/Microsoft/WinGet/Links/uv.exe" --directory "C:/Users/USERNAME/AppData/Local/UnityMCP/UnityMcpServer/src" run server.py
186185
```
187186
**VSCode (all OS)**
188187

0 commit comments

Comments
 (0)