Skip to content

Studio: add managed Unity, Unreal Engine and Godot MCP integrations - #17831

Merged
danielhanchen merged 15 commits into
mainfrom
studio-engine-mcp-builtins
Nov 16, 2026
Merged

danielhanchen merged 15 commits into
mainfrom
studio-engine-mcp-builtins

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

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).

App MCP server it connects to Default Readiness check
Unity MCP for Unity (HTTP server started by the Unity package) 127.0.0.1:8080/mcp GET /api/instances lists a connected Editor
Unreal Engine Epic's Unreal MCP plugin (UE 5.8+) 127.0.0.1:8000/mcp MCP answers
Godot 4 Godot MCP Native (served by the editor add-on) 127.0.0.1:9080/mcp MCP answers
Figma Figma desktop app's MCP server (Dev or Full seat, read-only) 127.0.0.1:3845/mcp MCP answers
Roblox Studio Roblox Studio's own MCP launcher (Windows / macOS) stdio MCP answers

Every 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.py holds the apps. Rows are stored like the Blender row: builtin_id, an empty raw url and a builtin_config_json with the port, an optional project folder (Unreal) and consent. The URL and headers are resolved when the row is read.
  • Unreal defaults to Epic's plugin, which needs no auth. Users of the community EngineWire plugin set port 3000 and their project folder in Advanced settings; Unsloth then reads <project>/Saved/MCP/capability-token at resolve time and sends it as X-MCP-Capability-Token. The token never leaves the backend: managed rows return no headers from GET /api/mcp/servers.
  • New routes PUT /api/mcp/servers/builtins/{id} and POST .../{id}/test mirror 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/builtins keeps Blender first and appends the apps, each with installed (true / false, or null when the check itself failed, so no hint is shown).
  • Tool names use the builtin id (mcp__unity__*, mcp__unreal__*, ...), as mcp__blender__* already does.
  • These tools run code on this computer, so they follow the same gate as local stdio commands, in the chat tool path and in the MCP app resource and tool call routes: owner only, UI session only for direct app calls, and hidden and refused while Remote access or LAN access is on.
  • Loopback MCP connections ignore 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):

App Setup Test result Tool calls from chat
Unreal Editor 5.8.4 (built from Epic's source, Unreal MCP + All Toolsets on; headless here, Vulkan on a Colab G4 for the demo) enable, re-enable reused the same row ok, 3 tools, editor_ready call_tool SceneTools.get_current_level returned /Temp/Untitled_1; add_to_scene_from_class StaticMeshActor returned the new actor's path
Godot 4.7.2 + Godot MCP Native 1.0.8 (real headless editor) enable, re-enable reused the same row ok, 30 tools, editor_ready create_scene, open_scene, create_node MeshInstance3D, save_scene, get_scene_tree returned total_nodes 2 with the new node, and the .tscn on disk holds it
Unity (real MCP for Unity 10.3.0 server, no Editor on this host) enable ok, 29 tools, editor_ready: false with "No Unity Editor is connected..." find_gameobjects returns the server's no_unity_session answer
Blender 5.1.2 + official add-on enable 23 tools, bridge ready execute_blender_code created a cube and a second session read it back

Epic'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

  • No Unity Editor ran here (it needs a Unity license): Unity was tested against its real server. Figma and Roblox Studio only run on Windows and macOS, so they were tested against a stdio stand-in (Roblox) and the expected URL (Figma).
  • Downgrade: an older Studio build that reads a database holding one of the new rows errors on the unknown builtin_id and 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.
  • Godot MCP Native's optional auth token is not supported in the managed row. studio/MCP.md says to add Godot as a custom server with an Authorization header in that case.

Screenshots

Before and after, merge base d5cd9ffbd vs head f0a5cdc93, two isolated Studio installs (the Unreal dialog is from 3f8a2f3f0; 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.

MCP menu before and after

The More submenu: Godot, Figma and Roblox Studio.

More submenu before and after

The Unreal Engine setup dialog (the base build has no such row).

Unreal Engine setup dialog

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).

Godot setup dialog

Test connection against the real Unreal Editor 5.8.4 with Epic's Unreal MCP plugin.

Unreal Engine connected

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.

Blender island built from Unsloth chat

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).

Godot Pong built from Unsloth chat

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 CaptureViewport tool while the model worked, then orbited.

Unreal chat

Unreal village appearing, then an orbit

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).

Blender Godot Unity
Blender Godot Unity

@danielhanchen danielhanchen self-assigned this Nov 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T13:17:59.107875Z 74afff9 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 5800bed3f0

ℹ️ 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".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 15, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 15, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 5119e4babe

ℹ️ 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".

danielhanchen added a commit to unslothai/unsloth-zoo that referenced this pull request Nov 15, 2026
…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.
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 15, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 15, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 15, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 15, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 15, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +184 to +188
client = type(client)(
timeout = client.timeout,
headers = kwargs.get("headers"),
auth = kwargs.get("auth"),
trust_env = False,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

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".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 3f8a2f3f0b

ℹ️ 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".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
… isolation matrix does not read it as an object id
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 9a81edc8aa

ℹ️ 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".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 5efeff134a

ℹ️ 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".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 16, 2026
danielhanchen added a commit that referenced this pull request Nov 16, 2026
…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).
danielhanchen added a commit to Imagineer99/unsloth that referenced this pull request Nov 16, 2026
danielhanchen added a commit to Imagineer99/unsloth that referenced this pull request Nov 16, 2026
danielhanchen added a commit to Imagineer99/unsloth that referenced this pull request Nov 16, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen
danielhanchen merged commit e0d1837 into main Nov 16, 2026
@danielhanchen
danielhanchen deleted the studio-engine-mcp-builtins branch November 16, 2026 13:16
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 74afff9fa8

ℹ️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects UI# new-feature# refactor# security# Moves a security boundary: sandbox, allowlist, permission or network guard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Reddit issue] Unsloth MCP

1 participant