From e177eb6a18e6cbd804766b96cb6dd28b27d18fc8 Mon Sep 17 00:00:00 2001 From: Nonanti Date: Sat, 3 Jan 2026 02:31:45 +0300 Subject: [PATCH 1/3] Add Cherry Studio MCP client support --- .../Configurators/CherryStudioConfigurator.cs | 96 +++++++++++++++++++ Server/uv.lock | 2 +- 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs diff --git a/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs b/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs new file mode 100644 index 000000000..acc6d8dc4 --- /dev/null +++ b/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.IO; +using MCPForUnity.Editor.Constants; +using MCPForUnity.Editor.Models; +using UnityEditor; + +namespace MCPForUnity.Editor.Clients.Configurators +{ + public class CherryStudioConfigurator : JsonFileMcpConfigurator + { + public const string ClientName = "Cherry Studio"; + + public CherryStudioConfigurator() : base(new McpClient + { + name = ClientName, + windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Cherry Studio", "config"), + macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Cherry Studio", "config"), + linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config", "Cherry Studio", "config"), + SupportsHttpTransport = false + }) + { } + + public override bool SupportsAutoConfigure => false; + + public override IList GetInstallationSteps() => new List + { + "Open Cherry Studio", + "Go to Settings (⚙️) → MCP Server", + "Click 'Add Server' button", + "For STDIO mode (recommended):", + " - Name: unity-mcp", + " - Type: STDIO", + " - Command: uvx", + " - Arguments: Copy from the Manual Configuration JSON below", + "Click Save and restart Cherry Studio", + "", + "Note: Cherry Studio uses UI-based configuration.", + "Use the manual snippet below as reference for the values to enter." + }; + + public override McpStatus CheckStatus(bool attemptAutoRewrite = true) + { + client.SetStatus(McpStatus.NotConfigured, "Cherry Studio requires manual UI configuration"); + return client.status; + } + + public override void Configure() + { + throw new InvalidOperationException( + "Cherry Studio uses UI-based configuration. " + + "Please use the Manual Configuration snippet and Installation Steps to configure manually." + ); + } + + public override string GetManualSnippet() + { + bool useHttp = EditorPrefs.GetBool(EditorPrefKeys.UseHttpTransport, true); + + 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" + + "# Note: Unity MCP does not currently have an SSE endpoint.\n" + + "# This may be added in a future update."; + } + + return base.GetManualSnippet() + "\n\n" + + "# Cherry Studio Configuration Instructions:\n" + + "# Cherry Studio uses UI-based configuration, not a JSON file.\n" + + "# \n" + + "# To configure:\n" + + "# 1. Open Cherry Studio\n" + + "# 2. Go to Settings (⚙️) → MCP Server\n" + + "# 3. Click 'Add Server'\n" + + "# 4. Enter the following values from the JSON above:\n" + + "# - Name: unity-mcp\n" + + "# - Type: STDIO\n" + + "# - Command: (copy 'command' value from JSON)\n" + + "# - Arguments: (copy 'args' array values, space-separated or as individual entries)\n" + + "# - Active: true\n" + + "# 5. Click Save\n" + + "# 6. Restart Cherry Studio"; + } + } +} diff --git a/Server/uv.lock b/Server/uv.lock index 1ed59791c..cae446ff9 100644 --- a/Server/uv.lock +++ b/Server/uv.lock @@ -809,7 +809,7 @@ wheels = [ [[package]] name = "mcpforunityserver" -version = "8.3.0" +version = "8.6.0" source = { editable = "." } dependencies = [ { name = "fastapi" }, From a6959824a8100a3ebfd1040203fca35b1c924caa Mon Sep 17 00:00:00 2001 From: Nonanti Date: Sat, 3 Jan 2026 02:48:45 +0300 Subject: [PATCH 2/3] Fix misleading message in HTTP mode for Cherry Studio --- .../Editor/Clients/Configurators/CherryStudioConfigurator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs b/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs index acc6d8dc4..eeed60e96 100644 --- a/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs +++ b/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs @@ -63,12 +63,13 @@ public override string GetManualSnippet() "# 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" + + "# Switch transport to 'Stdio' in Advanced Settings to see configuration.\n" + + "# Then configure Cherry Studio:\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" + + "# - Arguments: (provided in stdio mode)\n" + "# \n" + "# OPTION 2: SSE mode (future support)\n" + "# Note: Unity MCP does not currently have an SSE endpoint.\n" + From dbd235dabb0a02ffffb9ab8d91cf91f8f178d374 Mon Sep 17 00:00:00 2001 From: Nonanti Date: Sat, 3 Jan 2026 12:10:48 +0300 Subject: [PATCH 3/3] Address code review feedback --- .../Configurators/CherryStudioConfigurator.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs b/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs index eeed60e96..2d73829f8 100644 --- a/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs +++ b/MCPForUnity/Editor/Clients/Configurators/CherryStudioConfigurator.cs @@ -62,14 +62,10 @@ public override string GetManualSnippet() 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 to see configuration.\n" + - "# Then configure Cherry Studio:\n" + - "# - Open Cherry Studio → Settings → MCP Server → Add Server\n" + - "# - Name: unity-mcp\n" + - "# - Type: STDIO\n" + - "# - Command: uvx\n" + - "# - Arguments: (provided in stdio mode)\n" + + "# To use Cherry Studio:\n" + + "# 1. Switch transport to 'Stdio' in Advanced Settings below\n" + + "# 2. Return to this configuration screen\n" + + "# 3. Copy the STDIO configuration snippet that will appear\n" + "# \n" + "# OPTION 2: SSE mode (future support)\n" + "# Note: Unity MCP does not currently have an SSE endpoint.\n" +