Title: Progress notifications cause server to hang on stdio transport · Issue #1141 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Progress notifications cause server to hang on stdio transport · Issue #1141 · modelcontextprotocol/python-sdk
X Title: Progress notifications cause server to hang on stdio transport · Issue #1141 · modelcontextprotocol/python-sdk
Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue Description When using the low-lev...
Open Graph Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...
X Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening t...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/1141
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Progress notifications cause server to hang on stdio transport","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the latest version of MCP Python SDK\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Description\n\nWhen using the low-level Server API (`mcp.server.lowlevel.Server`) with stdio transport, sending progress notifications during request handling causes the server to hang indefinitely and never send the final response.\n\n**What I am seeing:**\n- Server successfully sends progress notification via `write_stream.send()`\n- Server handler returns `CallToolResult` \n- The final response is never sent to the client\n- Client times out waiting for response\n- Server remains blocked and time out eventually\n\n### Example Code\n\n```Python\nimport asyncio\nfrom mcp.server.lowlevel import Server\nfrom mcp.server.stdio import stdio_server\nfrom mcp.types import *\n\nserver = Server(\"progress-bug-demo\")\n\n@server.list_tools()\nasync def handle_list_tools() -\u003e list[Tool]:\n return [Tool(\n name=\"test_tool\",\n description=\"Demonstrates the bug\",\n inputSchema={\"type\": \"object\", \"properties\": {}}\n )]\n\n@server.call_tool()\nasync def handle_call_tool(name: str, arguments: dict) -\u003e list[TextContent]:\n ctx = server.request_context\n progress_token = ctx.meta.progressToken if ctx.meta else None\n \n if progress_token:\n # This causes the server to hang\n await ctx.session.send_progress_notification(\n progress_token=progress_token,\n progress=0.5,\n total=1.0,\n message=\"Working...\"\n )\n \n # This response is never sent due to the hang\n return [TextContent(type=\"text\", text=\"Task completed!\")]\n\nasync def main():\n async with stdio_server() as (read_stream, write_stream):\n await server.run(\n read_stream,\n write_stream,\n server.create_initialization_options()\n )\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n### Python \u0026 MCP Python SDK\n\n```Text\nMCP: 1.10.1\nPython: 3.12.6\n```\n\nFrom deeper debugging looks like buffer size is the problem : https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/stdio.py#L57\n\nHave to test locally if increasing it will most likely fix the issue and if its causing more problems than just fixing this.","author":{"url":"https://github.com/abhishekgahlot2","@type":"Person","name":"abhishekgahlot2"},"datePublished":"2025-07-14T19:58:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1141/python-sdk/issues/1141"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2224fc82-c771-58f2-1edd-ac36b5f5a84e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A832:1C1025:19DF874:22C8071:6A5BA78D |
| html-safe-nonce | 6561e5dc63ef06808c70e620c4e853f703d2ab7ebd2ce49ae2eab47eeff95e2b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODMyOjFDMTAyNToxOURGODc0OjIyQzgwNzE6NkE1QkE3OEQiLCJ2aXNpdG9yX2lkIjoiNTAxODgxNzM1MTg2Mjk1Mzg2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a5eb68f4b14f8ac2df91364b94db95b23a9893ad3028506842a33fdc1493d1e4 |
| hovercard-subject-tag | issue:3229869279 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/1141/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7fb9ceceb4967bbf36b364d6ea8d6e2cd60bccbe9a230440a5436133fa471b13/modelcontextprotocol/python-sdk/issues/1141 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7fb9ceceb4967bbf36b364d6ea8d6e2cd60bccbe9a230440a5436133fa471b13/modelcontextprotocol/python-sdk/issues/1141 |
| og:image:alt | Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | abhishekgahlot2 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width