-
Notifications
You must be signed in to change notification settings - Fork 628
Refactor ClaudeCodeConfigurator to use JsonFileMcpConfigurator #545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+13
−7
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 13 additions & 7 deletions
20
MCPForUnity/Editor/Clients/Configurators/ClaudeCodeConfigurator.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,30 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using MCPForUnity.Editor.Models; | ||
|
|
||
| namespace MCPForUnity.Editor.Clients.Configurators | ||
| { | ||
| public class ClaudeCodeConfigurator : ClaudeCliMcpConfigurator | ||
| public class ClaudeCodeConfigurator : JsonFileMcpConfigurator | ||
| { | ||
| public ClaudeCodeConfigurator() : base(new McpClient | ||
| { | ||
| name = "Claude Code", | ||
| windowsConfigPath = string.Empty, | ||
| macConfigPath = string.Empty, | ||
| linuxConfigPath = string.Empty, | ||
| windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".claude.json"), | ||
| macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".claude.json"), | ||
| linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".claude.json"), | ||
| SupportsHttpTransport = true, | ||
| HttpUrlProperty = "url", // Claude Code uses "url" for HTTP servers | ||
| IsVsCodeLayout = false, // Claude Code uses standard mcpServers layout | ||
| }) | ||
| { } | ||
|
|
||
| public override IList<string> GetInstallationSteps() => new List<string> | ||
| { | ||
| "Ensure Claude CLI is installed", | ||
| "Use the Register button to register automatically\nOR manually run: claude mcp add UnityMCP", | ||
| "Restart Claude Code" | ||
| "Open your project in Claude Code", | ||
| "Click Configure in MCP for Unity (or manually edit ~/.claude.json)", | ||
| "The MCP server will be added to the global mcpServers section", | ||
| "Restart Claude Code to apply changes" | ||
| }; | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installation steps: clarify whether “Configure” happens in Unity vs Claude Code (ordering reads ambiguous).
As written, “Open your project in Claude Code” followed by “Click Configure in MCP for Unity” could confuse users about where that button exists. Consider making Unity vs Claude Code explicit.
Proposed diff
public override IList<string> GetInstallationSteps() => new List<string> { - "Open your project in Claude Code", - "Click Configure in MCP for Unity (or manually edit ~/.claude.json)", + "In Unity: open MCP for Unity and click Configure (or manually edit ~/.claude.json)", + "In Claude Code: open your project", "The MCP server will be added to the global mcpServers section", "Restart Claude Code to apply changes" };📝 Committable suggestion
🤖 Prompt for AI Agents