Skip to content

Commit 8aa5c6d

Browse files
committed
Fix JSON serialization to handle non-ASCII characters in _convert_to_content
1 parent d788424 commit 8aa5c6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mcp/server/fastmcp/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,9 @@ def _convert_to_content(
551551

552552
if not isinstance(result, str):
553553
try:
554-
result = json.dumps(pydantic_core.to_jsonable_python(result))
554+
result = json.dumps(
555+
pydantic_core.to_jsonable_python(result), ensure_ascii=False
556+
)
555557
except Exception:
556558
result = str(result)
557559

0 commit comments

Comments
 (0)