Show HN: Save Context from MCP Bloat

healqq1 pts0 comments

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!

while main response save context didn

Related Articles