fix: MCP server JSON output ensure_ascii=False for non-ASCII support#1293
Merged
Conversation
3 tasks
Without ensure_ascii=False, non-ASCII characters (e.g. Chinese) in tool results and JSON-RPC responses are escaped as \uXXXX, which causes downstream MCP clients to receive escaped text instead of the original characters. This affects all platforms, not just Windows. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
b1c16f0 to
74288f1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ensure_ascii=Falseto bothjson.dumpscalls in MCP server, so non-ASCII characters (e.g. Chinese) are preserved as-is instead of being escaped as\uXXXX.Background
This change was originally part of PR #1291. Per reviewer feedback from @igrots, the
ensure_ascii=Falsefix is being split into its own PR since it is independently valuable and applies to all platforms (not just Windows).Without this fix, downstream MCP clients receive escaped Unicode sequences instead of the original characters, which breaks non-ASCII content display.
Test plan
\uXXXX)