Skip to content

Commit 63914e3

Browse files
clean up unused prompt and add server instructions
1 parent 15bf793 commit 63914e3

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
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')

0 commit comments

Comments
 (0)