Skip to content
Open
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.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![](https://badge.mcpx.dev?status=on 'MCP Enabled')](https://modelcontextprotocol.io/introduction)
[![](https://img.shields.io/badge/License-MIT-red.svg 'MIT License')](https://opensource.org/licenses/MIT)

**Create your Unity apps with LLMs!** MCP for Unity bridges AI assistants (Claude, Claude Code, Cursor, VS Code, etc.) with your Unity Editor via the [Model Context Protocol](https://modelcontextprotocol.io/introduction). Give your LLM the tools to manage assets, control scenes, edit scripts, and automate tasks.
**Create your Unity apps with LLMs!** MCP for Unity bridges AI assistants (Claude, Claude Code, Cursor, VS Code, Kimi Code, etc.) with your Unity Editor via the [Model Context Protocol](https://modelcontextprotocol.io/introduction). Give your LLM the tools to manage assets, control scenes, edit scripts, and automate tasks.

<img alt="MCP for Unity building a scene" src="docs/images/building_scene.gif">

Expand All @@ -31,6 +31,7 @@
<details>
<summary>Older releases</summary>

* **v9.6.9** — Added Kimi Code CLI client configurator.
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

Fix release chronology in changelog section

Line 34 lists v9.6.9 under “Older releases”, but the “Recent Updates” section tops out at v9.6.3. This version ordering is inconsistent and can confuse users scanning upgrade history.

🤖 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 `@README.md` at line 34, The changelog entry for "* **v9.6.9** — Added Kimi
Code CLI client configurator." is out of order relative to the "Recent Updates"
top version v9.6.3; either move the v9.6.9 bullet from the "Older releases"
section into "Recent Updates" (so the chronology is descending) or correct the
version number to the intended release (e.g., change v9.6.9 to v9.6.3) so that
the entries for v9.6.3 and v9.6.9 are consistent across the README; update the
single list item text containing "v9.6.9" accordingly and verify the "Recent
Updates" header ordering mentions "v9.6.3" still reads correctly.

* **v9.4.8** — New editor UI, real-time tool toggling via `manage_tools`, skill sync window, multi-view screenshot, one-click Roslyn installer, Qwen Code & Gemini CLI clients, ProBuilder mesh editing via `manage_probuilder`.
* **v9.4.7** — Per-call Unity instance routing, macOS pyenv PATH fix, domain reload resilience for script tools.
* **v9.4.6** — New `manage_animation` tool, Cline client support, stale connection detection, tool state persistence across reloads.
Expand All @@ -47,7 +48,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) | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | [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) | [OpenClaw](https://openclaw.ai)
* **An MCP Client** — [Claude Desktop](https://claude.ai/download) | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | [Cursor](https://www.cursor.com/en/downloads) | [VS Code Copilot](https://code.visualstudio.com/docs/copilot/overview) | [Kimi Code](https://github.com/MoonshotAI/kimi-cli) | [GitHub Copilot CLI](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli) | [OpenClaw](https://openclaw.ai)

### 1. Install the Unity Package

Expand Down Expand Up @@ -82,7 +83,7 @@ openupm add com.coplaydev.unity-mcp
2. Click **Start Server** (launches HTTP server on `localhost:8080`)
3. Select your MCP Client from the dropdown and click **Configure**
4. Look for 🟢 "Connected ✓"
5. **Connect your client:** Some clients (Cursor, Antigravity, OpenClaw) require enabling an MCP toggle or plugin in settings. OpenClaw also needs the `openclaw-mcp-bridge` plugin enabled and follows the currently selected MCP for Unity transport (`HTTP` or `stdio`). Others (Claude Desktop, Claude Code) auto-connect after configuration.
5. **Connect your client:** Some clients (Cursor, Antigravity, OpenClaw) require enabling an MCP toggle or plugin in settings. OpenClaw also needs the `openclaw-mcp-bridge` plugin enabled and follows the currently selected MCP for Unity transport (`HTTP` or `stdio`). Others (Claude Desktop, Claude Code, Kimi Code) auto-connect after configuration.

**That's it!** Try a prompt like: *"Create a red, blue and yellow cube"* or *"Build a simple player controller"*

Expand Down