Skip to content

Conversation

@msanatan
Copy link
Contributor

@msanatan msanatan commented Dec 19, 2025

It wasn't used, and this should help make startup slightly faster

Summary by Sourcery

Remove unused MCP distribution configuration and default remote URL handling, falling back to a fixed local endpoint instead.

Enhancements:

  • Standardize HTTP and WebSocket default base URL to a hardcoded local endpoint when no preference is set.

Chores:

  • Delete the unused McpDistributionSettings ScriptableObject and related editor configuration references.

It was for safety as some were AI generated before. Only minor changes were made
Removes the McpDistributionSettings system that allowed different defaults for Asset Store vs git distributions. Hardcodes the default HTTP base URL to "http://localhost:8080" directly in HttpEndpointUtility and WebSocketTransportClient. Removes the setup window skip logic for remote defaults.

It didn't work in practice, best thing to do is replace the placeholder in the UXML
@msanatan msanatan self-assigned this Dec 19, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 19, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removes the unused MCP distribution settings ScriptableObject and inlined its behavior by hardcoding the localhost default HTTP base URL and always showing the setup window when needed, simplifying configuration logic and dependencies.

Sequence diagram for the simplified setup window display logic

sequenceDiagram
    actor Developer
    participant SetupWindowService
    participant EditorPrefs
    participant SetupWindow

    Developer->>SetupWindowService: CheckSetupNeeded()
    SetupWindowService->>EditorPrefs: GetBool(SETUP_COMPLETED_KEY)
    EditorPrefs-->>SetupWindowService: setupCompleted
    SetupWindowService->>EditorPrefs: GetBool(SETUP_DISMISSED_KEY)
    EditorPrefs-->>SetupWindowService: setupDismissed

    alt setup not completed or dismissed
        SetupWindowService->>SetupWindow: Open()
        SetupWindow-->>Developer: Display setup UI
    else setup completed or dismissed
        SetupWindowService-->>Developer: Do not show setup UI
    end
Loading

Class diagram for HTTP endpoint utilities and WebSocket transport client after removing distribution settings

classDiagram
    class HttpEndpointUtility {
        <<static>>
        const string PrefKey
        const string DefaultBaseUrl
    }

    class WebSocketTransportClient {
        +BuildWebSocketUri(string baseUrl) Uri
    }

    HttpEndpointUtility <.. WebSocketTransportClient : uses DefaultBaseUrl
Loading

File-Level Changes

Change Details Files
Remove distribution-based conditional skipping of the setup window so it only depends on editor prefs.
  • Deleted use of EditorPrefKeys.HttpBaseUrl as a guard for user overrides when deciding to show the setup window
  • Removed conditional branch that skipped the setup window based on McpDistribution settings and remote default URL flags
  • Dropped the MCPForUnity.Editor.Config namespace import from the setup window service
MCPForUnity/Editor/Setup/SetupWindowService.cs
Inline the default HTTP base URL as a localhost constant instead of reading it from distribution settings.
  • Replaced DefaultBaseUrl property that read from McpDistribution.Settings with a const string set to "http://localhost:8080"
  • Removed the MCPForUnity.Editor.Config namespace import from the HTTP endpoint utility
MCPForUnity/Editor/Helpers/HttpEndpointUtility.cs
Use a hardcoded localhost base URL when building WebSocket URIs instead of reading from distribution settings.
  • Replaced fallback base URL in BuildWebSocketUri to use "http://localhost:8080" when the provided baseUrl is null or whitespace
  • Removed the MCPForUnity.Editor.Config namespace import from the WebSocket transport client
MCPForUnity/Editor/Services/Transport/Transports/WebSocketTransportClient.cs
Remove the unused MCP distribution settings ScriptableObject and its folder.
  • Deleted McpDistributionSettings ScriptableObject definition and its .meta file
  • Deleted the now-empty Editor/Config folder meta
MCPForUnity/Editor/Config.meta
MCPForUnity/Editor/Config/McpDistributionSettings.cs
MCPForUnity/Editor/Config/McpDistributionSettings.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 Dec 19, 2025

Warning

Rate limit exceeded

@msanatan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e35ef22 and aae3565.

📒 Files selected for processing (6)
  • MCPForUnity/Editor/Config.meta (0 hunks)
  • MCPForUnity/Editor/Config/McpDistributionSettings.cs (0 hunks)
  • MCPForUnity/Editor/Config/McpDistributionSettings.cs.meta (0 hunks)
  • MCPForUnity/Editor/Helpers/HttpEndpointUtility.cs (1 hunks)
  • MCPForUnity/Editor/Services/Transport/Transports/WebSocketTransportClient.cs (1 hunks)
  • MCPForUnity/Editor/Setup/SetupWindowService.cs (0 hunks)
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 left some high level feedback:

  • The default HTTP base URL is now hardcoded as "http://localhost:8080" in multiple places; consider centralizing this in a single constant or helper to avoid duplication and reduce the chance of divergence.
  • Removing the McpDistribution.Settings.skipSetupWindowWhenRemoteDefault logic changes behavior for remote/hosted distributions by always showing the setup window; double-check that this behavior change is desired for all distributions.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The default HTTP base URL is now hardcoded as "http://localhost:8080" in multiple places; consider centralizing this in a single constant or helper to avoid duplication and reduce the chance of divergence.
- Removing the `McpDistribution.Settings.skipSetupWindowWhenRemoteDefault` logic changes behavior for remote/hosted distributions by always showing the setup window; double-check that this behavior change is desired for all distributions.

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.

@msanatan msanatan merged commit 7a99ae1 into CoplayDev:main Dec 19, 2025
2 checks passed
@msanatan msanatan deleted the remove-config-file branch December 19, 2025 23:11
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