MoonshotAI / MoonshotAI/kimi-cli

MCP 连接超时导致整个 CLI 不可用 || MCP connection timeout causes the entire CLI to be unavailable

Open
#2,343 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

What version of Kimi Code CLI is running?

v1.44.0

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

k2.6

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

kimi-cli v1.44.0 中,当某个 MCP 服务器(如 context7)连接超时时,整个交互会话会直接报错退出,而不是跳过该 MCP 继续提供服务
。MCP 不应是强依赖。

What steps can reproduce the bug?
复现步骤
  1. 确保 context7 MCP 服务器处于不可达/超时状态
  2. 运行 kimi 进入交互式会话
  3. 输入任意命令(如读取本地文件)
  4. 报错:Failed to connect MCP servers: {'context7': McpError('Timed out while waiting for response.')}
What is the expected behavior?
预期行为
  • MCP 连接超时后,CLI 应优雅降级,继续运行,仅缺失该 MCP 提供的功能
  • 用户执行与 MCP 无关的操作(如读取本地文件)不应受影响
Additional information
实际行为
  • _agent_loop() 中同步等待 wait_for_background_mcp_loading()
  • context7 超时后抛出 MCPRuntimeError,整个命令失败
  • 用户完全无法使用 CLI
环境信息
  • kimi-cli version: 1.44.0
  • OS: macOS
  • Python: 3.13 (通过 uv 安装)
关键堆栈

File ".../kimi_cli/soul/kimisoul.py", line 847, in _agent_loop await self.wait_for_background_mcp_loading() File ".../kimi
_cli/soul/kimisoul.py", line 535, in wait_for_background_mcp_loading await self._agent.toolset.wait_for_mcp_tools() File "
.../kimi_cli/soul/toolset.py", line 667, in wait_for_mcp_tools await task MCPRuntimeError: Failed to connect MCP servers:
{'context7': McpError('Timed out while waiting for response.')}


What version of Kimi Code CLI is running?

v1.44.0

Which open platform/subscription were you using?

Kimi Code

Which model were you using?

k2.6

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

In kimi-cli v1.44.0, when the connection to an MCP server (such as context7) times out, the entire interactive session will directly report an error and exit, instead of skipping the MCP and continuing to provide services.
. MCP should not be a strong dependency.

What steps can reproduce the bug?
Reproduction steps
  1. Make sure the context7 MCP server is in unreachable/timeout state
  2. Run kimi to enter an interactive session
  3. Enter any command (such as reading local files)
  4. Error: Failed to connect MCP servers: {'context7': McpError('Timed out while waiting for response.')}
What is the expected behavior?
Expected behavior
  • After the MCP connection times out, the CLI should gracefully degrade and continue to run, only missing the functionality provided by the MCP
  • Users performing operations unrelated to MCP (such as reading local files) should not be affected
Additional information
Actual behavior
  • Synchronous waiting in _agent_loop() wait_for_background_mcp_loading()
  • MCPRuntimeError is thrown after context7 times out and the entire command fails.
  • Users are completely unable to use the CLI
Environmental information
  • kimi-cli version: 1.44.0
  • OS: macOS
  • Python: 3.13 (installed via uv)
Key stack

File ".../kimi_cli/soul/kimisoul.py", line 847, in _agent_loop await self.wait_for_background_mcp_loading() File ".../kimi
_cli/soul/kimisoul.py", line 535, in wait_for_background_mcp_loading await self._agent.toolset.wait_for_mcp_tools() File "
.../kimi_cli/soul/toolset.py", line 667, in wait_for_mcp_tools await task MCPRuntimeError: Failed to connect MCP servers:
{'context7': McpError('Timed out while waiting for 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 in kimi_cli/soul/kimisoul.py at _agent_loop() and wait_for_background_mcp_loading(), then trace the call into kimi_cli/soul/toolset.py at wait_for_mcp_tools(). Reproduce with an unreachable or timing-out context7 MCP server and a local-file command. Done means an MCP timeout leaves the CLI interactive while only the unavailable MCP functionality is skipped.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.