|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.IO; |
| 4 | +using MCPForUnity.Editor.Models; |
| 5 | + |
| 6 | +namespace MCPForUnity.Editor.Clients.Configurators |
| 7 | +{ |
| 8 | + /// <summary> |
| 9 | + /// Kimi Code CLI MCP client configurator. |
| 10 | + /// Kimi Code uses a JSON-based configuration file with mcpServers section. |
| 11 | + /// Config path: ~/.kimi/mcp.json |
| 12 | + /// |
| 13 | + /// Kimi Code supports both stdio (uvx) and HTTP transport modes. |
| 14 | + /// Default: stdio mode (works without Unity Editor for basic operations) |
| 15 | + /// HTTP mode: requires Unity Editor running with MCP HTTP server started |
| 16 | + /// </summary> |
| 17 | + public class KimiCodeConfigurator : JsonFileMcpConfigurator |
| 18 | + { |
| 19 | + public KimiCodeConfigurator() : base(new McpClient |
| 20 | + { |
| 21 | + name = "Kimi Code", |
| 22 | + windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".kimi", "mcp.json"), |
| 23 | + macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".kimi", "mcp.json"), |
| 24 | + linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".kimi", "mcp.json"), |
| 25 | + SupportsHttpTransport = true, |
| 26 | + }) |
| 27 | + { } |
| 28 | + |
| 29 | + public override IList<string> GetInstallationSteps() => new List<string> |
| 30 | + { |
| 31 | + "Ensure Kimi Code CLI is installed (pip install kimi-cli or see https://github.com/MoonshotAI/kimi-cli)", |
| 32 | + "Click 'Auto Configure' to automatically add UnityMCP to ~/.kimi/mcp.json", |
| 33 | + "OR click 'Manual Setup' to copy the configuration JSON", |
| 34 | + "Open ~/.kimi/mcp.json and paste the configuration", |
| 35 | + "Save and restart Kimi Code CLI", |
| 36 | + "Use 'kimi mcp list' to verify Unity MCP is connected", |
| 37 | + "Note: For full functionality, open Unity Editor and start HTTP server" |
| 38 | + }; |
| 39 | + } |
| 40 | +} |
0 commit comments