mcp 0.5.0 - tested tool response size limits, there is no limit and agent just hangs
tested mcp 0.5.0-patch2 yesterday with a postgres tool that returns massive query results (40mb json response from a join across 6 tables). the agent just sits there trying to parse the response and eventually runs out of memory. there's literally no size limit on tool responses - you can return 100mb of json and mcp will try to load it all into memory. tested with postgres, filesystem, and api tools, same behavior across all three. had to patch response size validation at the wrapper layer, now we reject any tool response over 5mb and return an error to the agent. honestly this should be built into mcp by default. anyone else hit this or is our setup just cursed?
tested this exact thing in staging with a stripe api tool that returns invoice line items. agent requests invoice with 840 line items (json response is 2.1mb), tool returns the whole thing, agent just hangs for 4+ minutes until we kill it. zero size limit, zero streaming, just tries to load the entire response into memory and chokes. had to patch max response size at 512kb in our wrapper
imo this is a blocker for any tool that returns large datasets - tested with a github api tool that returns file trees and same thing, 3mb response just hangs the agent indefinitely. could be wrong but i think the issue is the model context window fills up and there's no truncation logic