MoonshotAI / MoonshotAI/kimi-code
MCP stdio server crashes on Windows with UnicodeEncodeError: 'charmap' codec can't encode character '\u2713'
Nobody has claimed this yet.
- 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?
- Install any MCP server that outputs Unicode in responses (e.g., Serena, Context7)
- Configure in Kimi Code via stdio transport
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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