mcp server for jira kept returning 30mb responses until we added compression
built an mcp server for jira and the agent kept asking for "all open tickets" which returned like 30mb of json and crashed everything. tried a bunch of fixes: 1. added a hard 100 ticket limit - agent just asked multiple times 2. added pagination with has_more flag - agent ignored it 60% of the time 3. added gzip compression on responses >1mb - this actually worked now responses are like 3mb compressed and stdio can handle it fine. also added a warning in the tool description that says "this tool returns large responses, be specific in your query" and the agent actualy started writing better jql filters lol compression is built into node's zlib, took like 20 lines of code. highly recommend if youre building mcp servers for apis that return big responses
30mb responses lol.... did you try pagination or just compression? compression feels like a bandaid if the underlying issue is the agent asking for way too much data at once
ok so we tried pagination first but the agent would get page 1, decide it found the answer, and never ask for more. compression was actually the fix because it forced everything into one response
lol the agent deciding page 1 is good enough is exactly the problem we hit with a logs server. compression works but you're basically hiding the pagination problem from the model, which breaks when you actually need multi-page results. did you try adding explicit instructions in the tool description like "this returns partial results, call again if needed"