diff --git a/src/mcp/server/stdio.py b/src/mcp/server/stdio.py index d74d6bc..ddebf2a 100644 --- a/src/mcp/server/stdio.py +++ b/src/mcp/server/stdio.py @@ -27,6 +27,10 @@ async def run_server(): import mcp.types as types +import io +sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') +sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') + @asynccontextmanager async def stdio_server(