Skip to content

Commit 53c0ed2

Browse files
authored
Refactor ClaudeCodeConfigurator to use JsonFileMcpConfigurator (CoplayDev#545)
The old CLI file map does not seem to work for the latest CC(V2.1.4), with errors that cannot recognize any symbols after uvx.exe, whether it be --no-cache, --refresh, or --from. I did not find any documentation change of why this cannot use. I temporarily revert the current Claude Code registration to the old JSON way, which still works. Will look for a fix that could retain the CLI command usage.
1 parent f2d56cf commit 53c0ed2

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1+
using System;
12
using System.Collections.Generic;
3+
using System.IO;
24
using MCPForUnity.Editor.Models;
35

46
namespace MCPForUnity.Editor.Clients.Configurators
57
{
6-
public class ClaudeCodeConfigurator : ClaudeCliMcpConfigurator
8+
public class ClaudeCodeConfigurator : JsonFileMcpConfigurator
79
{
810
public ClaudeCodeConfigurator() : base(new McpClient
911
{
1012
name = "Claude Code",
11-
windowsConfigPath = string.Empty,
12-
macConfigPath = string.Empty,
13-
linuxConfigPath = string.Empty,
13+
windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".claude.json"),
14+
macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".claude.json"),
15+
linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".claude.json"),
16+
SupportsHttpTransport = true,
17+
HttpUrlProperty = "url", // Claude Code uses "url" for HTTP servers
18+
IsVsCodeLayout = false, // Claude Code uses standard mcpServers layout
1419
})
1520
{ }
1621

1722
public override IList<string> GetInstallationSteps() => new List<string>
1823
{
19-
"Ensure Claude CLI is installed",
20-
"Use the Register button to register automatically\nOR manually run: claude mcp add UnityMCP",
21-
"Restart Claude Code"
24+
"Open your project in Claude Code",
25+
"Click Configure in MCP for Unity (or manually edit ~/.claude.json)",
26+
"The MCP server will be added to the global mcpServers section",
27+
"Restart Claude Code to apply changes"
2228
};
2329
}
2430
}

0 commit comments

Comments
 (0)