Skip to content

Add Gemini CLI client configurator#825

Merged
Scriptwonder merged 4 commits intoCoplayDev:betafrom
sergeiwallace:beta
Feb 26, 2026
Merged

Add Gemini CLI client configurator#825
Scriptwonder merged 4 commits intoCoplayDev:betafrom
sergeiwallace:beta

Conversation

@sergeiwallace
Copy link
Contributor

@sergeiwallace sergeiwallace commented Feb 24, 2026

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

  • New feature (non-breaking change that adds functionality)
  • Documentation update

Changes Made

added GeminiConfigurator.cs and GeminiConfigurator.cs.meta to MCPForUnity/Editor/Clients/Configurators/ directory.

Updated README.md and README-zh.md documentation using prompt found in ./tools/UPDATE_DOCS_PROMPT.md.

Testing/Screenshots/Recordings

Screenshot 2026-02-24 at 6 16 16 PM Screenshot 2026-02-24 at 6 15 45 PM

Documentation Updates

  • I have added/removed/modified tools or resources
  • If yes, I have updated all documentation files using:
    • The LLM prompt at tools/UPDATE_DOCS_PROMPT.md (recommended)
    • Manual updates following the guide at tools/UPDATE_DOCS.md

Related Issues

Implements feature request #824

Additional Notes

Summary by Sourcery

Add Gemini MCP client configurator and update documented resource list.

New Features:

  • Introduce a Gemini MCP configurator that reads CLI settings from the user's home directory and registers the UnityMCP server.

Documentation:

  • Update English and Chinese READMEs to reflect the current set of available MCP resources, including new editor and test resources.

Summary by CodeRabbit

  • New Features

    • Added a Gemini configurator with installation and registration guidance.
  • Documentation

    • Updated available resources: replaced active_tool with editor_active_tool and added get_tests_for_mode (applied to main and localized docs).
  • Chores

    • Added editor asset metadata for the new configurator.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 24, 2026

Reviewer's Guide

Adds 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 configurator

classDiagram
    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
Loading

File-Level Changes

Change Details Files
Introduce a Gemini MCP configurator that reads connection settings from the Gemini CLI JSON config and exposes install/uninstall guidance in the Unity editor.
  • Create a GeminiConfigurator class deriving from JsonFileMcpConfigurator for the Gemini MCP client.
  • Configure OS-specific config paths to use ~/.gemini/settings.json across Windows, macOS, and Linux and map the HTTP URL to the 'httpUrl' JSON property.
  • Provide editor-facing installation steps guiding users through installing Gemini CLI and registering/unregistering UnityMCP via 'gemini mcp add/remove'.
MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs
MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs.meta
Refresh documentation for available MCP resources in both English and Chinese READMEs.
  • Replace the deprecated 'active_tool' resource name with 'editor_active_tool' and add the new 'get_tests_for_mode' resource to the documented list of available resources in README.md.
  • Mirror the same resource list updates in the Chinese localized documentation at docs/i18n/README-zh.md.
README.md
docs/i18n/README-zh.md

Possibly linked issues


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 Feb 24, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4067fe4 and 5ef5178.

📒 Files selected for processing (2)
  • MCPForUnity/Editor/Clients/Configurators/GeminiCliConfigurator.cs
  • MCPForUnity/Editor/Clients/Configurators/GeminiCliConfigurator.cs.meta

📝 Walkthrough

Walkthrough

This PR updates documentation resource listings (replacing active_tool with editor_active_tool and adding get_tests_for_mode) and adds a new Unity editor configurator class GeminiCliConfigurator (plus its Unity .meta file) to integrate Gemini CLI MCP via a JSON config file.

Changes

Cohort / File(s) Summary
Documentation
README.md, docs/i18n/README-zh.md
Replaced active_tool with editor_active_tool and added get_tests_for_mode in the "Available Resources" lists.
Gemini CLI Configurator
MCPForUnity/Editor/Clients/Configurators/GeminiCliConfigurator.cs
Added GeminiCliConfigurator : JsonFileMcpConfigurator with constructor initializing an McpClient (paths pointing to user home .gemini/settings.json) and an overridden GetInstallationSteps() describing install/register/unregister steps.
Unity metadata
MCPForUnity/Editor/Clients/Configurators/GeminiCliConfigurator.cs.meta
Added Unity .meta file for the new configurator asset (editor metadata only).

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #825: Adds a Gemini CLI MCP configurator implementation in the same configurators directory (very closely related).
  • #641: Adds another JsonFileMcpConfigurator subclass with a similar constructor and GetInstallationSteps() override.
  • #608: Adds MCP client configurator implementations under MCPForUnity.Editor.Clients.Configurators handling JSON-based CLI config files.

Suggested labels

codex

Suggested reviewers

  • msanatan

Poem

🐰 A tiny hop, a config found,
~/.gemini now makes a sound,
Docs renamed so tests can play,
A new configurator leads the way,
Pocket carrots and MCP hooray! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Gemini CLI client configurator' directly and clearly summarizes the primary change: adding a new Gemini configurator class to the editor client configurators.
Description check ✅ Passed The pull request description is comprehensive and follows the template well, including all major sections: clear description, type of change selection, specific changes made, testing/screenshots, documentation update confirmation, related issues reference, and additional notes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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 left some high level feedback:

  • 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.
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.

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.

@sergeiwallace sergeiwallace changed the title add Gemini Configurator & update README add Gemini Configurator Feb 24, 2026
@sergeiwallace sergeiwallace changed the title add Gemini Configurator Add Gemini client configurator Feb 24, 2026
@sergeiwallace sergeiwallace changed the title Add Gemini client configurator Add Gemini CLI client configurator Feb 24, 2026
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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between ca3f7bd and e4eec19.

📒 Files selected for processing (4)
  • MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs
  • MCPForUnity/Editor/Clients/Configurators/GeminiConfigurator.cs.meta
  • README.md
  • docs/i18n/README-zh.md

add Gemini Configurator files and update documentation using prompt
@Scriptwonder
Copy link
Collaborator

Thanks for the PR and catching the active_tool readme update! Will merge this.

@Scriptwonder Scriptwonder merged commit 86d34d1 into CoplayDev:beta Feb 26, 2026
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.

2 participants