MoonshotAI / MoonshotAI/kimi-code

MCP stdio server crashes on Windows with UnicodeEncodeError: 'charmap' codec can't encode character '\u2713'

Open
#886 4 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.5.10

Which open platform/subscription were you using?

Platform: Kimi Code VS Code extension Subscription: Kimi Allegretto

Which model were you using?

kimi-k2.7

What platform is your computer?

Windows 10

What issue are you seeing?

Bug Description

Kimi Code fails to decode UTF-8 responses from MCP stdio servers on Windows. The connection crashes with UnicodeEncodeError when the server sends Unicode characters (e.g., U+2713).

Environment

  • OS: Windows 10
  • Kimi Code version: 0.5.10
  • MCP Server: Serena 1.5.3 (stdio)
  • Context7: 3.2.1 (stdio)

First log line before crash

INFO ... mcp.server.lowlevel.server:_handle_request:727 - Processing request of type ListToolsRequest

Error Log

Context7 Documentation MCP Server v3.2.1 running on stdio
\u2717 Connection failed: UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' in position 0: character maps to

Works outside Kimi Code?

Yes — Serena starts fine from PowerShell with UTF-8 console. Crashes only when launched by Kimi Code. Also Serena works in Codex without any problems.

What steps can reproduce the bug?
  1. Install any MCP server that outputs Unicode in responses (e.g., Serena, Context7)
  2. Configure in Kimi Code via stdio transport
  3. Server starts, processes ListToolsRequest, then crashes on encoding

Expected Behavior

Kimi Code should handle UTF-8 stdio correctly on Windows, or at least use errors='replace'/'ignore' when decoding.

Actual Behavior

Connection fails, server shuts down, Kimi Code falls back to generic tools (grep).

Workaround

None found. The issue is in Kimi Code's stdio reader/writer, not the server.

What is the expected behavior?

Kimi Code should handle UTF-8 stdio correctly on Windows.

Additional information
Image

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 at the MCP stdio reader/writer and reproduce the Windows failure with a Unicode response from Serena or Context7, focusing on the ListToolsRequest path. Done means a Kimi Code stdio connection remains active when responses contain characters such as ✓, without falling back to generic tools.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.