You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Progress notifications cause server to hang on stdio transport #1141
When 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.
What I am seeing:
Server successfully sends progress notification via write_stream.send()
Server handler returns CallToolResult
The final response is never sent to the client
Client times out waiting for response
Server remains blocked and time out eventually
Example Code
importasynciofrommcp.server.lowlevelimportServerfrommcp.server.stdioimportstdio_serverfrommcp.typesimport*server=Server("progress-bug-demo")
@server.list_tools()asyncdefhandle_list_tools() ->list[Tool]:
return [Tool(
name="test_tool",
description="Demonstrates the bug",
inputSchema={"type": "object", "properties": {}}
)]
@server.call_tool()asyncdefhandle_call_tool(name: str, arguments: dict) ->list[TextContent]:
ctx=server.request_contextprogress_token=ctx.meta.progressTokenifctx.metaelseNoneifprogress_token:
# This causes the server to hangawaitctx.session.send_progress_notification(
progress_token=progress_token,
progress=0.5,
total=1.0,
message="Working..."
)
# This response is never sent due to the hangreturn [TextContent(type="text", text="Task completed!")]
asyncdefmain():
asyncwithstdio_server() as (read_stream, write_stream):
awaitserver.run(
read_stream,
write_stream,
server.create_initialization_options()
)
if__name__=="__main__":
asyncio.run(main())
I'll take a look at this. First step is to reproduce it on current main, then I'll keep any fix scoped to the stdio/progress path with regression coverage.
Activity
abhishekgahlot2 commentedon Jul 14, 2025
Actually using buffered streams seems to fix this problem.
Increasing Buffer Size in MCP stdio Transport
ihrpr commentedon Jul 15, 2025
@abhishekgahlot2 which client are you using for testing?
abhishekgahlot2 commentedon Jul 15, 2025
@ihrpr I am using a custom Python MCP client that I built for agents.
However looking more into my custom client i see sending progress via
2830500285 commentedon May 21, 2026
I'll take a look at this. First step is to reproduce it on current main, then I'll keep any fix scoped to the stdio/progress path with regression coverage.