Skip to content

Comments

Add Cline configurator and auto-select server channel#739

Merged
dsarno merged 2 commits intoCoplayDev:betafrom
dsarno:feature/cline-mcp-configurator-clean
Feb 12, 2026
Merged

Add Cline configurator and auto-select server channel#739
dsarno merged 2 commits intoCoplayDev:betafrom
dsarno:feature/cline-mcp-configurator-clean

Conversation

@dsarno
Copy link
Collaborator

@dsarno dsarno commented Feb 12, 2026

Summary

  • Adds Cline MCP client configurator with platform-specific config paths and streamableHttp transport support
  • Auto-selects prerelease server channel based on package version (replaces manual "Use Beta Server" toggle)
  • Removes UseBetaServer EditorPref, UI toggle, and related wiring
  • Cleans up deprecated useBetaServer parameter from GetBetaServerFromArgs/GetBetaServerFromArgsList thread-safe overloads

Test plan

  • All 563 EditMode tests pass (519 passed, 44 skipped)
  • All 5 PlayMode tests pass
  • Zero compilation errors after cleanup
  • Smoke tested: scene CRUD, GameObject lifecycle, materials, textures, components, resources

🤖 Generated with Claude Code

Summary by Sourcery

Auto-select MCP server prerelease channel based on the Unity package version and add first-class configuration support for the Cline client.

New Features:

  • Introduce a dedicated Cline MCP client configurator with platform-specific config paths and tailored installation guidance.
  • Support Cline's required streamableHttp transport type when generating MCP configuration JSON.

Enhancements:

  • Drive prerelease vs stable MCP server selection from the package semver prerelease tag instead of a user-controlled beta toggle.
  • Unify expected server package source resolution across clients based on installed package version and overrides, improving validation messages and consistency.
  • Update editor UI version tooltiping to reflect prerelease packages and remove obsolete beta-mode wiring.

Tests:

  • Simplify Codex configuration helper tests by removing dependencies on the deprecated beta server EditorPref.

Chores:

  • Remove the deprecated UseBetaServer EditorPref, advanced settings toggle, cached configuration value, and related argument-plumbing APIs.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Cline configurator for configuring MCP servers within Cline/VS Code integration, including platform-specific setup instructions.
  • Changes

    • Removed the "Use Beta Server" option from Advanced Settings.
    • Updated package source validation to determine prerelease packages based on installed version rather than editor preferences.

dsarno and others added 2 commits February 11, 2026 08:36
…itespace noise

- Remove deprecated `useBetaServer` parameter from GetBetaServerFromArgs/List thread-safe overloads
- Strip whitespace-only reformatting from MCPForUnityEditorWindow.cs, keeping only real changes
- Remove stale EditorPrefKeys.UseBetaServer references from CodexConfigHelperTests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 12, 2026

Reviewer's Guide

Auto-selects the MCP server prerelease channel based on the package version instead of a user-facing beta toggle, adds a dedicated Cline MCP configurator with streamableHttp support, and cleans up all UseBetaServer-related configuration, UI, and tests while wiring Cline into the existing JSON config generation pipeline.

Sequence diagram for auto-selecting MCP server prerelease channel from package version

sequenceDiagram
    participant UnityEditor
    participant AssetPathUtility
    participant EditorPrefs
    participant UvxInvoker as UvxInvokerOrConfigurator

    UnityEditor->>AssetPathUtility: GetMcpServerPackageSource()
    activate AssetPathUtility
    AssetPathUtility->>AssetPathUtility: GetPackageVersion()
    AssetPathUtility-->>UnityEditor: version string

    alt version is semver prerelease
        AssetPathUtility->>AssetPathUtility: IsSemVerPreRelease(version)
        AssetPathUtility-->>UnityEditor: true
        AssetPathUtility-->>UnityEditor: "mcpforunityserver>=0.0.0a0"
    else version is stable
        AssetPathUtility->>AssetPathUtility: IsSemVerPreRelease(version)
        AssetPathUtility-->>UnityEditor: false
        AssetPathUtility-->>UnityEditor: "mcpforunityserver==<version>"
    end
    deactivate AssetPathUtility

    UnityEditor->>AssetPathUtility: GetBetaServerFromArgs(quoteFromPath)
    activate AssetPathUtility
    AssetPathUtility->>EditorPrefs: GetString(GitUrlOverride)
    EditorPrefs-->>AssetPathUtility: gitUrlOverride
    AssetPathUtility->>AssetPathUtility: GetMcpServerPackageSource()
    AssetPathUtility-->>AssetPathUtility: packageSource

    AssetPathUtility->>AssetPathUtility: GetBetaServerFromArgs(gitUrlOverride, packageSource, quoteFromPath)
    alt gitUrlOverride is nonempty
        AssetPathUtility-->>UnityEditor: "--from <gitUrlOverride>"
    else packageSource == "mcpforunityserver>=0.0.0a0"
        AssetPathUtility-->>UnityEditor: "--prerelease explicit --from mcpforunityserver>=0.0.0a0"
    else stable package pin
        AssetPathUtility-->>UnityEditor: "--from mcpforunityserver==<version>"
    end
    deactivate AssetPathUtility

    UnityEditor->>UvxInvoker: Invoke uvx with fromArgs
Loading

Sequence diagram for generating Cline MCP config with streamableHttp transport

sequenceDiagram
    participant UnityEditor
    participant ConfigJsonBuilder
    participant EditorConfigurationCache
    participant McpClient as ClineMcpClient
    participant JObject as UnityJsonNode

    UnityEditor->>ClineMcpClient: construct via ClineConfigurator
    activate ClineMcpClient
    ClineMcpClient-->>UnityEditor: McpClient(name=Cline, paths, DefaultUnityFields)
    deactivate ClineMcpClient

    UnityEditor->>ConfigJsonBuilder: PopulateUnityNode(unity, uvPath, client=Cline)
    activate ConfigJsonBuilder
    ConfigJsonBuilder->>EditorConfigurationCache: UseHttpTransport
    EditorConfigurationCache-->>ConfigJsonBuilder: prefValue

    ConfigJsonBuilder->>ConfigJsonBuilder: clientSupportsHttp = client.SupportsHttpTransport != false
    ConfigJsonBuilder->>ConfigJsonBuilder: isCline = client.name == Cline
    ConfigJsonBuilder->>ConfigJsonBuilder: useHttpTransport = clientSupportsHttp && prefValue

    alt useHttpTransport == true
        ConfigJsonBuilder->>UnityJsonNode: set httpProperty URL
        alt client is VSCode
            ConfigJsonBuilder->>UnityJsonNode: set type = http
        else client is Cline
            ConfigJsonBuilder->>UnityJsonNode: set type = streamableHttp
        else other client
            ConfigJsonBuilder->>UnityJsonNode: set type = http
        end
    else useHttpTransport == false
        ConfigJsonBuilder->>UnityJsonNode: set stdio properties
        alt client is VSCode
            ConfigJsonBuilder->>UnityJsonNode: set type = stdio
        else client is Cline
            ConfigJsonBuilder->>UnityJsonNode: set type = stdio
        end
    end

    ConfigJsonBuilder->>ConfigJsonBuilder: if !isVSCode && client.name != Claude Code && !isCline
    ConfigJsonBuilder->>UnityJsonNode: remove type

    ConfigJsonBuilder-->>UnityEditor: updated unity node
Loading

Class diagram for new ClineConfigurator and related MCP client types

classDiagram
    class McpClient {
        string name
        string windowsConfigPath
        string macConfigPath
        string linuxConfigPath
        Dictionary~string, object~ DefaultUnityFields
    }

    class JsonFileMcpConfigurator {
        +JsonFileMcpConfigurator(mcpClient McpClient)
        +IList~string~ GetInstallationSteps()
    }

    class ClineConfigurator {
        +ClineConfigurator()
        +IList~string~ GetInstallationSteps()
    }

    class ConfigJsonBuilder {
        +PopulateUnityNode(unity JObject, uvPath string, client McpClient)
    }

    JsonFileMcpConfigurator <|-- ClineConfigurator
    JsonFileMcpConfigurator o-- McpClient
    ConfigJsonBuilder ..> McpClient : uses

    %% ClineConfigurator configuration details
    class ClineConfiguratorDetails {
        <<value_object>>
        name = Cline
        windowsConfigPath = %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
        macConfigPath = ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
        linuxConfigPath = ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
        DefaultUnityFields: disabled=false, autoApprove=[]
    }

    ClineConfiguratorDetails .. ClineConfigurator : constructs with
Loading

File-Level Changes

Change Details Files
Make server prerelease selection driven by package version rather than a UseBetaServer flag.
  • Update AssetPathUtility.GetMcpServerPackageSource to return a prerelease version range when the Unity package version is semver prerelease and add IsSemVerPreRelease helper reused by IsPreReleaseVersion.
  • Refactor GetBetaServerFromArgs/GetBetaServerFromArgsList overloads to drop the useBetaServer parameter and instead infer prerelease mode from the computed packageSource value.
  • Adjust McpClientConfiguratorBase and McpClientConfigSection helpers to derive the expected package source (including overrides and prerelease range) solely from AssetPathUtility and EditorPrefs, removing explicit beta-mode checks.
  • Update mismatch messages in configurator status checks to describe prerelease vs stable package expectations instead of referencing the 'Use Beta Server' setting.
MCPForUnity/Editor/Helpers/AssetPathUtility.cs
MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs
MCPForUnity/Editor/Windows/Components/ClientConfig/McpClientConfigSection.cs
Remove the UseBetaServer preference, cache, and UI wiring across the editor codebase and tests.
  • Delete UseBetaServer from EditorConfigurationCache (field, accessor, setter, refresh/invalidations) and its dynamic-default logic based on package version.
  • Remove the beta server toggle and callbacks from McpAdvancedSection, including UXML binding, initialization, and change events used to refresh clients and version labels.
  • Drop the UseBetaServer EditorPref key from EditorPrefKeys and from the EditorPrefsWindow type map.
  • Clean up tests that set or restore UseBetaServer in CodexConfigHelperTests, relying instead on package-version-driven prerelease behavior.
  • Simplify MCPForUnityEditorWindow version label handling to no longer accept a beta-mode parameter and to show prerelease tooltip text based on AssetPathUtility.IsPreReleaseVersion().
MCPForUnity/Editor/Services/EditorConfigurationCache.cs
MCPForUnity/Editor/Windows/Components/Advanced/McpAdvancedSection.cs
MCPForUnity/Editor/Constants/EditorPrefKeys.cs
MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs
TestProjects/UnityMCPTests/Assets/Tests/EditMode/Helpers/CodexConfigHelperTests.cs
MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs
MCPForUnity/Editor/Windows/Components/Advanced/McpAdvancedSection.uxml
Add a dedicated Cline MCP client configurator and ensure JSON config generation uses streamableHttp for Cline HTTP endpoints.
  • Introduce ClineConfigurator as a JsonFileMcpConfigurator with platform-specific VS Code settings paths and default unity fields for Cline.
  • Extend ConfigJsonBuilder.PopulateUnityNode to detect the Cline client by name and set unity.type to streamableHttp when HTTP transport is active, or stdio when using stdio.
  • Ensure type is preserved for Cline (similar to Claude Code) when generating config, instead of stripping it for non-VSCode clients.
MCPForUnity/Editor/Clients/Configurators/ClineConfigurator.cs
MCPForUnity/Editor/Helpers/ConfigJsonBuilder.cs
MCPForUnity/Editor/Clients/Configurators/ClineConfigurator.cs.meta

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

The PR introduces a new Cline MCP client configurator and removes the beta-server mode system. It eliminates the UseBetaServer editor preference throughout the codebase, replaces beta-mode-based validation with SemVer prerelease detection, updates configuration generation with Cline-specific transport types, and simplifies version validation logic.

Changes

Cohort / File(s) Summary
New Cline Configurator
MCPForUnity/Editor/Clients/Configurators/ClineConfigurator.cs, MCPForUnity/Editor/Clients/Configurators/ClineConfigurator.cs.meta
Adds ClineConfigurator class extending JsonFileMcpConfigurator with constructor initializing platform-specific config paths and GetInstallationSteps override providing five-step setup guide.
Beta Mode Removal
MCPForUnity/Editor/Constants/EditorPrefKeys.cs, MCPForUnity/Editor/Services/EditorConfigurationCache.cs, MCPForUnity/Editor/Windows/Components/Advanced/McpAdvancedSection.cs, MCPForUnity/Editor/Windows/Components/Advanced/McpAdvancedSection.uxml, MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs, TestProjects/UnityMCPTests/Assets/Tests/EditMode/Helpers/CodexConfigHelperTests.cs
Removes UseBetaServer editor preference, backing field, property, UI toggle, and related refresh/invalidate logic; eliminates beta-mode test setup/teardown code.
Prerelease Handling Refactor
MCPForUnity/Editor/Helpers/AssetPathUtility.cs, MCPForUnity/Editor/Clients/Configurators/McpClientConfiguratorBase.cs, MCPForUnity/Editor/Windows/Components/ClientConfig/McpClientConfigSection.cs
Introduces IsSemVerPreRelease helper; refactors GetBetaServerFromArgs and GetBetaServerFromArgsList signatures to accept gitUrlOverride and packageSource parameters; replaces beta-mode validation with packageSource-based prerelease detection; renames GetExpectedPackageSourceForBetaMode to GetExpectedPackageSourceForCurrentPackage.
Config Generation Updates
MCPForUnity/Editor/Helpers/ConfigJsonBuilder.cs
Adds Cline-specific transport type handling: uses "streamableHttp" for HTTP transport and preserves "stdio" for stdio transport; excludes Cline from type removal logic.
Editor Window Updates
MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs
Changes UpdateVersionLabel from accepting useBetaServer parameter to parameterless method; derives version badge tooltip from AssetPathUtility.IsPreReleaseVersion; removes OnBetaModeChanged event wiring.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~65 minutes

Possibly related PRs

Suggested reviewers

  • msanatan
  • Scriptwonder

Poem

🐰 Hops through code with care,
Beta mode fades to air,
Cline client gets its place,
Prerelease logic raced,
Configuration now more fair!

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (59 files):

⚔️ .claude/skills/unity-mcp-skill/SKILL.md (content)
⚔️ .claude/skills/unity-mcp-skill/references/tools-reference.md (content)
⚔️ .claude/skills/unity-mcp-skill/references/workflows.md (content)
⚔️ MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs (content)
⚔️ MCPForUnity/Editor/Constants/EditorPrefKeys.cs (content)
⚔️ MCPForUnity/Editor/Helpers/AssetPathUtility.cs (content)
⚔️ MCPForUnity/Editor/Helpers/ConfigJsonBuilder.cs (content)
⚔️ MCPForUnity/Editor/Helpers/HttpEndpointUtility.cs (content)
⚔️ MCPForUnity/Editor/Services/EditorConfigurationCache.cs (content)
⚔️ MCPForUnity/Editor/Services/EditorStateCache.cs (content)
⚔️ MCPForUnity/Editor/Services/HttpBridgeReloadHandler.cs (content)
⚔️ MCPForUnity/Editor/Services/ServerManagementService.cs (content)
⚔️ MCPForUnity/Editor/Services/StdioBridgeReloadHandler.cs (content)
⚔️ MCPForUnity/Editor/Services/ToolDiscoveryService.cs (content)
⚔️ MCPForUnity/Editor/Services/Transport/IMcpTransportClient.cs (content)
⚔️ MCPForUnity/Editor/Services/Transport/TransportManager.cs (content)
⚔️ MCPForUnity/Editor/Services/Transport/Transports/StdioBridgeHost.cs (content)
⚔️ MCPForUnity/Editor/Services/Transport/Transports/StdioTransportClient.cs (content)
⚔️ MCPForUnity/Editor/Services/Transport/Transports/WebSocketTransportClient.cs (content)
⚔️ MCPForUnity/Editor/Tools/BatchExecute.cs (content)
⚔️ MCPForUnity/Editor/Windows/Components/Advanced/McpAdvancedSection.cs (content)
⚔️ MCPForUnity/Editor/Windows/Components/Advanced/McpAdvancedSection.uxml (content)
⚔️ MCPForUnity/Editor/Windows/Components/ClientConfig/McpClientConfigSection.cs (content)
⚔️ MCPForUnity/Editor/Windows/Components/Tools/McpToolsSection.cs (content)
⚔️ MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs (content)
⚔️ MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs (content)
⚔️ MCPForUnity/package.json (content)
⚔️ README.md (content)
⚔️ Server/src/cli/commands/animation.py (content)
⚔️ Server/src/core/config.py (content)
⚔️ Server/src/main.py (content)
⚔️ Server/src/services/custom_tool_service.py (content)
⚔️ Server/src/services/registry/tool_registry.py (content)
⚔️ Server/src/services/resources/custom_tools.py (content)
⚔️ Server/src/services/resources/editor_state.py (content)
⚔️ Server/src/services/tools/batch_execute.py (content)
⚔️ Server/src/services/tools/debug_request_context.py (content)
⚔️ Server/src/services/tools/execute_custom_tool.py (content)
⚔️ Server/src/services/tools/find_gameobjects.py (content)
⚔️ Server/src/services/tools/find_in_file.py (content)
⚔️ Server/src/services/tools/manage_components.py (content)
⚔️ Server/src/services/tools/manage_gameobject.py (content)
⚔️ Server/src/services/tools/manage_script.py (content)
⚔️ Server/src/services/tools/manage_texture.py (content)
⚔️ Server/src/services/tools/script_apply_edits.py (content)
⚔️ Server/src/services/tools/set_active_instance.py (content)
⚔️ Server/src/services/tools/utils.py (content)
⚔️ Server/src/transport/plugin_hub.py (content)
⚔️ Server/src/transport/unity_instance_middleware.py (content)
⚔️ Server/tests/test_core_infrastructure_characterization.py (content)
⚔️ Server/tests/test_transport_characterization.py (content)
⚔️ Server/uv.lock (content)
⚔️ TestProjects/UnityMCPTests/Assets/Tests/EditMode/Helpers/CodexConfigHelperTests.cs (content)
⚔️ TestProjects/UnityMCPTests/Assets/Tests/EditMode/Services/Characterization/ServerManagementServiceCharacterizationTests.cs (content)
⚔️ docs/i18n/README-zh.md (content)
⚔️ manifest.json (content)
⚔️ unity-mcp-skill/SKILL.md (content)
⚔️ unity-mcp-skill/references/tools-reference.md (content)
⚔️ unity-mcp-skill/references/workflows.md (content)

These conflicts must be resolved before merging into beta.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly summarizes the two main changes: adding Cline configurator and auto-selecting server channel based on package version, directly reflecting the primary objectives of the PR.
Description check ✅ Passed Description follows template structure with clear Summary, Type of Change context, specific changes, comprehensive test plan results, and generated attribution note, providing sufficient context for code review.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch feature/cline-mcp-configurator-clean
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs (1)

240-248: Consider renaming IsBetaPackageSource to match the new terminology.

All mismatch messages are consistently updated to use "prerelease"/"stable" wording across the three configurator types (JsonFileMcpConfigurator, CodexMcpConfigurator, ClaudeCliMcpConfigurator). However, the method name IsBetaPackageSource still uses the old "beta" terminology while the rest of the PR adopts "prerelease." A rename to something like IsPreReleasePackageSource would align naming with the new semantics.

Also applies to: 423-431, 653-660

MCPForUnity/Editor/Helpers/AssetPathUtility.cs (1)

286-286: Extract the repeated prerelease range string into a constant.

The magic string "mcpforunityserver>=0.0.0a0" appears in at least 5 locations across this file and McpClientConfiguratorBase.cs (Line 111). A single constant would eliminate drift risk and improve readability.

♻️ Proposed constant

Add to AssetPathUtility (or a shared constants class):

internal const string PrereleasePackageRange = "mcpforunityserver>=0.0.0a0";

Then replace all occurrences, e.g.:

-            if (IsSemVerPreRelease(version))
-            {
-                return "mcpforunityserver>=0.0.0a0";
-            }
+            if (IsSemVerPreRelease(version))
+            {
+                return PrereleasePackageRange;
+            }
-            bool usePrereleaseRange = string.Equals(packageSource, "mcpforunityserver>=0.0.0a0", StringComparison.OrdinalIgnoreCase);
+            bool usePrereleaseRange = string.Equals(packageSource, PrereleasePackageRange, StringComparison.OrdinalIgnoreCase);

Also applies to: 339-339, 223-228


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • The prerelease detection in GetBetaServerFromArgs/GetBetaServerFromArgsList relies on a hard-coded comparison to "mcpforunityserver>=0.0.0a0"; consider deriving usePrereleaseRange from IsPreReleaseVersion() or a more structured check (e.g., parsing the spec) so this logic doesn’t silently break if GetMcpServerPackageSource is adjusted in the future.
  • Cline-specific behavior in ConfigJsonBuilder is keyed off client?.name == "Cline"; it would be more robust to add an explicit capability flag on McpClient (e.g., RequiresExplicitType or UseStreamableHttp) and branch on that instead of the display name string.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The prerelease detection in `GetBetaServerFromArgs`/`GetBetaServerFromArgsList` relies on a hard-coded comparison to `"mcpforunityserver>=0.0.0a0"`; consider deriving `usePrereleaseRange` from `IsPreReleaseVersion()` or a more structured check (e.g., parsing the spec) so this logic doesn’t silently break if `GetMcpServerPackageSource` is adjusted in the future.
- Cline-specific behavior in `ConfigJsonBuilder` is keyed off `client?.name == "Cline"`; it would be more robust to add an explicit capability flag on `McpClient` (e.g., `RequiresExplicitType` or `UseStreamableHttp`) and branch on that instead of the display name string.

## Individual Comments

### Comment 1
<location> `MCPForUnity/Editor/Clients/McpClientConfiguratorBase.cs:89-90` </location>
<code_context>
-            }
-
-            // Standard mode uses exact version from package.json
+            // Includes explicit override, stable pin, or prerelease range depending on package version.
             return AssetPathUtility.GetMcpServerPackageSource();
         }

</code_context>

<issue_to_address>
**issue (bug_risk):** Expected package source for validation no longer honors Git URL override, contrary to the comment.

This used to return `EditorPrefKeys.GitUrlOverride` directly, so validation matched configs using a local path or git URL. Now it always uses `GetMcpServerPackageSource()`, which appears version‑only and unaware of the git override, so projects intentionally using an override will be reported as mismatched. If validation should still honor overrides, either reintroduce the override check here or have `GetMcpServerPackageSource()` handle it. The new comment also claims explicit overrides are included, which doesn’t match the current behavior.
</issue_to_address>

### Comment 2
<location> `MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.cs:335-340` </location>
<code_context>
-                updateNotification.RemoveFromClassList("visible");
-            }
-        }
+            versionLabel.tooltip = AssetPathUtility.IsPreReleaseVersion()
+                ? $"MCP For Unity v{version} (pre-release package, using prerelease server channel)"
+                : $"MCP For Unity v{version}";
+        }
+
</code_context>

<issue_to_address>
**suggestion:** Version tooltip may imply prerelease server usage even when a Git URL override is configured.

Because the tooltip keying only off `IsPreReleaseVersion()` ignores `GitUrlOverride`, it can claim "using prerelease server channel" even when a custom URL is configured. If you want the tooltip to describe the actual server behavior, please also consider whether an override is set (or whether the resolved package source is the prerelease range) before mentioning the prerelease channel.

Suggested implementation:

```csharp
            var isPreRelease = AssetPathUtility.IsPreReleaseVersion();
            var hasGitUrlOverride = AssetPathUtility.HasGitUrlOverride();

            if (isPreRelease && !hasGitUrlOverride)
            {
                versionLabel.tooltip = $"MCP For Unity v{version} (pre-release package, using prerelease server channel)";
            }
            else if (isPreRelease)
            {
                // Pre-release package, but server channel may be overridden, so don't imply prerelease server usage
                versionLabel.tooltip = $"MCP For Unity v{version} (pre-release package)";
            }
            else
            {
                versionLabel.tooltip = $"MCP For Unity v{version}";
            }

```

If `AssetPathUtility.HasGitUrlOverride()` does not already exist, you will need to implement it (or adjust the call to match the existing API that reports whether a Git URL override is configured). The method should return `true` when a custom package source (Git URL) is in effect so that the tooltip does not mention the prerelease server channel in that case.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +89 to 90
// Includes explicit override, stable pin, or prerelease range depending on package version.
return AssetPathUtility.GetMcpServerPackageSource();
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Expected package source for validation no longer honors Git URL override, contrary to the comment.

This used to return EditorPrefKeys.GitUrlOverride directly, so validation matched configs using a local path or git URL. Now it always uses GetMcpServerPackageSource(), which appears version‑only and unaware of the git override, so projects intentionally using an override will be reported as mismatched. If validation should still honor overrides, either reintroduce the override check here or have GetMcpServerPackageSource() handle it. The new comment also claims explicit overrides are included, which doesn’t match the current behavior.

Comment on lines +335 to +340
versionLabel.tooltip = AssetPathUtility.IsPreReleaseVersion()
? $"MCP For Unity v{version} (pre-release package, using prerelease server channel)"
: $"MCP For Unity v{version}";
}
private void QueueUpdateCheck()
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Version tooltip may imply prerelease server usage even when a Git URL override is configured.

Because the tooltip keying only off IsPreReleaseVersion() ignores GitUrlOverride, it can claim "using prerelease server channel" even when a custom URL is configured. If you want the tooltip to describe the actual server behavior, please also consider whether an override is set (or whether the resolved package source is the prerelease range) before mentioning the prerelease channel.

Suggested implementation:

            var isPreRelease = AssetPathUtility.IsPreReleaseVersion();
            var hasGitUrlOverride = AssetPathUtility.HasGitUrlOverride();

            if (isPreRelease && !hasGitUrlOverride)
            {
                versionLabel.tooltip = $"MCP For Unity v{version} (pre-release package, using prerelease server channel)";
            }
            else if (isPreRelease)
            {
                // Pre-release package, but server channel may be overridden, so don't imply prerelease server usage
                versionLabel.tooltip = $"MCP For Unity v{version} (pre-release package)";
            }
            else
            {
                versionLabel.tooltip = $"MCP For Unity v{version}";
            }

If AssetPathUtility.HasGitUrlOverride() does not already exist, you will need to implement it (or adjust the call to match the existing API that reports whether a Git URL override is configured). The method should return true when a custom package source (Git URL) is in effect so that the tooltip does not mention the prerelease server channel in that case.

@dsarno dsarno merged commit 3a1a34b into CoplayDev:beta Feb 12, 2026
1 of 2 checks passed
@dsarno dsarno deleted the feature/cline-mcp-configurator-clean branch February 13, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant