From 6eef08d0ec9bde3c31f6c75b88cad3bca9e59108 Mon Sep 17 00:00:00 2001 From: Christopher Harrison Date: Tue, 27 Jan 2026 14:05:06 -0800 Subject: [PATCH] Add GitHub Copilot CLI support to MCP client list and configurator --- .../Configurators/CopilotCliConfigurator.cs | 27 +++++++++++++++++++ README.md | 2 +- docs/guides/MCP_CLIENT_CONFIGURATORS.md | 3 ++- docs/i18n/README-zh.md | 2 +- 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 MCPForUnity/Editor/Clients/Configurators/CopilotCliConfigurator.cs diff --git a/MCPForUnity/Editor/Clients/Configurators/CopilotCliConfigurator.cs b/MCPForUnity/Editor/Clients/Configurators/CopilotCliConfigurator.cs new file mode 100644 index 000000000..84120a4f7 --- /dev/null +++ b/MCPForUnity/Editor/Clients/Configurators/CopilotCliConfigurator.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.IO; +using MCPForUnity.Editor.Models; + +namespace MCPForUnity.Editor.Clients.Configurators +{ + public class CopilotCliConfigurator : JsonFileMcpConfigurator + { + public CopilotCliConfigurator() : base(new McpClient + { + name = "GitHub Copilot CLI", + windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".copilot", "mcp-config.json"), + macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".copilot", "mcp-config.json"), + linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".copilot", "mcp-config.json") + }) + { } + + public override IList GetInstallationSteps() => new List + { + "Install GitHub Copilot CLI (https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli)", + "Open or create mcp-config.json at the path above", + "Paste the configuration JSON (or use /mcp add in the CLI)", + "Restart your Copilot CLI session" + }; + } +} diff --git a/README.md b/README.md index d03de47ea..ff7667d74 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ * **Unity 2021.3 LTS+** — [Download Unity](https://unity.com/download) * **Python 3.10+** and **uv** — [Install uv](https://docs.astral.sh/uv/getting-started/installation/) -* **An MCP Client** — [Claude Desktop](https://claude.ai/download) | [Cursor](https://www.cursor.com/en/downloads) | [VS Code Copilot](https://code.visualstudio.com/docs/copilot/overview) | [Windsurf](https://windsurf.com) +* **An MCP Client** — [Claude Desktop](https://claude.ai/download) | [Cursor](https://www.cursor.com/en/downloads) | [VS Code Copilot](https://code.visualstudio.com/docs/copilot/overview) | [GitHub Copilot CLI](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli) | [Windsurf](https://windsurf.com) ### 1. Install the Unity Package diff --git a/docs/guides/MCP_CLIENT_CONFIGURATORS.md b/docs/guides/MCP_CLIENT_CONFIGURATORS.md index f79f1ccb6..c8998cc3a 100644 --- a/docs/guides/MCP_CLIENT_CONFIGURATORS.md +++ b/docs/guides/MCP_CLIENT_CONFIGURATORS.md @@ -4,7 +4,7 @@ This guide explains how MCP client configurators work in this repo and how to ad It covers: -- **Typical JSON-file clients** (Cursor, VSCode GitHub Copilot, VSCode Insiders, Windsurf, Kiro, Trae, Antigravity, etc.). +- **Typical JSON-file clients** (Cursor, VSCode GitHub Copilot, VSCode Insiders, GitHub Copilot CLI, Windsurf, Kiro, Trae, Antigravity, etc.). - **Special clients** like **Claude CLI** and **Codex** that require custom logic. - **How to add a new configurator class** so it shows up automatically in the MCP for Unity window. @@ -91,6 +91,7 @@ Most MCP clients use a JSON config file that defines one or more MCP servers. Ex - **Cursor** – `JsonFileMcpConfigurator` (global `~/.cursor/mcp.json`). - **VSCode GitHub Copilot** – `JsonFileMcpConfigurator` with `IsVsCodeLayout = true`. - **VSCode Insiders GitHub Copilot** – `JsonFileMcpConfigurator` with `IsVsCodeLayout = true` and Insider-specific `Code - Insiders/User/mcp.json` paths. +- **GitHub Copilot CLI** – `JsonFileMcpConfigurator` with standard HTTP transport. - **Windsurf** – `JsonFileMcpConfigurator` with Windsurf-specific flags (`HttpUrlProperty = "serverUrl"`, `DefaultUnityFields["disabled"] = false`, etc.). - **Kiro**, **Trae**, **Antigravity (Gemini)** – JSON configs with project-specific paths and flags. diff --git a/docs/i18n/README-zh.md b/docs/i18n/README-zh.md index b2cf905b5..97e00a929 100644 --- a/docs/i18n/README-zh.md +++ b/docs/i18n/README-zh.md @@ -25,7 +25,7 @@ * **Unity 2021.3 LTS+** — [下载 Unity](https://unity.com/download) * **Python 3.10+** 和 **uv** — [安装 uv](https://docs.astral.sh/uv/getting-started/installation/) -* **一个 MCP 客户端** — [Claude Desktop](https://claude.ai/download) | [Cursor](https://www.cursor.com/en/downloads) | [VS Code Copilot](https://code.visualstudio.com/docs/copilot/overview) | [Windsurf](https://windsurf.com) +* **一个 MCP 客户端** — [Claude Desktop](https://claude.ai/download) | [Cursor](https://www.cursor.com/en/downloads) | [VS Code Copilot](https://code.visualstudio.com/docs/copilot/overview) | [GitHub Copilot CLI](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli) | [Windsurf](https://windsurf.com) ### 1. 安装 Unity 包