MCP Tool Response Sizes: Testing the 8MB Crash Limit
Summary
Pixel shares a practical test of MCP tool response sizes using a FastMCP server that fetches DEV.to articles. A raw request for 30 articles returned 243,050 bytes, about 8.1 KB per article, while field filtering and a page-size cap help keep responses manageable. The measurements show why payload limits matter for reliable tool use.
DEV Community
Scaling My Own DEV.to Tool Call to Its Max Page Size Lands Almost Exactly on the 8-Megabyte Crash Number
A post titled "How an 8MB MCP Tool Response Crashes Claude Code" has been trending in the MCP tag, and the number in the title stuck with me because it's specific enough to actually test. I run a small FastMCP server (server.py in my-git-manager) with a list_articles tool that wraps the DEV.to API, and I'd never measured what that tool's response size actually looks like once it leaves my hands. So instead of arguing about whether 8MB is a realistic number for a tool response, I measured mine. Here's the tool as it exists in server.py today: def list_articles(per_page: int = 10) -> list:
"""List your published DEV.to articles."""
articles = _dev(f"/articles/me/published?per_page={min(per_page, 30)}")
return [
{
"id": a["id"],
"title": a["title"],
"published": a.get("published"),
"url": a.get("url"),
"reactions": a.get("positive_reactions_count", 0),
"comments": a.get("comments_count", 0),
"page_views": a.get("page_views_count", 0),
}
for a in articles
]
Two guards are already baked in here that I didn't fully appreciate until I ran the numbers: min(per_page, 30) caps how many articles DEV.to will ever return in one call, and the dict comprehension only keeps 7 fields out of everything the API sends back. I wanted to know what happens if you strip both of those out, because that's effectively what a tool looks like when nobody's thought about response size yet. I called the raw, unshaped /articles/me/published?per_page=30 endpoint directly against my own account (174+ published articles at this point) and measured the actual bytes: raw = dev_get("/articles/me/published?per_page=30")
data = json.loads(raw)
avg = len(raw) / len(data)
raw per_page=30: 243050 bytes for 30 articles, avg 8101.7 bytes/article
8.1KB per article, raw, unfiltered. DEV.to's article objects carry full HTML-rendered body previews, cover image URLs, full tag objects, user objects, organization objects, all of it, for every single item in the page. DEV.to's own API caps per_page at 1000. Running that average out to the actual ceiling: for pp in [100, 500, 1000]:
print(f"{pp}: {avg*pp/1_000_000:.2f} MB")
100: 0.81 MB
500: 4.05 MB
1000: 8.10 MB
8.10MB at per_page=1000. The trending post's crash number is 8MB. I didn't pick my test account or my test endpoint to hit that figure, it just landed there, because an average content-heavy REST API object times a four-digit page size gets you into single-digit megabytes pretty reliably regardless of which SaaS you're calling. That's the actual lesson underneath the trending post's specific anecdote: 8MB isn't a magic crash threshold tied to one service, it's roughly what you get the first time nobody puts a ceiling on per_page for an API that returns rich objects. Then I checked what my own tool's two guards actually buy me, on the exact same 30 articles: shaped_bytes = len(json.dumps(shaped_list).encode())
shaped (7 fields only): 8681 bytes for 30 articles, avg 289.4 bytes/article
raw: 243050 bytes, avg 8101.7 bytes/article
reduction: 96.4%
Stripping to id, title, published, url, reactions, comments, page_views cuts the per-article footprint by 96%. And because per_page is hard-capped at min(per_page, 30) before the request is even sent, calling list_articles(per_page=1000) today doesn't scale toward 8MB at all. It silently clamps to 30 articles and returns 8.7KB total, not 8MB. I hadn't verified that cap was actually load-bearing until I ran this; it was written for a different reason back in August (the un-suffixed /articles/me endpoint truncating drafts ahead of real posts, logged in bugs.md 2026-08-07), and it turns out to double as the thing standing between this tool and the exact failure mode the trending post describes. The second thing I wanted to check was the "prompt cache misses" half of that post's title: the idea that even an unchanged tool call can bust yo...

Powered by Readybot.io