MoonshotAI / MoonshotAI/kimi-code

Bug: plugin-declared MCP server fails with "KimiCU runtime is not installed" when host strips env vars

Open Beginner friendly
#2,942 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What version of Kimi Code is running?

0.36.0

Which open platform/subscription were you using?

Custom OpenAI-compatible provider (DeepSeek)

Which model were you using?

deepseek-v4-flash

What platform is your computer?

Windows 10.0.26300 x64

What issue are you seeing?

Issue

The MCP server declared by the Kimi Computer Use for Windows plugin (plugin-kimi-cu-win:win) fails to start with:

MCP error -32000: Connection closed
stderr: KimiCU for Windows runtime is not installed. Run setup_windows.ps1 from the release bundle, or unzip kimi-cu-win-runtime.zip and run install_runtime.ps1.

However the runtime is installed at %LOCALAPPDATA%\KimiCU\kimi-cu.exe and runs fine when launched manually.

Root cause

The plugin launcher bin\kimi-cu-mcp.cmd only checks %LOCALAPPDATA%\KimiCU\kimi-cu.exe (then %ProgramFiles%\KimiCU\kimi-cu.exe). When the CLI host spawns the stdio MCP child process with a stripped environment (e.g. no LOCALAPPDATA), the if exist check fails and the script exits with the misleading "runtime is not installed" message.

Reproduced by running the launcher with a clean environment: env -i cmd.exe /c bin\kimi-cu-mcp.cmd fails with the exact same error; after adding a USERPROFILE-derived fallback (and an absolute-path fallback) it succeeds.

What steps can reproduce the bug?
  1. Install the kimi-cu-win plugin (Kimi Computer Use for Windows v0.2.14) in Kimi Code CLI on Windows.
  2. Make sure the runtime exists at %LOCALAPPDATA%\KimiCU\kimi-cu.exe.
  3. Restart / reload Kimi Code so the plugin-declared MCP server plugin-kimi-cu-win:win gets started.
  4. The MCP server fails with "KimiCU for Windows runtime is not installed" even though the exe is present.

Minimal repro of the launcher logic (clean environment, like some hosts spawn MCP children):

env -i cmd.exe /c bin\kimi-cu-mcp.cmd

→ prints the exact same "runtime is not installed" error, because LOCALAPPDATA is absent from the stripped environment.

What is the expected behavior?

The plugin's MCP server should start successfully when the runtime exe exists. The launcher script should locate the runtime even when LOCALAPPDATA is missing from the child-process environment (e.g. fall back to %USERPROFILE%\AppData\Local\KimiCU\kimi-cu.exe), or the host should preserve user environment variables when spawning stdio MCP servers. The misleading "runtime is not installed" error should never appear while the runtime is actually installed.

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bin\kimi-cu-mcp.cmd and reproduce the failure using env -i cmd.exe /c bin\kimi-cu-mcp.cmd. Trace how the launcher locates %LOCALAPPDATA%\KimiCU\kimi-cu.exe when environment variables are stripped. Done means the MCP server starts when the runtime exists, including with a clean environment, without reporting that the runtime is missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.