Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions MCPForUnity/Editor/Clients/Configurators/KimiCodeConfigurator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.IO;
using MCPForUnity.Editor.Models;

namespace MCPForUnity.Editor.Clients.Configurators
{
/// <summary>
/// Kimi Code CLI MCP client configurator.
/// Kimi Code uses a JSON-based configuration file with mcpServers section.
/// Config path: ~/.kimi/mcp.json
///
/// Kimi Code supports both stdio (uvx) and HTTP transport modes.
/// Default: stdio mode (works without Unity Editor for basic operations)
/// HTTP mode: requires Unity Editor running with MCP HTTP server started
/// </summary>
public class KimiCodeConfigurator : JsonFileMcpConfigurator
{
public KimiCodeConfigurator() : base(new McpClient
{
name = "Kimi Code",
windowsConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".kimi", "mcp.json"),
macConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".kimi", "mcp.json"),
linuxConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".kimi", "mcp.json"),
SupportsHttpTransport = true,
})
{ }

public override IList<string> GetInstallationSteps() => new List<string>
{
"Ensure Kimi Code CLI is installed (pip install kimi-cli or see https://github.com/MoonshotAI/kimi-cli)",
"Click 'Auto Configure' to automatically add UnityMCP to ~/.kimi/mcp.json",
"OR click 'Manual Setup' to copy the configuration JSON",
"Open ~/.kimi/mcp.json and paste the configuration",
"Save and restart Kimi Code CLI",
Comment on lines +32 to +35

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use platform-neutral manual-path instructions

Manual setup currently hardcodes ~/.kimi/mcp.json, which is unclear for Windows users. Prefer referencing the resolved config path shown by the configurator/UI or listing OS-specific paths.

Suggested wording update
-            "Click 'Auto Configure' to automatically add UnityMCP to ~/.kimi/mcp.json",
+            "Click 'Auto Configure' to automatically add UnityMCP to the Kimi config file",
             "OR click 'Manual Setup' to copy the configuration JSON",
-            "Open ~/.kimi/mcp.json and paste the configuration",
+            "Open Kimi's MCP config file for your OS and paste the configuration",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Click 'Auto Configure' to automatically add UnityMCP to ~/.kimi/mcp.json",
"OR click 'Manual Setup' to copy the configuration JSON",
"Open ~/.kimi/mcp.json and paste the configuration",
"Save and restart Kimi Code CLI",
"Click 'Auto Configure' to automatically add UnityMCP to the Kimi config file",
"OR click 'Manual Setup' to copy the configuration JSON",
"Open Kimi's MCP config file for your OS and paste the configuration",
"Save and restart Kimi Code CLI",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@MCPForUnity/Editor/Clients/Configurators/KimiCodeConfigurator.cs` around
lines 32 - 35, The hardcoded manual-path strings in KimiCodeConfigurator that
reference "~/.kimi/mcp.json" (the messages around "Click 'Auto Configure'..."
and "OR click 'Manual Setup'...") should be made platform-neutral: update the
text to either display the runtime-resolved config path from the configurator/UI
(e.g., use the existing method/property that returns the resolved config path)
or replace the literal with OS-agnostic wording like "your Kimi config file
(path shown above)" or "the config file path shown in the UI" so Windows users
aren’t misled; modify the message constants in KimiCodeConfigurator accordingly
and ensure any displayed resolved path uses the configurator’s path-resolving
function.

"Use 'kimi mcp list' to verify Unity MCP is connected",
"Note: For full functionality, open Unity Editor and start HTTP server"
};
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading