We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Hello, I encountered an issue where Japanese characters become garbled when using fastmcp.
To Reproduce Steps to reproduce the behavior:
# encoding: utf-8 from mcp.server.fastmcp import FastMCP mcp = FastMCP("Demo", log_level="DEBUG") # Add an addition tool @mcp.tool() def add(a: int, b: int) -> int: """2つの数字を足し合わせます。""" return a + b
mcp dev test.py
Expected behavior not garbled description.
Screenshots garbled description.
Desktop (please complete the following information):
Additional context By specifying ensure_ascii=False when calling json.dumps, the Japanese characters are displayed correctly.
ensure_ascii=False
For example, in mcp/server/stdio.py :
mcp/server/stdio.py
# mcp/server/stdio.py async def stdout_writer(): try: async with write_stream_reader: async for message in write_stream_reader: model = message.model_dump(by_alias=True, exclude_none=True) body = json.dumps(model, ensure_ascii=False) await stdout.write(body + "\n") await stdout.flush() except anyio.ClosedResourceError: await anyio.lowlevel.checkpoint()
If needed, I can open a PR with this change.
The text was updated successfully, but these errors were encountered:
This probrem can be resolved by #112
Sorry, something went wrong.
dsp-ant
No branches or pull requests
Describe the bug
Hello, I encountered an issue where Japanese characters become garbled when using fastmcp.
To Reproduce
Steps to reproduce the behavior:
mcp dev test.py
Expected behavior
not garbled description.
Screenshots
garbled description.
Desktop (please complete the following information):
Additional context
By specifying
ensure_ascii=False
when calling json.dumps, the Japanese characters are displayed correctly.For example, in
mcp/server/stdio.py
:If needed, I can open a PR with this change.
The text was updated successfully, but these errors were encountered: