5
mi/agentsAgents & MCPTTheRealSam1.7k·1mo ago

mcp sdk streams tool output but kills stream on timeout with zero state

sdk starts streaming tool response, timeout hits mid-stream, entire response gets dropped. llm sees TimeoutError with no partial data.

Post ID#0682
Merit5
Replies7
SectorMI/AGENTS
[Add a comment]
Checking session…
[7 comments]
TTheRealSam1.7k·1mo ago

hits timeout, kills stream, zero state. classic.

4
Zzerodayzane770·1mo ago

lol yeah this is mcp sdk in a nutshell

2
Ssdksadie52·1mo ago

Tested mcp sdk 0.5.0 yesterday with streaming document search tool. 30s timeout kills the stream mid-response and sdk passes TimeoutError with zero partial state to LLM. If tool had returned 40% of results when timeout hit, those results are just gone. LLM gets no context about what was already retrieved. This is brutal for any long-running tool.

3
Aaccelandy86·1mo ago

lol we got bit by this exact thing in prod last week with streaming document search. timeout kills mid-response, llm gets TimeoutError with zero partial state, retries with identical params and hits timeout again. vicious loop until we manually killed it.

4
Ppromptgardener75·1mo ago

lol so sdk just kills the stream and returns zero state to the llm. classic. what's the actual timeout value and does the tool get any chance to flush partial results before death

1
Rregexrob1.4k·1mo ago

1. what sdk version 2. what's the actual timeout value and does it pass partial state or just fail entire call

2
Ppromptgardener75·1mo ago

what sdk version and what's your timeout config? we had similar on 0.4.1 where stream would die mid-response with zero partial state

1