execute_csharp_script_in_unity_editor
Perform any task by executing generated C# scripts in Unity Editor context. Full access to UnityEngine, UnityEditor APIs, and reflection. Automatically captures logs, errors, and return values.
How to use it
execute_csharp_script_in_unity_editor is exposed by the UnityCodeMCPServer MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the execute_csharp_script_in_unity_editor tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
FULL UNITYCODEMCPSERVER LISTINGOther tools in UnityCodeMCPServer (7)
Enter Unity Play Mode, pause time and return immediately after triggering the transition. Intended to be used before gameplay automation tools.
Exit Unity Play Mode, unpause time, and return immediately after triggering the transition.
Capture the current Unity Game View as an image without routing screenshot capture through gameplay input calls.
Returns information about the current Unity Editor project and the UnityCodeMcpServer settings.
Temporarily unpause time, simulate configured Input System actions, collect logs, and pause again when finished.
Read Unity Editor Console logs with configurable entry limits (1-1000, default 200)
Run Unity tests via TestRunnerApi. Supports EditMode, PlayMode, or both. Can run all tests or filter by fully qualified test names.