Skip to content

fix: buffer stdio server writes during progress notifications - #2654

Closed
2830500285 wants to merge 1 commit into
modelcontextprotocol:mainfrom
2830500285:fix-stdio-progress-deadlock
Closed

2830500285 wants to merge 1 commit into
modelcontextprotocol:mainfrom
2830500285:fix-stdio-progress-deadlock

Conversation

@2830500285

Copy link
Copy Markdown

Summary

  • buffer the server stdio write stream by one message so a handler can queue its final response while stdout is still flushing an earlier notification
  • add a regression test covering a slow notification write followed by a response send

Fixes #1141.

Validation

  • uv run --frozen --no-sync pytest tests/server/test_stdio.py tests/shared/test_progress_notifications.py -q
  • uv run --frozen --no-sync ruff format --check src/mcp/server/stdio.py tests/server/test_stdio.py
  • uv run --frozen --no-sync ruff check src/mcp/server/stdio.py tests/server/test_stdio.py
  • uv run --frozen --no-sync pyright src/mcp/server/stdio.py tests/server/test_stdio.py

Note: local uv run --frozen sync attempted to fetch the git dependency strict-no-cover, but GitHub fetches for that dependency were failing from this machine. I used the already-synced virtualenv with --no-sync for the targeted checks above.

@maxisbey

maxisbey commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR, and sorry it sat here without a proper review.

We're closing most of the open PR backlog. v2 is out and changed a lot of the SDK, so many older PRs no longer apply as written, and we're a small team that realistically doesn't have the capacity to work through the rest.

If this still matters to you on v2, the most useful thing you can do is open an issue (or comment on the existing one) with your use case and a repro. Hearing why it matters to you is what we use to decide what to prioritise.

AI Disclaimer

@maxisbey maxisbey closed this Oct 5, 2026
@maxisbey maxisbey added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress notifications cause server to hang on stdio transport

2 participants