Skip to content

fix: MCP server JSON output ensure_ascii=False for non-ASCII support#1293

Merged
igorls merged 2 commits into
MemPalace:developfrom
hzx945627450-eng:fix/mcp-ensure-ascii
May 6, 2026
Merged

fix: MCP server JSON output ensure_ascii=False for non-ASCII support#1293
igorls merged 2 commits into
MemPalace:developfrom
hzx945627450-eng:fix/mcp-ensure-ascii

Conversation

@hzx945627450-eng

Copy link
Copy Markdown

Summary

  • Add ensure_ascii=False to both json.dumps calls 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=False fix 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

  • Verify Chinese characters in tool results are returned verbatim (not as \uXXXX)
  • Verify JSON-RPC responses preserve non-ASCII characters
  • Verify no regression on ASCII-only content

@igorls igorls added area/i18n Multilingual, Unicode, non-English embeddings area/mcp MCP server and tools bug Something isn't working labels May 2, 2026
@igorls igorls added this to the v3.3.5 milestone May 2, 2026
黄祖鑫(940219) and others added 2 commits May 6, 2026 02:20
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>
@igorls igorls force-pushed the fix/mcp-ensure-ascii branch from b1c16f0 to 74288f1 Compare May 6, 2026 05:20
@igorls igorls merged commit f3d9801 into MemPalace:develop May 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/i18n Multilingual, Unicode, non-English embeddings area/mcp MCP server and tools bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants