Repository navigation
Studio: add managed Unity, Unreal Engine and Godot MCP integrations - #17831
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…eadable Unreal token [skip ci]
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…es import smoke set (#2527) ## Summary `tests/test_temporary_patches_imports.py::test_temporary_patches_submodule_list_is_complete` fails on `main` since `51c7c9b9` (MoE LoRA: fold the expert LoRA into the grouped GEMM). Seen in unsloth's `Core zoo (HF=4.57.6 + TRL<1)` on the staging run of unslothai/unsloth#17831: ``` AssertionError: New temporary_patches submodule(s) on disk are NOT tested by this suite: ['unsloth_zoo.temporary_patches.moe_gc_keep_base', 'unsloth_zoo.temporary_patches.moe_lora_fold'] ``` ## Change (test only) Adds both modules to `TEMPORARY_PATCHES_SUBMODULES`, so each one gets its own import smoke case. The list is explicit by design, as the comment above it says. A new file must be added there, and this test is the reminder. ## Verification `tests/test_temporary_patches_imports.py`: 82 passed on transformers 5.17.0 and on 4.57.6, including the two new import cases. Before this change, the list-complete test fails on both.
…the backend cannot find [skip ci]
…Roblox Studio under More [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 444fe2cabc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| client = type(client)( | ||
| timeout = client.timeout, | ||
| headers = kwargs.get("headers"), | ||
| auth = kwargs.get("auth"), | ||
| trust_env = False, |
There was a problem hiding this comment.
Preserve redirect handling in the loopback HTTP client
For loopback MCP endpoints that redirect requests, such as /mcp to /mcp/, replacing the SDK client here disables redirects: create_mcp_http_client() explicitly enables follow_redirects, but the replacement client's default is false. Since _client() now selects this factory for all loopback HTTP servers, this also regresses existing custom local MCP integrations: discovery and tool calls receive an HTTP redirect error instead of reaching the server. Preserve client.follow_redirects when constructing the proxy-free replacement.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not a regression: Studio pins fastmcp>=4.1.5, which requires mcp>=2.3.0,<3 (2.3.0 is the only release in range), and its create_mcp_http_client leaves follow_redirects at the httpx default (off) on purpose, since the MCP transports follow same-origin redirects themselves via stream_within_origin. The proxy-free loopback client keeps that same default.
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
… isolation matrix does not read it as an object id
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…er button [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…ameter name (#17972) ## Summary `tests/test_cp_ulysses_media_towers_gloo.py::test_gemma4_with_towers_matches_one_process` (from #17930) has failed in four of the last gloo shard runs on unrelated PRs (staging runs of #17957, #17960, #17831 and #17966), always as: ``` E AssertionError: model.language_model.layers.0.self_attn.q_proj.weight ``` and it passes locally every time (5 of 5 standalone, and 53 of 53 with all five `test_cp_*gloo*.py` files in one process, so it is not state left by an earlier test in the worker). The assertion passes `msg = name`, which replaces torch's whole mismatch report with the parameter name, so the CI logs do not say how many elements are off or by how much. Without that there is no way to tell a float32 reduction-order difference on the CI runners' CPUs (a tolerance question) from a real context parallel gradient bug. ## Change Test only. The gradient `assert_close` calls in `test_cp_ulysses_media_towers_gloo.py` and `test_cp_ulysses_generic_gloo.py` pass `msg` as a callable that prefixes the parameter name to torch's report instead of replacing it: ``` model.language_model.layers.0.self_attn.q_proj.weight: Tensor-likes are not close! Mismatched elements: ... Greatest absolute difference: ... (up to ... allowed) Greatest relative difference: ... (up to ... allowed) ``` Tolerances are unchanged. The next CI failure will carry the numbers needed to decide whether the tolerance or the code is wrong. ## Testing - Both files (2-rank gloo, CPU): 24 passed. - The message form checked directly against `torch.testing.assert_close` (output above).
…e launch test there [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #17823
A Reddit user asked whether Unsloth Desktop's chat can drive Unity, Unreal Engine, Blender and other engines over MCP without a separate client such as VS Code or Cline. Blender already has a managed entry in the chat's MCP menu. This PR adds Unity, Unreal Engine, Godot, Figma and Roblox Studio as managed entries that work the same way, so users set them up in a few clicks instead of hand-writing MCP configs.
What changes
The chat's MCP menu gains Unity and Unreal Engine rows under Blender, and a More submenu with Godot, Figma and Roblox Studio. Each opens a setup dialog laid out like the Blender one: execution consent, Enable, Test connection with a green / amber / red status, Setup help with the add-on link and steps, and Advanced settings for the port. Every row is always listed; a small Not installed hint marks apps a cheap file-system check could not find on the backend machine (Blender gets the same hint).
127.0.0.1:8080/mcpGET /api/instanceslists a connected Editor127.0.0.1:8000/mcp127.0.0.1:9080/mcp127.0.0.1:3845/mcpEvery app runs its MCP server itself, so Unsloth downloads and installs nothing. It connects over loopback HTTP from the backend, or for Roblox Studio starts Roblox's own launcher (
%LOCALAPPDATA%\Roblox\mcp.bat/RobloxStudio.app/.../StudioMCP).How it works
integrations/editors.pyholds the apps. Rows are stored like the Blender row:builtin_id, an empty rawurland abuiltin_config_jsonwith the port, an optional project folder (Unreal) and consent. The URL and headers are resolved when the row is read.<project>/Saved/MCP/capability-tokenat resolve time and sends it asX-MCP-Capability-Token. The token never leaves the backend: managed rows return no headers fromGET /api/mcp/servers.PUT /api/mcp/servers/builtins/{id}andPOST .../{id}/testmirror the Blender ones: they need a UI session, require consent, and enable a row only after a successful probe. Calling them again reuses the same row, so repeated runs are idempotent. Unknown ids return 404.GET /api/mcp/servers/builtinskeeps Blender first and appends the apps, each withinstalled(true / false, or null when the check itself failed, so no hint is shown).mcp__unity__*,mcp__unreal__*, ...), asmcp__blender__*already does.HTTP(S)_PROXY/ALL_PROXY, so a configured proxy never receives requests (or headers) meant for this machine's own servers.Blender's own routes, settings, dialog and copy are unchanged. A user who never opens the new rows sees the same menu plus the new items, and the same tool list.
Testing
Real apps on Linux, through the new routes and the chat tool path (
execute_tool):ok, 3 tools, editor_readycall_toolSceneTools.get_current_levelreturned/Temp/Untitled_1;add_to_scene_from_class StaticMeshActorreturned the new actor's pathok, 30 tools, editor_readycreate_scene,open_scene,create_node MeshInstance3D,save_scene,get_scene_treereturnedtotal_nodes 2with the new node, and the.tscnon disk holds itok, 29 tools, editor_ready: falsewith "No Unity Editor is connected..."find_gameobjectsreturns the server'sno_unity_sessionanswerexecute_blender_codecreated a cube and a second session read it backEpic's plugin lists 55 toolsets behind three meta-tools (
list_toolsets,describe_toolset,call_tool), so the chat sees three tools. In UE 5.8 the plugin and All Toolsets are off by default (5.9 turns the plugin on), so the setup step says to turn both on.Unit tests:
studio/backend/tests/test_editor_mcp_managed.py(15 tests: real loopback MCP servers for the Unity readiness and Unreal token paths, Roblox over stdio, Figma URL, install hints, gates, proxy bypass). The existing MCP, Blender, account isolation and route gate suites pass unchanged. Frontend typecheck, build and tests pass.Not covered
builtin_idand its MCP list fails, as it would for any future managed row. The updater only moves forward; this affects an explicit downgrade or two Studio versions sharing one home.studio/MCP.mdsays to add Godot as a custom server with anAuthorizationheader in that case.Screenshots
Before and after, merge base
d5cd9ffbdvs headf0a5cdc93, two isolated Studio installs (the Unreal dialog is from3f8a2f3f0; its text has not changed since).The composer's MCP menu: Unity and Unreal Engine under Blender, and a More submenu. Unity shows the Not installed hint on this Linux host.
The More submenu: Godot, Figma and Roblox Studio.
The Unreal Engine setup dialog (the base build has no such row).
The Godot setup dialog with Setup help open: the steps name the Asset Store tab in Godot 4.7 and the plugin's Start Server button (its server does not start on its own).
Test connection against the real Unreal Editor 5.8.4 with Epic's Unreal MCP plugin.
Demos
Run on Colab with this PR's Studio build and a local
unsloth/Qwen3.8-27B-GGUF(UD-Q4_K_XL), one prompt each.Blender 5.1.2: the model builds a low-poly island (sea, island, hill, cabin, five trees, warm sun) in 7 tool calls, test-renders to check its own work, then a Cycles turntable of the scene it built.
Godot 4.7.2 + Godot MCP Native: the model writes a self-playing Pong (scene, script, main scene) in 25 tool calls and runs it; then the game it made, running (recorded from the scene and script files the model wrote).
Unreal Engine 5.8.4 (built from Epic's source, Epic's Unreal MCP plugin, Vulkan on a Colab RTX PRO 6000 VM): from one prompt the model creates six colored material instances and 22 shapes (grass, a stone well, four houses with red roofs, six trees) through the plugin's toolsets, then focuses the camera. The editor viewport was captured through the plugin's own
CaptureViewporttool while the model worked, then orbited.Test connection on each managed row (local run): Blender and Godot 4.7.2 + Godot MCP Native are connected; Unity reaches the real MCP for Unity 10.3.0 server with no Editor attached (amber).