Conversation
Remove editable Cloud server URL and make the plugin use a single hardcoded cloud URL. Added CloudServerBaseUrl/CloudServerUrl constants to UnityMcpPlugin.Config and changed Host to use the constant (no extra /mcp suffix). Removed the cloud URL TextField and its focus/connection callbacks from the editor UI and adjusted authorisation flow to use UnityConnectionConfig.CloudServerBaseUrl. Updated UnityMcpPluginEditor.Static to expose the cloud URL via the runtime config. CLI changes: dropped cloudServerUrl from the config shape, added a CLOUD_SERVER_URL constant and make resolveConnectionFromConfig return that value for Cloud mode. Updated tests and run-tool behavior to reflect the hardcoded cloud URL and removed references to a configurable cloudServerUrl.
Set password masking for cloud and local authorization token TextFields in the UXML and enable a Ctrl/Cmd+C shortcut to copy their values in the editor scripts. Changes: - MainWindow.uxml: add password="true" to inputCloudToken and inputAuthorizationToken to hide token contents. - MainWindowEditor.Connection.cs & MainWindowEditor.McpServer.cs: set isPasswordField = true and register KeyDownEvent handlers to copy the field value to GUIUtility.systemCopyBuffer on Ctrl/Cmd+C (and stop propagation/prevent default). Also add missing UnityEngine using in Connection script. Purpose: improve token privacy in the UI while providing a convenient copy-to-clipboard shortcut.
Introduce a new SegmentedControl UI element (with USS styles) and migrate several two-toggle UI patterns to this segmented control. Adds SegmentedControl.cs and its stylesheet (_segmented-control.uss) plus meta files, and updates MainWindow UXML and editor logic to use the control (Connection, McpFeatures, McpServer). Removed the old mutually-exclusive toggle logic and toggle-style CSS, wiring selection via ChangeEvent<int> and preserving tooltips and behavior (no functional changes beyond UI consolidation). Key files: SegmentedControl.cs, _segmented-control.uss, MainWindow.uxml, MainWindow.uss, and MainWindowEditor.* (Connection/CreateGUI/McpFeatures/McpServer).
Update form USS to improve disabled/enabled text-field visuals: replace previous border/margin rules with transparent border, adjust background and text colors to muted tones, and add 200ms transition-duration to inputs and labels. New rules also apply muted color to .unity-label for disabled fields to ensure consistent appearance and smoother state changes.
Add a .styled-dropdown stylesheet to _forms.uss to customize Unity popup fields (background, border, radius, padding, hover state, text size/color, arrow tint and transitions). Apply the styled-dropdown class to the aiAgentDropdown DropdownField in MainWindow.uxml so the AI agent selector uses the new visual styling.
Extend styled-dropdown rules to target EnumField inputs and their hover state, add top padding for the dropdown label, and remove the old arrow tint rule. Also add the styled-dropdown class to the Log Level EnumField in MainWindow.uxml so the updated styles apply to the UI.
Introduce new USS styles for styled-text-field, styled-integer-field and refined dropdown/field states (hover/active/disabled), add consistent paddings and transitions, and tweak label spacing. Apply the new classes across several UXML views (MainWindow, McpPromptsWindow, McpResourcesWindow, McpToolsWindow, TemplateTextFieldReadOnly) to standardize appearance and replace some inline alignment. Also update header labels and tooltips in the resource/prompt/tool windows for clearer, shorter titles and helpful descriptions.
Update agent configuration UI and interaction to improve clarity and usability. - Show full skills/config paths as tooltips and add ellipsis/truncation in UXML to avoid overflow (TemplateSkillsSection, TemplateConfigureStatus, AiAgentConfigurator, ConfigurationElements). - Restructure configure status element: remove circular status indicator, add header + inline path label, compact status row and button styling (TemplateConfigureStatus.uxml). - Change configure button behavior to toggle configure/unconfigure: when configured the button now removes the config (text "Remove") and uses alert styling; previously it always attempted to configure (ConfigurationElements.cs). - Minor layout tweaks: add top margin to transport containers in AiAgentTemplateConfig.uxml and set skills path tooltip in AiAgentConfigurator.cs. These changes make paths visible via tooltip, prevent layout overflow, and provide a clearer configure/remove workflow.
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refines the user experience and simplifies configuration within the Unity MCP Plugin. It modernizes several UI sections by replacing traditional toggles with a new Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
📝 WalkthroughWalkthroughThis pull request replaces toggle-based binary UI controls with a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sequence DiagramThis PR consolidates mode selection into segmented controls and routes Cloud mode through a fixed endpoint. It also updates cloud authorization so a new token is saved and immediately used to reconnect in Cloud mode. sequenceDiagram
participant User
participant MainWindow
participant PluginConfig
participant LocalServer
participant CloudAuth
participant MCPConnection
User->>MainWindow: Select mode in segmented control
MainWindow->>PluginConfig: Save connection mode
alt Custom mode selected
MainWindow->>LocalServer: Start local server if needed
MainWindow->>MCPConnection: Reconnect using local host
else Cloud mode selected
MainWindow->>LocalServer: Stop local server
MainWindow->>MCPConnection: Reconnect using fixed cloud endpoint
end
User->>MainWindow: Click Authorize
MainWindow->>CloudAuth: Start device authorization with fixed cloud base
CloudAuth-->>MainWindow: Return cloud token
MainWindow->>PluginConfig: Save token and reconnect in Cloud mode
Generated by CodeAnt AI |
Nitpicks 🔍
|
There was a problem hiding this comment.
Code Review
This pull request refactors the Unity Editor UI by replacing multiple Toggle elements with a new custom SegmentedControl component for selecting connection mode, transport method, and authorization options. This involved adding the SegmentedControl component and its USS styling, removing the old toggle-related USS, and updating UXML files to use the new component and new styling classes for various input fields. The CloudServerUrl is now a hardcoded constant across the Unity plugin and CLI, removing a configurable property. Additionally, the ConfigurationElements UI for AI agents was redesigned, removing a status circle and adding a path label. Review comments suggest refactoring duplicated password field copy-paste logic into a shared utility and simplifying a callback's conditional logic for better maintainability and readability.
| inputCloudToken.RegisterCallback<KeyDownEvent>(evt => | ||
| { | ||
| if (evt.keyCode == KeyCode.C && (evt.ctrlKey || evt.commandKey)) | ||
| { | ||
| GUIUtility.systemCopyBuffer = inputCloudToken.value; | ||
| evt.StopPropagation(); | ||
| evt.PreventDefault(); | ||
| } | ||
| }); |
There was a problem hiding this comment.
This logic to enable copying from a password field is also used in MainWindowEditor.McpServer.cs. To improve maintainability and reduce code duplication, consider extracting this into a static helper method in a shared utility class. For example:
public static class UIUtils
{
public static void EnableCopyFromPasswordField(TextField passwordField)
{
passwordField.RegisterCallback<KeyDownEvent>(evt =>
{
if (evt.keyCode == KeyCode.C && (evt.ctrlKey || evt.commandKey))
{
GUIUtility.systemCopyBuffer = passwordField.value;
evt.StopPropagation();
evt.PreventDefault();
}
});
}
}Then you could call UIUtils.EnableCopyFromPasswordField(inputCloudToken); here and in the other location.
| inputAuthorizationToken.RegisterCallback<KeyDownEvent>(evt => | ||
| { | ||
| if (evt.keyCode == KeyCode.C && (evt.ctrlKey || evt.commandKey)) | ||
| { | ||
| GUIUtility.systemCopyBuffer = inputAuthorizationToken.value; | ||
| evt.StopPropagation(); | ||
| evt.PreventDefault(); | ||
| } | ||
| }); |
| { | ||
| if (evt.newValue == 0) | ||
| { | ||
| ApplyServerSettingAndRestart(() => | ||
| { | ||
| UnityMcpPluginEditor.AuthOption = AuthOption.none; | ||
| }); | ||
| SetTokenFieldsVisible(inputAuthorizationToken, tokenSection, false); | ||
| InvalidateAndReloadAgentUI(); | ||
| }, | ||
| onBSelected: () => | ||
| } | ||
| else | ||
| { | ||
| ApplyServerSettingAndRestart(() => | ||
| { | ||
| UnityMcpPluginEditor.AuthOption = AuthOption.required; | ||
| }); | ||
| SetTokenFieldsVisible(inputAuthorizationToken, tokenSection, true); | ||
| InvalidateAndReloadAgentUI(); | ||
| }); | ||
| } |
There was a problem hiding this comment.
This callback contains duplicated logic in its branches. It can be refactored to be more concise and easier to read.
{
var isRequired = evt.newValue == 1;
var newAuthOption = isRequired ? AuthOption.required : AuthOption.none;
ApplyServerSettingAndRestart(() =>
{
UnityMcpPluginEditor.AuthOption = newAuthOption;
});
SetTokenFieldsVisible(inputAuthorizationToken, tokenSection, isRequired);
InvalidateAndReloadAgentUI();
}| UpdateStatus(false); | ||
| onConfigured.OnNext(false); |
There was a problem hiding this comment.
Suggestion: The remove branch assumes unconfiguration always succeeds and force-updates the UI/event state to "not configured". Since Unconfigure() can return false (e.g., file missing or write failure), this can desynchronize UI state from actual config state and emit incorrect status to subscribers. Re-read the actual configured state after attempting removal and publish that. [logic error]
Severity Level: Major ⚠️
- ⚠️ Agent configurator status can show false removal success.
- ⚠️ Remove/Configure button state can mismatch real file state.
- ⚠️ Debugging config failures becomes harder in editor UI.| UpdateStatus(false); | |
| onConfigured.OnNext(false); | |
| var isConfiguredAfter = _config.IsConfigured(); | |
| UpdateStatus(isConfiguredAfter); | |
| onConfigured.OnNext(isConfiguredAfter); |
Steps of Reproduction ✅
1. Open the Unity editor window through `MainWindowEditor.ShowWindow()`
(`Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.cs:31-38`), which
builds agent UI in `OnGUICreated()` and calls `ConfigureAgents(root)`
(`.../MainWindowEditor.CreateGUI.cs:184-197`).
2. `ConfigureAgents()` loads one agent panel with `LoadAgentUI()`
(`.../MainWindowEditor.AiAgents.cs:74,130-147`), which calls
`configurator.CreateUI(container)` (`.../MainWindowEditor.AiAgents.cs:143`) and constructs
`ConfigurationElements` with the remove/configure button
(`.../AiAgentConfigurators/ConfigurationElements.cs:33-40`).
3. Make the agent config file configured but non-writable (read-only/locked). This is a
real failure path: both config implementations perform `File.WriteAllText(...)` inside
`Unconfigure()` (`.../JsonAiAgentConfig.cs:257`, `.../TomlAiAgentConfig.cs:235`) and
return `false` on exception (`.../JsonAiAgentConfig.cs:260-264`,
`.../TomlAiAgentConfig.cs:238-242`).
4. Click **Remove**. In `ConfigurationElements` callback, code executes
`_config.Unconfigure(); UpdateStatus(false); onConfigured.OnNext(false);`
(`.../ConfigurationElements.cs:53-58`) without checking outcome. Result: UI flips to "Not
Configured" even though unconfigure failed and file stayed configured.
5. This mismatch is technically observable in current flow because `Unconfigure()` is
explicitly designed to fail in realistic conditions and return false (also validated by
tests expecting false: `.../Tests/Editor/UI/JsonAiAgentConfigTests.cs:1312-1331`,
`.../Tests/Editor/UI/TomlAiAgentConfigTests.cs:1141-1152`).Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/AiAgentConfigurators/ConfigurationElements.cs
**Line:** 57:58
**Comment:**
*Logic Error: The remove branch assumes unconfiguration always succeeds and force-updates the UI/event state to "not configured". Since `Unconfigure()` can return `false` (e.g., file missing or write failure), this can desynchronize UI state from actual config state and emit incorrect status to subscribers. Re-read the actual configured state after attempting removal and publish that.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.| { | ||
| if (evt.keyCode == KeyCode.C && (evt.ctrlKey || evt.commandKey)) | ||
| { | ||
| GUIUtility.systemCopyBuffer = inputCloudToken.value; |
There was a problem hiding this comment.
Suggestion: The copy shortcut currently copies the UI field text, which is set to the placeholder string when no token exists. That causes users to copy and paste an invalid credential ("Token — press Authorize") into agent configs. Copy the persisted cloud token value instead, and only copy when it is non-empty. [logic error]
Severity Level: Major ⚠️
- ⚠️ Cloud setup copies placeholder, not usable token.
- ⚠️ Agent authorization fails after pasted invalid credential.
- ⚠️ Onboarding instructions become misleading for first-time users.| GUIUtility.systemCopyBuffer = inputCloudToken.value; | |
| var tokenToCopy = UnityMcpPluginEditor.CloudToken; | |
| if (!string.IsNullOrEmpty(tokenToCopy)) | |
| GUIUtility.systemCopyBuffer = tokenToCopy; |
Steps of Reproduction ✅
1. Open the editor window so `OnGUICreated()` runs in
`Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.CreateGUI.cs:191`,
which always calls `SetupCloudAuthSection(root)`.
2. In `SetupCloudAuthSection()` (`.../MainWindowEditor.Connection.cs:206-214`), when
`UnityMcpPluginEditor.CloudToken` is empty/null, `SetTokenValue()` sets
`inputCloudToken.value` to placeholder text `"Token — press Authorize"`.
3. Press Ctrl/Cmd+C while the token field is focused; the key handler at
`.../MainWindowEditor.Connection.cs:196-203` copies `inputCloudToken.value` directly into
`GUIUtility.systemCopyBuffer`.
4. Clipboard now contains placeholder text, not a credential; this conflicts with user
flow text in `.../MainWindowEditor.CreateGUI.cs:170-172` instructing users to copy this
field into agent authorization.
5. If user pastes that value into agent/server auth config, authentication fails because
the runtime expects actual token (`Token` getter uses `CloudToken` in
`Unity-MCP-Plugin/Assets/root/Runtime/UnityMcpPlugin.Config.cs:66-73`).Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.Connection.cs
**Line:** 200:200
**Comment:**
*Logic Error: The copy shortcut currently copies the UI field text, which is set to the placeholder string when no token exists. That causes users to copy and paste an invalid credential (`"Token — press Authorize"`) into agent configs. Copy the persisted cloud token value instead, and only copy when it is non-empty.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.| <ui:VisualElement name="segmentConnectionMode" style="flex-direction: row; flex-grow: 1; justify-content: flex-end; margin-right: 0;" /> | ||
| </ui:VisualElement> | ||
| <ui:TextField picking-mode="Ignore" label="Server URL" value="http://localhost:8080" name="InputServerURL" class="content-item" /> | ||
| <ui:TextField picking-mode="Ignore" label="Server URL" value="http://localhost:8080" name="InputServerURL" class="content-item styled-text-field" /> |
There was a problem hiding this comment.
Suggestion: The Server URL field is set with picking-mode="Ignore", which prevents user interaction. This breaks custom-mode host editing because the FocusOutEvent save logic in SetupConnectionSection only runs after user edits. Make this field interactive so users can change and persist the server URL. [logic error]
Severity Level: Major ⚠️
- ❌ Main window custom host cannot be changed or saved.
- ⚠️ Custom-mode remote MCP connections stay stuck on old URL.| <ui:TextField picking-mode="Ignore" label="Server URL" value="http://localhost:8080" name="InputServerURL" class="content-item styled-text-field" /> | |
| <ui:TextField label="Server URL" value="http://localhost:8080" name="InputServerURL" class="content-item styled-text-field" /> |
Steps of Reproduction ✅
1. Open the editor window via menu item `Window/AI Game Developer — MCP` in
`Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/MenuItems.cs:24-25`, which calls
`MainWindowEditor.ShowWindow()`.
2. Window initialization calls `OnGUICreated()` in
`Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.CreateGUI.cs:35-43`,
then `SetupConnectionSection()` and binds `InputServerURL`.
3. In `SetupConnectionSection()` (`.../MainWindowEditor.Connection.cs:26-50`), host
persistence only happens in `inputFieldHost.RegisterCallback<FocusOutEvent>` at line 38
after user edits.
4. In final UXML (`.../MainWindow.uxml:21`), `InputServerURL` has `picking-mode="Ignore"`,
so pointer focus/edit is blocked; no edit means no `FocusOutEvent`-driven save/reconnect
at `MainWindowEditor.Connection.cs:44-49`.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** Unity-MCP-Plugin/Assets/root/Editor/UI/uxml/MainWindow.uxml
**Line:** 21:21
**Comment:**
*Logic Error: The `Server URL` field is set with `picking-mode="Ignore"`, which prevents user interaction. This breaks custom-mode host editing because the `FocusOutEvent` save logic in `SetupConnectionSection` only runs after user edits. Make this field interactive so users can change and persist the server URL.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.| <ui:VisualElement name="tokenSection" style="flex-direction: column; margin-top: 2px; margin-bottom: 2px;"> | ||
| <ui:VisualElement style="flex-direction: row;"> | ||
| <ui:TextField name="inputAuthorizationToken" label="" placeholder-text="Token" readonly="true" class="token-input" /> | ||
| <ui:TextField name="inputAuthorizationToken" label="" placeholder-text="Token" readonly="true" password="true" class="token-input" /> |
There was a problem hiding this comment.
Suggestion: Marking the local authorization token field as readonly prevents manual token entry, but the window logic still expects user-edit changes via FocusOutEvent to persist UnityMcpPluginEditor.Token. This causes a functional regression where users cannot set a known token for required-auth setups. [logic error]
Severity Level: Major ⚠️
- ❌ Required-auth token cannot be manually set in editor.
- ⚠️ Existing client tokens cannot be reused, forcing rotation.| <ui:TextField name="inputAuthorizationToken" label="" placeholder-text="Token" readonly="true" password="true" class="token-input" /> | |
| <ui:TextField name="inputAuthorizationToken" label="" placeholder-text="Token" password="true" class="token-input" /> |
Steps of Reproduction ✅
1. Open the same main window from `MenuItems.ShowWindow()`
(`Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/MenuItems.cs:24-25`), then UI setup runs
through `OnGUICreated()` (`.../MainWindowEditor.CreateGUI.cs:35-43`).
2. `SetupMcpServerSection()`
(`Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.McpServer.cs:29-133`)
queries `inputAuthorizationToken` at line 49 and wires token persistence on
`FocusOutEvent` at lines 109-119 (`UnityMcpPluginEditor.Token = newToken`).
3. Final UXML declares `inputAuthorizationToken` as `readonly="true"` at
`Unity-MCP-Plugin/Assets/root/Editor/UI/uxml/MainWindow.uxml:69`, preventing user text
edits in the field.
4. Because manual edits cannot occur, the `FocusOutEvent` save path at
`MainWindowEditor.McpServer.cs:109-119` is effectively unreachable for user-entered token
changes, so known pre-shared tokens cannot be entered from UI.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** Unity-MCP-Plugin/Assets/root/Editor/UI/uxml/MainWindow.uxml
**Line:** 69:69
**Comment:**
*Logic Error: Marking the local authorization token field as `readonly` prevents manual token entry, but the window logic still expects user-edit changes via `FocusOutEvent` to persist `UnityMcpPluginEditor.Token`. This causes a functional regression where users cannot set a known token for required-auth setups.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Unity-MCP-Plugin/Assets/root/Editor/UI/uss/common/_forms.uss (1)
38-45:⚠️ Potential issue | 🟡 MinorInvalid negative padding value.
Line 44 sets
padding-left: -10px. Negative padding values are not supported in USS (Unity Style Sheets) or CSS. This will either be ignored or cause unexpected behavior. If you need to shift the label leftward, consider using a negativemargin-leftinstead, or adjust the parent container's layout.🛠️ Proposed fix
.content-item .unity-label { width: 85px; min-width: 65px; max-width: 85px; overflow: hidden; text-overflow: ellipsis; - padding-left: -10px; + margin-left: -10px; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Unity-MCP-Plugin/Assets/root/Editor/UI/uss/common/_forms.uss` around lines 38 - 45, The rule for .content-item .unity-label uses an invalid negative padding (padding-left: -10px); locate the .content-item .unity-label selector in _forms.uss and remove the negative padding-left value and replace it with a valid adjustment such as margin-left: -10px (or adjust width/parent layout) so the label shifts left without using illegal padding; ensure you only change the padding-left declaration and keep the other width/overflow properties intact.
🧹 Nitpick comments (2)
Unity-MCP-Plugin/Assets/root/Editor/UI/uxml/agents/AiAgentTemplateConfig.uxml (1)
24-27: Consistent spacing applied to transport containers.The identical
margin-top: 4px;styling provides uniform spacing for both HTTP and STDIO transport mode containers, which improves visual consistency.Optional: Consider using a shared CSS class.
For maintainability, you could define a shared CSS class (e.g.,
.transport-container) instead of inline styles, especially if this spacing might be adjusted in the future or applied to additional containers.♻️ Optional refactor to use a CSS class
In your USS/CSS file, add:
.transport-container { margin-top: 4px; }Then update the UXML:
- <ui:VisualElement name="containerHttp" style="margin-top: 4px;" /> + <ui:VisualElement name="containerHttp" class="transport-container" /> - <ui:VisualElement name="containerStdio" style="margin-top: 4px;" /> + <ui:VisualElement name="containerStdio" class="transport-container" />🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Unity-MCP-Plugin/Assets/root/Editor/UI/uxml/agents/AiAgentTemplateConfig.uxml` around lines 24 - 27, Replace the duplicate inline style "margin-top: 4px;" on the UXML VisualElements named containerHttp and containerStdio by applying a shared USS class (e.g., "transport-container"); then add a corresponding rule for .transport-container { margin-top: 4px; } to your USS stylesheet so spacing is maintained centrally and easier to update. Ensure you update the UXML elements to include the class attribute referencing "transport-container" and remove the inline style attributes from the VisualElement tags.cli/tests/run-tool.test.ts (1)
234-248: Use theCLOUD_SERVER_URLconstant for consistency.The integration test hardcodes the URL string directly, while the unit tests (lines 52, 80, 126) use the imported
CLOUD_SERVER_URLconstant. Using the constant here would ensure this test stays in sync if the URL ever changes.♻️ Suggested fix
- expect(stdout).toContain('https://ai-game.dev/mcp'); + expect(stdout).toContain(CLOUD_SERVER_URL);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cli/tests/run-tool.test.ts` around lines 234 - 248, The test currently asserts against a hardcoded URL string; replace that literal with the shared constant CLOUD_SERVER_URL to keep tests consistent. Import CLOUD_SERVER_URL at the top of the test file (where other tests reference it) and change the assertion expect(stdout).toContain('https://ai-game.dev/mcp') to expect(stdout).toContain(CLOUD_SERVER_URL); ensure the import matches the module used by the other tests (the same symbol referenced on lines 52, 80, 126).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cli/src/utils/config.ts`:
- Around line 170-171: CLOUD_SERVER_URL is hardcoded to
'https://ai-game.dev/mcp' which may not be a reachable public endpoint and lacks
an override; verify that the endpoint is actually deployed and publicly
accessible, and modify config handling to allow an environment override (e.g.,
add a CLOUD_MCP_HOST or reuse UNITY_MCP_HOST) so CLOUD_SERVER_URL becomes
configurable at runtime with a sensible default fallback; update the code that
reads CLOUD_SERVER_URL in config.ts and anywhere it's used to prefer the env var
when present.
In
`@Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/AiAgentConfigurators/ConfigurationElements.cs`:
- Around line 53-65: When unconfiguring, check the boolean return from
_config.Unconfigure() instead of ignoring it: call var success =
_config.Unconfigure(); then call UpdateStatus(!success ? _config.IsConfigured()
: false) or simply UpdateStatus(!success) based on desired semantics and emit
onConfigured.OnNext(success) so the UI reflects the actual result; update the
block that currently calls _config.Unconfigure() to use the returned bool and
propagate it to UpdateStatus(...) and onConfigured.OnNext(...).
In `@Unity-MCP-Plugin/Assets/root/Editor/Scripts/UnityMcpPluginEditor.Static.cs`:
- Line 184: UnityMcpPluginEditor.CloudServerUrl was changed to a get-only
property causing a breaking API change; restore a setter that provides a
migration path by reintroducing a public set accessor on
UnityMcpPluginEditor.CloudServerUrl which either forwards assignments to
UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl or safely no-ops while
emitting a clear Obsolete attribute and a runtime warning (log) so downstream
consumers get a compile-time deprecation message and a runtime hint; mark the
setter with [Obsolete("...migration guidance...", false)] and ensure the getter
continues to return UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl.
---
Outside diff comments:
In `@Unity-MCP-Plugin/Assets/root/Editor/UI/uss/common/_forms.uss`:
- Around line 38-45: The rule for .content-item .unity-label uses an invalid
negative padding (padding-left: -10px); locate the .content-item .unity-label
selector in _forms.uss and remove the negative padding-left value and replace it
with a valid adjustment such as margin-left: -10px (or adjust width/parent
layout) so the label shifts left without using illegal padding; ensure you only
change the padding-left declaration and keep the other width/overflow properties
intact.
---
Nitpick comments:
In `@cli/tests/run-tool.test.ts`:
- Around line 234-248: The test currently asserts against a hardcoded URL
string; replace that literal with the shared constant CLOUD_SERVER_URL to keep
tests consistent. Import CLOUD_SERVER_URL at the top of the test file (where
other tests reference it) and change the assertion
expect(stdout).toContain('https://ai-game.dev/mcp') to
expect(stdout).toContain(CLOUD_SERVER_URL); ensure the import matches the module
used by the other tests (the same symbol referenced on lines 52, 80, 126).
In
`@Unity-MCP-Plugin/Assets/root/Editor/UI/uxml/agents/AiAgentTemplateConfig.uxml`:
- Around line 24-27: Replace the duplicate inline style "margin-top: 4px;" on
the UXML VisualElements named containerHttp and containerStdio by applying a
shared USS class (e.g., "transport-container"); then add a corresponding rule
for .transport-container { margin-top: 4px; } to your USS stylesheet so spacing
is maintained centrally and easier to update. Ensure you update the UXML
elements to include the class attribute referencing "transport-container" and
remove the inline style attributes from the VisualElement tags.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 46b95332-5710-4d63-8352-9ab278daf345
📒 Files selected for processing (27)
Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/AiAgentConfigurators/AiAgentConfigurator.csUnity-MCP-Plugin/Assets/root/Editor/Scripts/UI/AiAgentConfigurators/ConfigurationElements.csUnity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Controls.metaUnity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Controls/SegmentedControl.csUnity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Controls/SegmentedControl.cs.metaUnity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.Connection.csUnity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.CreateGUI.csUnity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.McpFeatures.csUnity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.McpServer.csUnity-MCP-Plugin/Assets/root/Editor/Scripts/UnityMcpPluginEditor.Static.csUnity-MCP-Plugin/Assets/root/Editor/UI/uss/MainWindow.ussUnity-MCP-Plugin/Assets/root/Editor/UI/uss/common/_forms.ussUnity-MCP-Plugin/Assets/root/Editor/UI/uss/common/_segmented-control.ussUnity-MCP-Plugin/Assets/root/Editor/UI/uss/common/_segmented-control.uss.metaUnity-MCP-Plugin/Assets/root/Editor/UI/uxml/MainWindow.uxmlUnity-MCP-Plugin/Assets/root/Editor/UI/uxml/McpPromptsWindow.uxmlUnity-MCP-Plugin/Assets/root/Editor/UI/uxml/McpResourcesWindow.uxmlUnity-MCP-Plugin/Assets/root/Editor/UI/uxml/McpToolsWindow.uxmlUnity-MCP-Plugin/Assets/root/Editor/UI/uxml/agents/AiAgentTemplateConfig.uxmlUnity-MCP-Plugin/Assets/root/Editor/UI/uxml/agents/elements/TemplateConfigureStatus.uxmlUnity-MCP-Plugin/Assets/root/Editor/UI/uxml/agents/elements/TemplateSkillsSection.uxmlUnity-MCP-Plugin/Assets/root/Editor/UI/uxml/agents/elements/TemplateTextFieldReadOnly.uxmlUnity-MCP-Plugin/Assets/root/Runtime/UnityMcpPlugin.Config.cscli/src/commands/run-tool.tscli/src/utils/config.tscli/tests/config.test.tscli/tests/run-tool.test.ts
💤 Files with no reviewable changes (3)
- cli/tests/config.test.ts
- Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/Window/MainWindowEditor.CreateGUI.cs
- Unity-MCP-Plugin/Assets/root/Editor/UI/uss/MainWindow.uss
| export const CLOUD_SERVER_URL = 'https://ai-game.dev/mcp'; | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
ai-game.dev MCP server endpoint
💡 Result:
The MCP server associated with ai-game.dev is the Unity-MCP server from the GitHub repository https://github.com/IvanMurzak/Unity-MCP, which lists "Homepage: https://ai-game.dev". This is an AI-powered game development assistant for Unity Editor and Runtime, connecting tools like Claude, Cursor, and Windsurf via MCP. It supports flexible deployment (local stdio or remote HTTP) and custom MCP tools. The primary MCP server endpoint is http://localhost:8080 (default port, configurable). To run via Docker (streamableHttp transport): docker run -p 8080:8080 ivanmurzakdev/unity-mcp-server MCP client config example: { "mcpServers": { "ai-game-developer": { "url": "http://localhost:8080" } } } For stdio transport with Docker: docker run -t -e MCP_PLUGIN_CLIENT_TRANSPORT=stdio -p 8080:8080 ivanmurzakdev/unity-mcp-server Custom port example (e.g., 123): docker run -e MCP_PLUGIN_PORT=123 -p 123:123 ivanmurzakdev/unity-mcp-server Then use "url": "http://localhost:123" in config. No hosted/remote endpoint at https://ai-game.dev/mcp or similar was found; it appears to be a local/development server. The site ai-game.dev may be the project homepage, but searches did not return an active company page or official docs there.
Citations:
- 1: https://github.com/IvanMurzak/Unity-MCP
- 2: https://antigravity.codes/mcp/unity-mcp-ai-game-developer
🏁 Script executed:
# Find all references to CLOUD_SERVER_URL and cloud-related configuration
rg -i "CLOUD_SERVER_URL|ai-game\.dev|cloudServerUrl" --type ts --type js -B 2 -A 2Repository: coderabbit-test/Unity-MCP
Length of output: 2044
🏁 Script executed:
# Check the config.ts file for context around the URL and any related comments
cat -n cli/src/utils/config.ts | sed -n '160,200p'Repository: coderabbit-test/Unity-MCP
Length of output: 1274
🏁 Script executed:
# Look for environment variables or alternative URL configuration patterns
rg -i "SERVER_URL|MCP_.*URL|process\.env" --type ts --type js cli/src/ -B 1 -A 1Repository: coderabbit-test/Unity-MCP
Length of output: 1949
Verify the hardcoded cloud server URL is operational and publicly accessible.
The cloud URL is hardcoded by design (line 170), which is intentional. However, web searches indicate no public endpoint exists at https://ai-game.dev/mcp—the project uses local deployments at http://localhost:8080 by default. Confirm this endpoint is actually deployed and accessible in production. Additionally, unlike custom mode (which allows override via UNITY_MCP_HOST), there's no environment variable to override the cloud URL, making it impossible to test against staging or different cloud instances without code changes.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cli/src/utils/config.ts` around lines 170 - 171, CLOUD_SERVER_URL is
hardcoded to 'https://ai-game.dev/mcp' which may not be a reachable public
endpoint and lacks an override; verify that the endpoint is actually deployed
and publicly accessible, and modify config handling to allow an environment
override (e.g., add a CLOUD_MCP_HOST or reuse UNITY_MCP_HOST) so
CLOUD_SERVER_URL becomes configurable at runtime with a sensible default
fallback; update the code that reads CLOUD_SERVER_URL in config.ts and anywhere
it's used to prefer the env var when present.
| var isCurrentlyConfigured = _config.IsConfigured(); | ||
| if (isCurrentlyConfigured) | ||
| { | ||
| _config.Unconfigure(); | ||
| UpdateStatus(false); | ||
| onConfigured.OnNext(false); | ||
| } | ||
| else | ||
| { | ||
| var result = _config.Configure(); | ||
| UpdateStatus(result); | ||
| onConfigured.OnNext(result); | ||
| } |
There was a problem hiding this comment.
Check Unconfigure() return value to avoid UI state mismatch.
The Unconfigure() method returns bool to indicate success/failure (see TomlAiAgentConfig.Unconfigure() in the codebase), but the return value is ignored here. If unconfiguration fails, the UI will incorrectly show "Not Configured" even though the configuration may still exist.
🛠️ Suggested fix
if (isCurrentlyConfigured)
{
- _config.Unconfigure();
- UpdateStatus(false);
- onConfigured.OnNext(false);
+ var unconfigured = _config.Unconfigure();
+ if (unconfigured)
+ {
+ UpdateStatus(false);
+ onConfigured.OnNext(false);
+ }
+ // Optionally: else show error feedback
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@Unity-MCP-Plugin/Assets/root/Editor/Scripts/UI/AiAgentConfigurators/ConfigurationElements.cs`
around lines 53 - 65, When unconfiguring, check the boolean return from
_config.Unconfigure() instead of ignoring it: call var success =
_config.Unconfigure(); then call UpdateStatus(!success ? _config.IsConfigured()
: false) or simply UpdateStatus(!success) based on desired semantics and emit
onConfigured.OnNext(success) so the UI reflects the actual result; update the
block that currently calls _config.Unconfigure() to use the returned bool and
propagate it to UpdateStatus(...) and onConfigured.OnNext(...).
| NotifyChanged(Instance.unityConnectionConfig); | ||
| } | ||
| } | ||
| public static string CloudServerUrl => UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl; |
There was a problem hiding this comment.
Keep a migration path for CloudServerUrl instead of hard-removing the override.
Turning UnityMcpPluginEditor.CloudServerUrl into a get-only property is a source-breaking public API change, and it also removes any visible way for downstream code to keep using staging/self-hosted cloud endpoints. If the URL must now be fixed, keep a deprecated no-op setter for at least one release so consumers get a controlled migration instead of an immediate compile break.
🧭 Compatibility-friendly transition
-public static string CloudServerUrl => UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl;
+public static string CloudServerUrl
+{
+ get => UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl;
+ [Obsolete("Cloud server URL is fixed and can no longer be changed.", false)]
+ set => _logger.LogWarning("Ignoring deprecated CloudServerUrl setter. The cloud URL is now fixed.");
+}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| public static string CloudServerUrl => UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl; | |
| public static string CloudServerUrl | |
| { | |
| get => UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl; | |
| [Obsolete("Cloud server URL is fixed and can no longer be changed.", false)] | |
| set => _logger.LogWarning("Ignoring deprecated CloudServerUrl setter. The cloud URL is now fixed."); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Unity-MCP-Plugin/Assets/root/Editor/Scripts/UnityMcpPluginEditor.Static.cs`
at line 184, UnityMcpPluginEditor.CloudServerUrl was changed to a get-only
property causing a breaking API change; restore a setter that provides a
migration path by reintroducing a public set accessor on
UnityMcpPluginEditor.CloudServerUrl which either forwards assignments to
UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl or safely no-ops while
emitting a clear Obsolete attribute and a runtime warning (log) so downstream
consumers get a compile-time deprecation message and a runtime hint; mark the
setter with [Obsolete("...migration guidance...", false)] and ensure the getter
continues to return UnityMcpPlugin.UnityConnectionConfig.CloudServerUrl.
CodeAnt-AI Description
Unify connection/option controls, hardcode Cloud URL, and improve token privacy and copy behavior
What Changed
Impact
✅ Clearer connection mode selection in the editor✅ Fewer accidental token exposures in the UI✅ Consistent Cloud URL used by CLI and editor💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit
Release Notes
New Features
Improvements