Skip to content

Commit 86d34d1

Browse files
Add Gemini CLI client configurator (#825)
* add Gemini Configurator & update README add Gemini Configurator files and update documentation using prompt * Rename GeminiConfigurator to GeminiCliConfigurator * Add GeminiCliConfigurator.cs.meta file * Update asset path for GeminiCliConfigurator --------- Co-authored-by: Shutong Wu <51266340+Scriptwonder@users.noreply.github.com>
1 parent ca3f7bd commit 86d34d1

4 files changed

Lines changed: 50 additions & 2 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using MCPForUnity.Editor.Constants;
5+
using MCPForUnity.Editor.Models;
6+
using UnityEditor;
7+
8+
namespace MCPForUnity.Editor.Clients.Configurators
9+
{
10+
public class GeminiCliConfigurator : JsonFileMcpConfigurator
11+
{
12+
public GeminiConfigurator() : base(new McpClient
13+
{
14+
name = "Gemini CLI",
15+
windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gemini", "settings.json"),
16+
macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gemini", "settings.json"),
17+
linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gemini", "settings.json"),
18+
HttpUrlProperty = "httpUrl",
19+
})
20+
{ }
21+
22+
public override IList<string> GetInstallationSteps() => new List<string>
23+
{
24+
"Ensure Gemini CLI is installed (see https://geminicli.com/docs/get-started/installation/)",
25+
"Click Register to add UnityMCP via 'gemini mcp add'",
26+
"The server will be automatically available in Gemini CLI",
27+
"Use Unregister to remove via 'gemini mcp remove'"
28+
};
29+
}
30+
}

MCPForUnity/Editor/Clients/Configurators/GeminiCliConfigurator.cs.meta

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ openupm add com.coplaydev.unity-mcp
7979
`apply_text_edits``batch_execute``create_script``debug_request_context``delete_script``execute_custom_tool``execute_menu_item``find_gameobjects``find_in_file``get_sha``get_test_job``manage_animation``manage_asset``manage_components``manage_editor``manage_gameobject``manage_material``manage_prefabs``manage_scene``manage_script``manage_script_capabilities``manage_scriptable_object``manage_shader``manage_texture``manage_vfx``read_console``refresh_unity``run_tests``script_apply_edits``set_active_instance``validate_script`
8080

8181
### Available Resources
82-
`active_tool``custom_tools``editor_prefab_stage``editor_selection``editor_state``editor_windows``gameobject``gameobject_api``gameobject_component``gameobject_components``get_tests``menu_items``prefab_api``prefab_hierarchy``prefab_info``project_info``project_layers``project_tags``unity_instances`
82+
`custom_tools``editor_active_tool``editor_prefab_stage``editor_selection``editor_state``editor_windows``gameobject``gameobject_api``gameobject_component``gameobject_components``get_tests``get_tests_for_mode``menu_items``prefab_api``prefab_hierarchy``prefab_info``project_info``project_layers``project_tags``unity_instances`
8383

8484
**Performance Tip:** Use `batch_execute` for multiple operations — it's 10-100x faster than individual calls!
8585
</details>

docs/i18n/README-zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ openupm add com.coplaydev.unity-mcp
7979
`apply_text_edits``batch_execute``create_script``debug_request_context``delete_script``execute_custom_tool``execute_menu_item``find_gameobjects``find_in_file``get_sha``get_test_job``manage_animation``manage_asset``manage_components``manage_editor``manage_gameobject``manage_material``manage_prefabs``manage_scene``manage_script``manage_script_capabilities``manage_scriptable_object``manage_shader``manage_texture``manage_vfx``read_console``refresh_unity``run_tests``script_apply_edits``set_active_instance``validate_script`
8080

8181
### 可用资源
82-
`active_tool``custom_tools``editor_prefab_stage``editor_selection``editor_state``editor_windows``gameobject``gameobject_api``gameobject_component``gameobject_components``get_tests``menu_items``prefab_api``prefab_hierarchy``prefab_info``project_info``project_layers``project_tags``unity_instances`
82+
`custom_tools``editor_active_tool``editor_prefab_stage``editor_selection``editor_state``editor_windows``gameobject``gameobject_api``gameobject_component``gameobject_components``get_tests``get_tests_for_mode``menu_items``prefab_api``prefab_hierarchy``prefab_info``project_info``project_layers``project_tags``unity_instances`
8383

8484
**性能提示:** 多个操作请使用 `batch_execute` — 比逐个调用快 10-100 倍!
8585
</details>

0 commit comments

Comments
 (0)