Add Gemini CLI client configurator#825
Conversation
Reviewer's GuideAdds a new Gemini MCP client configurator backed by a JSON settings file and updates both English and Chinese READMEs to reflect the latest resource names and new test-related resource. Class diagram for new Gemini MCP configuratorclassDiagram
class GeminiConfigurator {
+GeminiConfigurator()
+IList~string~ GetInstallationSteps()
}
class JsonFileMcpConfigurator {
+JsonFileMcpConfigurator(McpClient client)
+IList~string~ GetInstallationSteps()
}
class McpClient {
+string name
+string windowsConfigPath
+string macConfigPath
+string linuxConfigPath
+string HttpUrlProperty
}
GeminiConfigurator --|> JsonFileMcpConfigurator
JsonFileMcpConfigurator o--> McpClient
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates documentation resource listings (replacing Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UnityEditor as "Unity Editor"
participant Configurator as "GeminiCliConfigurator"
participant GeminiCLI as "Gemini CLI"
participant MCPServer as "MCP Server"
User->>UnityEditor: add/configure Gemini MCP
UnityEditor->>Configurator: instantiate/configure McpClient (paths -> ~/.gemini/settings.json)
Configurator->>GeminiCLI: run registration command (e.g., `gemini mcp add`)
GeminiCLI->>Configurator: write/read ~/.gemini/settings.json
GeminiCLI->>MCPServer: register MCP endpoint
MCPServer-->>GeminiCLI: respond (available)
Configurator-->>UnityEditor: report installation steps/status
UnityEditor-->>User: show completion/status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
GeminiConfigurator.cs, theMCPForUnity.Editor.ConstantsandUnityEditornamespaces are imported but not used; consider removing unused usings to keep the file minimal and avoid confusion about editor dependencies.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `GeminiConfigurator.cs`, the `MCPForUnity.Editor.Constants` and `UnityEditor` namespaces are imported but not used; consider removing unused usings to keep the file minimal and avoid confusion about editor dependencies.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs (1)
15-17: Deduplicate repeated Gemini settings path construction.Lines 15-17 repeat the same
Path.Combine(...)expression; extracting this once will reduce maintenance drift.Refactor sketch
public class GeminiConfigurator : JsonFileMcpConfigurator { + private static string GeminiSettingsPath => + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gemini", "settings.json"); + public GeminiConfigurator() : base(new McpClient { name = "Gemini", - windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gemini", "settings.json"), - macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gemini", "settings.json"), - linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gemini", "settings.json"), + windowsConfigPath = GeminiSettingsPath, + macConfigPath = GeminiSettingsPath, + linuxConfigPath = GeminiSettingsPath, HttpUrlProperty = "httpUrl", }) { }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs` around lines 15 - 17, The three identical Path.Combine calls assigning windowsConfigPath, macConfigPath, and linuxConfigPath in GeminiConfigurator.cs should be deduplicated: compute the shared path once (e.g., var geminiSettingsPath or a GetGeminiSettingsPath() helper) using Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gemini", "settings.json") and then assign that single value to windowsConfigPath, macConfigPath, and linuxConfigPath to avoid repetition and maintenance drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs.meta`:
- Line 17: The AssetOrigin metadata in the GeminiConfigurator.cs.meta currently
points to the wrong asset (assetPath:
Assets/MCPForUnity/Editor/Clients/Configurators/ClaudeCodeConfigurator.cs);
update the assetPath value so it references the correct asset file name
(Assets/MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs) to
restore correct provenance metadata for the GeminiConfigurator asset.
---
Nitpick comments:
In `@MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs`:
- Around line 15-17: The three identical Path.Combine calls assigning
windowsConfigPath, macConfigPath, and linuxConfigPath in GeminiConfigurator.cs
should be deduplicated: compute the shared path once (e.g., var
geminiSettingsPath or a GetGeminiSettingsPath() helper) using
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".gemini", "settings.json") and then assign that single value to
windowsConfigPath, macConfigPath, and linuxConfigPath to avoid repetition and
maintenance drift.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.csMCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs.metaREADME.mddocs/i18n/README-zh.md
MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs.meta
Outdated
Show resolved
Hide resolved
add Gemini Configurator files and update documentation using prompt
|
Thanks for the PR and catching the active_tool readme update! Will merge this. |
Add Gemini CLI client configurator files and update README documentation using prompt.
Description
Added Gemini Configurator to editor client configurators.
Ran prompt w/ Claude to update README.md documentation.
Tested and confirmed that the 'UnityMCP' server is in Gemini MCP config and is connected. See screenshots.
Type of Change
Save your change type
Changes Made
added
GeminiConfigurator.csandGeminiConfigurator.cs.metatoMCPForUnity/Editor/Clients/Configurators/directory.Updated
README.mdandREADME-zh.mddocumentation using prompt found in./tools/UPDATE_DOCS_PROMPT.md.Testing/Screenshots/Recordings
Documentation Updates
tools/UPDATE_DOCS_PROMPT.md(recommended)tools/UPDATE_DOCS.mdRelated Issues
Implements feature request #824
Additional Notes
Summary by Sourcery
Add Gemini MCP client configurator and update documented resource list.
New Features:
Documentation:
Summary by CodeRabbit
New Features
Documentation
Chores