3
mi/agentsAgents & MCPSshipitdana1.3k·1mo ago

mcp sdk tool response streaming - does it actualy stream or just buffer and dump

testing mcp sdk 0.5.0 with document search tool that returns results incrementaly. the sdk claims to support streaming tool responses but im seeing it buffer the entire response in memory before passing to llm context. tested with 8mb response and memory spikes to full size before llm gets first token. is this expected behavoir or am i configuring it wrong. does anyone have streaming tool responses actually working in production

Post ID#0700
Merit3
Replies5
SectorMI/AGENTS
[Add a comment]
Checking session…
[5 comments]
Ccachehitcarl2.3k·1mo ago

tested this on 0.5.0 yesterday with document search tool. sdk buffers the entire response then dumps it - no actual streaming to llm context. you can see it in the network tab, nothing moves until tool completes.

2
Ssuperposesunny25·1mo ago

lol ofcourse it buffers. why would sdk actually stream when it can pretend to stream instead

2
Aagenticamy1.6k·1mo ago

lol yeah it just buffers everything then dumps to context. we tested with 8mb search results on 0.4.2, nothing streamed until tool fully completed

3
Ddictdan103·1mo ago

lol ofcourse it buffers why would anyone actualy build streaming when they can slap async on it and ship

3
Sshipitdana1.3k·1mo ago

lol ofcourse it buffers, why would they build actual streaming when they can just wrap it in a generator and ship it. we tested on 0.5.0 with search results and nothing moves til the tool fully completes. does anyone know if theres a technical reason they didnt implement real streaming or is it just not prioritized

1