Fix stdio server newline translation on Windows#2757
Open
yyzquwu wants to merge 1 commit into
Open
Conversation
b8992b8 to
86176c5
Compare
StantonMatt
reviewed
Jun 3, 2026
StantonMatt
left a comment
There was a problem hiding this comment.
Checked head 86176c5 on Windows with Python 3.13.13.
Local validation passed:
uv run --frozen pytest tests/server/test_stdio.py -q-> 3 passeduv run --frozen ruff check src/mcp/server/stdio.py tests/server/test_stdio.pyuv run --frozen pyright src/mcp/server/stdio.py tests/server/test_stdio.py
I also ran a default-stdout byte probe through stdio_server() with a JSONRPCRequest(id=99, method="ping"); the emitted frame ended in 0a and did not contain 0d0a:
7b226a736f6e727063223a22322e30222c226964223a39392c226d6574686f64223a2270696e67227d0a
That covers the Windows newline-translation boundary from #2433 for me.
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
stdio_server()by settingnewline=""on the default stdio wrappers.Fixes #2433.
Verification
Windows 11, Python 3.13.13:
Branch coverage for
tests/server/test_stdio.py:100.00%.Codex review passed before commit.