kimi-cli icon indicating copy to clipboard operation
kimi-cli copied to clipboard

当配置了 MCP 服务器时,退出 kimi-cli 会卡住(显示 "Bye" 后无响应) || When the MCP server is configured, exiting kimi-cli will get stuck (no response after "Bye" is displayed)

Open Wolido opened this issue 9 months ago • 7 comments

What version of Kimi Code CLI is running?

kimi, version 1.12.0

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

kimi-for-coding

What platform is your computer?

Darwin 25.2.0 arm64 arm

What issue are you seeing?

在使用 kimi-cli 时,无论通过 Ctrl+D 还是 /exit 命令退出,程序都会在显示 "Bye" 后卡住,无法返回到终端。

What steps can reproduce the bug?

  1. 创建或存在 ~/.kimi/mcp.json 配置文件(配置了任意 MCP 服务器)
  2. 启动 kimi-cli
  3. 按 Ctrl+D 或输入 /exit 退出
  4. 观察到 "Bye" 输出后,程序卡住不动

What is the expected behavior?

No response

Additional information

No response


What version of Kimi Code CLI is running?

kimi, version 1.12.0

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

kimi-for-coding

What platform is your computer?

Darwin 25.2.0 arm64 arm

What issue are you seeing?

When using kimi-cli, whether exiting through Ctrl+D or /exit command, the program will get stuck after displaying "Bye" and cannot return to the terminal.

What steps can reproduce the bug?

  1. Create or exist ~/.kimi/mcp.json configuration file (configured with any MCP server)
  2. Start kimi-cli
  3. Press Ctrl+D or enter /exit to exit
  4. After observing the "Bye" output, the program gets stuck.

What is the expected behavior?

No response

Additional information

No response

Wolido avatar Feb 13 '26 07:02 Wolido

我尝试复现并没有成功,还有其他细节么,可以查看下日志有什么异常 tail -f ~/.kimi/logs/*.log

Image

xiaoju111a avatar Feb 13 '26 09:02 xiaoju111a

查了一下,log中没有发现任何关于这个情况的记录,而且只有info,没有warning和err,基本都是 Running soul with user input


After checking, I didn’t find any record about this situation in the log, and there was only info, no warning and err. It was basically Running soul with user input

Wolido avatar Feb 13 '26 10:02 Wolido

查了一下,log中没有发现任何关于这个情况的记录,而且只有info,没有warning和err,基本都是 Running soul with user input

After checking, I didn’t find any record about this situation in the log, and there was only info, no warning and err. It was basically Running soul with user input

配置的是哪个mcp,我再试试

xiaoju111a avatar Feb 13 '26 10:02 xiaoju111a

博查的mcp

{
  "mcpServers": {
    "bocha-search-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/liuyu/kimi_workspace/.mcp_tools/bocha-search-mcp",
        "run",
        "bocha-search-mcp"
      ],
      "env": {
        "BOCHA_API_KEY": ""
      }
    }
  }
}

Wolido avatar Feb 13 '26 10:02 Wolido

博查mcp的配置在这:https://github.com/BochaAI/bocha-search-mcp


The configuration of Bocha mcp is here: https://github.com/BochaAI/bocha-search-mcp

Wolido avatar Feb 13 '26 10:02 Wolido

博查mcp的配置在这:https://github.com/BochaAI/bocha-search-mcp

The configuration of Bocha mcp is here: https://github.com/BochaAI/bocha-search-mcp

有尝试添加其他mcp会遇到这个问题么,这种很可能是mcp没有正确退出导致的进程悬挂

xiaoju111a avatar Feb 13 '26 10:02 xiaoju111a

换成自己写的mcp,问题消失,能够正常退出了。


After replacing it with mcp written by myself, the problem disappeared and I was able to exit normally.

Wolido avatar Feb 13 '26 12:02 Wolido