Skip to content

Conversation

@Nonanti
Copy link
Contributor

@Nonanti Nonanti commented Jan 2, 2026

Add Cherry Studio MCP Client Support

Summary

Adds support for Cherry Studio (Cherry AI) as an MCP client configurator.

Cherry Studio is an open-source, cross-platform desktop AI client that supports the Model Context Protocol for tool integrations.

Changes

New File

  • MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs

Updated File

  • Server/uv.lock (dependency lock file update)

Implementation Details

Cherry Studio uses UI-based configuration stored in Electron storage, not a directly editable JSON config file. Therefore:

  • SupportsAutoConfigure is set to false
  • Manual configuration provides instructions for UI-based setup
  • Supports STDIO transport mode (working)
  • SSE transport mode is documented but not yet implemented (requires Unity MCP SSE endpoint)

The configurator extends JsonFileMcpConfigurator and follows the same pattern as existing clients like Cursor and Windsurf.

Configuration

Users configure Cherry Studio through its UI:

  1. Settings → MCP Server → Add Server
  2. Enter the values from the manual configuration snippet
  3. Save and restart Cherry Studio

Example MCP Configuration for Cherry Studio

{
  "mcpServers": {
    "unityMCP": {
      "name": "unity-mcp",
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/CoplayDev/unity-mcp.git#subdirectory=Server",
        "mcp-for-unity",
        "--transport",
        "stdio"
      ],
      "isActive": true,
      "description": "Unity Editor MCP integration"
    }
  }
}

Testing

Tested on:

  • Ubuntu 22.04
  • Unity Editor 2021.3+
  • Cherry Studio v1.7.8

Verified:

  • Client appears in dropdown
  • Manual configuration generates correctly
  • Installation steps display properly
  • STDIO connection works with Unity Editor

Compatibility

No breaking changes. The new configurator is automatically discovered via Unity's TypeCache system. All existing functionality remains unchanged.

Related Issues

  Closes #492 

Summary by Sourcery

Add a new MCP client configurator for Cherry Studio and update server dependencies.

New Features:

  • Introduce a Cherry Studio MCP client configurator integrated into the Unity MCP client system for manual UI-based configuration using STDIO transport.

Enhancements:

  • Update the server uv.lock file to align dependency lock state with the new configuration support.

Summary by CodeRabbit

  • New Features
    • Cherry Studio is now available as an MCP client option in the editor.
    • Manual UI-based configuration is required; automatic configuration is not supported.
    • In-app, step-by-step configuration instructions and a manual setup snippet are provided.
    • Supports STDIO transport today; additional transports planned for future releases.
  • Bug Fixes
    • HTTP transport option is disabled for this client.

✏️ Tip: You can customize this high-level summary in your review settings.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 2, 2026

Reviewer's Guide

Adds a new Cherry Studio MCP client configurator that follows the existing JsonFileMcpConfigurator pattern but is explicitly UI/manual-only (no auto-config), plus a uv.lock refresh, enabling Unity MCP to be configured for Cherry Studio via STDIO with clear manual instructions and future SSE notes.

Sequence diagram for manual Cherry Studio MCP configuration flow

sequenceDiagram
    actor UnityDeveloper
    participant UnityEditor
    participant CherryStudioConfigurator
    participant CherryStudioApp
    participant UnityMcpServer

    UnityDeveloper->>UnityEditor: Open MCP settings
    UnityEditor->>CherryStudioConfigurator: GetInstallationSteps()
    CherryStudioConfigurator-->>UnityEditor: Installation steps list
    UnityEditor->>CherryStudioConfigurator: GetManualSnippet()
    CherryStudioConfigurator-->>UnityEditor: Manual JSON snippet and UI instructions
    UnityEditor-->>UnityDeveloper: Display Cherry Studio instructions

    UnityDeveloper->>CherryStudioApp: Open Settings MCP Server Add Server
    UnityDeveloper->>CherryStudioApp: Enter STDIO config (unity-mcp, uvx, args)
    UnityDeveloper->>CherryStudioApp: Save and restart

    UnityDeveloper->>UnityMcpServer: Start server using uvx mcp-for-unity --transport stdio
    CherryStudioApp->>UnityMcpServer: Connect via STDIO
    UnityMcpServer-->>CherryStudioApp: Respond to MCP requests
Loading

Class diagram for CherryStudioConfigurator integration

classDiagram
    direction LR

    class JsonFileMcpConfigurator {
        <<abstract>>
        - McpClient client
        + JsonFileMcpConfigurator(McpClient client)
        + bool SupportsAutoConfigure
        + IList~string~ GetInstallationSteps()
        + McpStatus CheckStatus(bool attemptAutoRewrite)
        + void Configure()
        + string GetManualSnippet()
    }

    class CherryStudioConfigurator {
        + const string ClientName
        + CherryStudioConfigurator()
        + bool SupportsAutoConfigure
        + IList~string~ GetInstallationSteps()
        + McpStatus CheckStatus(bool attemptAutoRewrite)
        + void Configure()
        + string GetManualSnippet()
    }

    class McpClient {
        + string name
        + string windowsConfigPath
        + string macConfigPath
        + string linuxConfigPath
        + bool SupportsHttpTransport
        + McpStatus status
        + void SetStatus(McpStatus status,string message)
    }

    class McpStatus {
        <<enumeration>>
        NotConfigured
        Configured
        Error
    }

    class EditorPrefs {
        + static bool GetBool(string key,bool defaultValue)
    }

    class EditorPrefKeys {
        + static string UseHttpTransport
    }

    JsonFileMcpConfigurator <|-- CherryStudioConfigurator
    CherryStudioConfigurator o-- McpClient
    JsonFileMcpConfigurator o-- McpClient
    McpClient --> McpStatus
    CherryStudioConfigurator ..> EditorPrefs
    CherryStudioConfigurator ..> EditorPrefKeys
Loading

File-Level Changes

Change Details Files
Introduce Cherry Studio MCP configurator implementing manual, UI-driven setup and STDIO-focused configuration behavior.
  • Add CherryStudioConfigurator deriving from JsonFileMcpConfigurator and wiring platform-specific config paths and client metadata
  • Disable auto-configure and make Configure() throw with guidance to use manual/UI configuration instead
  • Implement GetInstallationSteps() with step-by-step Cherry Studio UI instructions for adding an MCP server using STDIO
  • Override CheckStatus() to always report NotConfigured with an explanatory message about manual setup
  • Customize GetManualSnippet() to branch on HTTP vs STDIO usage, document lack of WebSocket/SSE support, and provide Cherry-Studio-specific configuration notes that build on the base JSON snippet
MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs
Refresh uv.lock to align dependency lock state with current environment/tooling.
  • Update uv.lock lockfile contents to reflect the latest resolved dependencies or tool versions
Server/uv.lock

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 Jan 2, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds a new CherryStudioConfigurator class that registers Cherry Studio as an MCP client, sets platform-specific JSON config paths, disables HTTP transport, and enforces manual UI-based configuration with installation steps and a manual configuration snippet.

Changes

Cohort / File(s) Summary
Cherry Studio Configurator
MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs
New public class CherryStudioConfigurator (extends JsonFileMcpConfigurator). Introduces ClientName = "Cherry Studio", config file locations for Windows/macOS/Linux, sets SupportsHttpTransport = false, overrides SupportsAutoConfigure (false), GetInstallationSteps(), CheckStatus(...) (returns NotConfigured with manual UI message), Configure() (throws InvalidOperationException), and GetManualSnippet() (generates manual JSON/STDIO setup instructions).

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • msanatan

Poem

🐰
I nibble paths on Windows, Mac, and Linux way,
Cherry Studio arrives to brighten the day.
No HTTP dance — manual steps to pursue,
Configure in the UI, a blossom for you. 🌸

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Cherry Studio as a new MCP client support with no extraneous details.
Linked Issues check ✅ Passed The PR successfully fulfills issue #492 by implementing Cherry Studio MCP configurator support, enabling users to configure and connect to Unity MCP server.
Out of Scope Changes check ✅ Passed All code changes are scoped to Cherry Studio MCP configurator implementation and dependency management; no unrelated modifications detected.
✨ Finishing touches
  • 📝 Generate docstrings

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.

@Nonanti
Copy link
Contributor Author

Nonanti commented Jan 2, 2026

CherryImage Unityimage

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 1 issue, and left some high level feedback:

  • On macOS and Linux, the config paths are built from Environment.SpecialFolder.UserProfile; consider using the platform’s application data folder (Environment.SpecialFolder.ApplicationData or equivalent) to avoid issues on systems where the config directory is not directly under the home directory.
  • When UseHttpTransport is enabled, GetManualSnippet only returns commentary about unsupported transports without a concrete configuration snippet; consider explicitly instructing the user to switch off HTTP/WS in settings and then appending the stdio snippet so they still see a usable example.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- On macOS and Linux, the config paths are built from `Environment.SpecialFolder.UserProfile`; consider using the platform’s application data folder (`Environment.SpecialFolder.ApplicationData` or equivalent) to avoid issues on systems where the config directory is not directly under the home directory.
- When `UseHttpTransport` is enabled, `GetManualSnippet` only returns commentary about unsupported transports without a concrete configuration snippet; consider explicitly instructing the user to switch off HTTP/WS in settings and then appending the stdio snippet so they still see a usable example.

## Individual Comments

### Comment 1
<location> `MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs:62-71` </location>
<code_context>
+
+            if (useHttp)
+            {
+                return "# Cherry Studio does not support WebSocket transport.\n" +
+                       "# Cherry Studio supports STDIO and SSE transports.\n" +
+                       "# \n" +
+                       "# OPTION 1: Use STDIO mode (recommended)\n" +
+                       "# Switch transport to 'Stdio' in Advanced Settings, then:\n" +
+                       "# - Open Cherry Studio → Settings → MCP Server → Add Server\n" +
+                       "# - Name: unity-mcp\n" +
+                       "# - Type: STDIO\n" +
+                       "# - Command: uvx\n" +
+                       "# - Arguments: (see stdio snippet below)\n" +
+                       "# \n" +
+                       "# OPTION 2: SSE mode (future support)\n" +
</code_context>

<issue_to_address>
**issue (bug_risk):** The HTTP branch mentions a STDIO snippet "below" but never actually returns one.

In the `useHttp` branch, this string returns immediately after `"# - Arguments: (see stdio snippet below)"`, but there is no actual STDIO snippet or concrete command/args included for HTTP users.

This will show HTTP users guidance that references a non-existent snippet. Please either:
- Include the actual STDIO snippet here (e.g., via a shared helper), or
- Remove the “snippet below” reference and explicitly describe how to switch to STDIO and which arguments to use.
</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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs (1)

42-46: Consider suppressing the unused parameter warning.

The attemptAutoRewrite parameter is unused, which is expected since auto-configuration isn't supported. Consider adding a discard or pragma to explicitly acknowledge this:

🔎 Suggested approach
 public override McpStatus CheckStatus(bool attemptAutoRewrite = true)
 {
+    _ = attemptAutoRewrite; // Not used - manual configuration only
     client.SetStatus(McpStatus.NotConfigured, "Cherry Studio requires manual UI configuration");
     return client.status;
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 191b730 and e177eb6.

⛔ Files ignored due to path filters (1)
  • Server/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-29T15:23:11.613Z
Learnt from: msanatan
Repo: CoplayDev/unity-mcp PR: 491
File: MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs:78-115
Timestamp: 2025-12-29T15:23:11.613Z
Learning: In MCPForUnity, prefer relying on the established testing process to catch UI initialization issues instead of adding defensive null checks for UI elements in editor windows. This means during reviews, verify that tests cover UI initialization paths and that code avoids repetitive null-check boilerplate in Editor Windows. If a UI element can be null, ensure there is a well-tested fallback or that its initialization is guaranteed by design, rather than sprinkling null checks throughout editor code.

Applied to files:

  • MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs
🧬 Code graph analysis (1)
MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs (2)
MCPForUnity/Editor/Models/McpClient.cs (2)
  • McpClient (5-55)
  • SetStatus (42-54)
MCPForUnity/Editor/Constants/EditorPrefKeys.cs (1)
  • EditorPrefKeys (7-56)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review
🔇 Additional comments (7)
MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs (7)

1-9: LGTM!

Imports are appropriate and all appear to be used. Namespace follows the project's established structure.


10-12: LGTM!

Class declaration follows the established pattern of other configurators in the codebase.


24-24: LGTM!

Correctly disables auto-configuration, which is appropriate for Cherry Studio's UI-based configuration model.


26-40: LGTM!

Clear installation steps that effectively guide users through Cherry Studio's UI-based configuration. The reference to the manual snippet for argument values is helpful.


48-54: LGTM!

Throwing InvalidOperationException is appropriate here to prevent accidental auto-configuration attempts. The error message clearly directs users to the manual configuration approach.


56-94: LGTM with a clarity note.

The conditional logic is sound: when the user has HTTP transport enabled but Cherry Studio doesn't support WebSocket, it helpfully explains the alternatives. When in STDIO mode, it provides the base snippet with Cherry Studio-specific UI instructions.

One observation: the comment on line 74 mentions "SSE mode (future support)" which may set user expectations for a feature that doesn't exist yet. Consider whether this should be omitted until SSE is actually implemented, or clarify it's a client capability not currently usable with Unity MCP.


14-22: The config paths are unused and do not require changes.

CherryStudioConfigurator completely overrides CheckStatus() to return NotConfigured without consulting any config paths. The paths exist in the McpClient but are never accessed—the Configure() method throws InvalidOperationException and manual UI configuration is enforced. The extensionless "config" filename is inconsistent with other configurators but has no practical impact since auto-configuration is disabled.

Note: Using Environment.SpecialFolder.LocalApplicationData on macOS for application support files is incorrect; the current pattern (UserProfile + Library/Application Support) follows standard macOS conventions and matches all other configurators in the codebase.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs (1)

87-87: Consider clarifying args array handling.

The instruction "(copy 'args' array values, space-separated or as individual entries)" covers multiple possibilities but might be clearer if it specified Cherry Studio's expected format. However, since the PR description confirms this has been tested and working, the current wording is likely sufficient for users familiar with Cherry Studio's UI.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a695982 and dbd235d.

📒 Files selected for processing (1)
  • MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-29T15:23:11.613Z
Learnt from: msanatan
Repo: CoplayDev/unity-mcp PR: 491
File: MCPForUnity/Editor/Windows/EditorPrefs/EditorPrefsWindow.cs:78-115
Timestamp: 2025-12-29T15:23:11.613Z
Learning: In MCPForUnity, prefer relying on the established testing process to catch UI initialization issues instead of adding defensive null checks for UI elements in editor windows. This means during reviews, verify that tests cover UI initialization paths and that code avoids repetitive null-check boilerplate in Editor Windows. If a UI element can be null, ensure there is a well-tested fallback or that its initialization is guaranteed by design, rather than sprinkling null checks throughout editor code.

Applied to files:

  • MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs
🧬 Code graph analysis (1)
MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs (2)
MCPForUnity/Editor/Models/McpClient.cs (2)
  • McpClient (5-55)
  • SetStatus (42-54)
MCPForUnity/Editor/Constants/EditorPrefKeys.cs (1)
  • EditorPrefKeys (7-56)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review
🔇 Additional comments (6)
MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs (6)

1-9: LGTM!

Imports and namespace declaration are appropriate and follow project conventions.


10-22: LGTM!

The constructor correctly configures Cherry Studio with platform-specific paths following Electron app conventions and appropriately disables HTTP transport. The use of JsonFileMcpConfigurator as the base class makes sense for leveraging its JSON generation capabilities even though Cherry Studio uses UI-based configuration.


24-40: Clear installation guidance for UI-based configuration.

The installation steps are well-structured and guide users through Cherry Studio's manual UI configuration process. The note at the end appropriately sets expectations about the UI-based nature of the configuration.


42-46: Appropriate status handling for manual-only configuration.

The CheckStatus method correctly returns NotConfigured with a clear message, which is consistent with the manual-configuration-only design of Cherry Studio integration.


48-54: LGTM!

The Configure method appropriately throws an exception with a clear message directing users to the manual configuration process, which is the correct behavior for a client that doesn't support auto-configuration.


56-91: Well-structured manual configuration guidance.

The GetManualSnippet method effectively handles both HTTP and STDIO transport modes, providing clear guidance for users to switch to the supported STDIO transport when needed, and generating helpful manual configuration instructions that map the JSON structure to Cherry Studio's UI fields.

The HTTP branch correctly addresses the past review feedback by clearly stating that the STDIO snippet "will appear" after switching modes, avoiding the previous reference to a non-existent snippet.

@Scriptwonder
Copy link
Collaborator

Scriptwonder commented Jan 4, 2026

Thanks for the PR! The attached screenshot and the formatted script are definitely helpful.

@Scriptwonder Scriptwonder merged commit 46b844a into CoplayDev:main Jan 4, 2026
2 checks passed
@Scriptwonder Scriptwonder mentioned this pull request Jan 4, 2026
@msanatan
Copy link
Member

msanatan commented Jan 6, 2026

If it hasn't been done already, someone should add the .meta file for CherryStudioConfigurator.cs‎. Be sure to include them in future PRs @Nonanti 🙂

@Nonanti
Copy link
Contributor Author

Nonanti commented Jan 6, 2026

@msanatan
Oh sorry my bad. I will fix it.

@Scriptwonder
Copy link
Collaborator

I already fixed it in the main repo a few days ago, so just be sure to include them in future PRs - my negligence!

@msanatan
Copy link
Member

msanatan commented Jan 6, 2026

@Nonanti no stress! It's just for the future, I know you're keen to contribute more 🙂

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.

3 participants