Back to browse
GitHub Repository
2 starsGo

Save Context from MCP Bloat

by healqq·May 17, 2026·2 points·0 comments

AI Analysis

●●SolidBig BrainSolve My Problem

Caches bloated MCP responses and lets agents query with jq, saving real tokens.

Strengths
  • Response-size threshold triggers caching automatically without code changes
  • seek_result tool with jq/grep filters extracts only needed data
  • Works with both local stdio and remote HTTP MCP servers
Weaknesses
  • Niche audience limited to developers actively using MCP protocol
  • Added proxy layer introduces latency for small responses under threshold
Category
Target Audience

Developers building AI agents with MCP servers

Similar To

MCP Registry · LangChain tool caching

Post Description

While doing some work recently I didn't notice that a project I didn't touch for a while was using playwright-mcp instead of playwright-cli. I only noticed it because context was getting full unreasonably fast. I've realized that one of the main differences is that agent would pipe CLI results to some filter right away, but this was not possible with MCP, so it would get whole a11y snapshot of the page every time.

I've created a small wrapper for MCP servers that checks response sizes and forces agent to use filter on the response if response is large enough. In my tests (https://github.com/healqq/mcp-content-guard/blob/main/bench/...) it managed to save a decent amount of tokens while solving certain tasks (while added a bit of overhead in other tasks).

It works with both local and remote MCPs. Would be happy to hear your feedback and if that could be valuable for you!

Similar Projects