Over the past few months I've been using Claude Code heavily with Playwright and Figma.
At first everything worked well, but after longer sessions I started noticing a few recurring problems:
- Playwright browser snapshots were consuming hundreds of KB of context.
- Figma responses often contained much more information than the agent actually needed.
- Browser sessions occasionally crashed, forcing the agent to start over.
None of these problems were caused by the MCP servers themselves.
They were simply returning everything they were designed to return.
The issue was that AI agents pay for every token they receive.
The Idea
Instead of modifying every existing MCP server, I wondered:
What if there was a transparent proxy between the AI agent and the MCP server?
That idea became PlayGuard.
AI Agent
│
▼
PlayGuard
│
▼
Playwright MCP / Figma MCP / ...
The proxy intercepts requests and responses before they reach the agent.
This makes it possible to optimize them without changing the original MCP server.
What PlayGuard Does
Current features include:
- Response optimization for Playwright
- Response optimization for Figma
- Automatic Playwright session recovery
- Response caching
- Configurable optimization rules
- Plugin architecture for additional MCP servers
The goal is simple:
Make existing MCP servers more efficient for AI agents.
Why It Matters
Large language models have limited context windows.
If an MCP server returns 300–500 KB of data every time the agent asks for a browser snapshot, that context disappears quickly.
By removing unnecessary information before it reaches the model, the agent can spend more of its context on reasoning instead of processing redundant data.
Design Philosophy
PlayGuard is intentionally transparent.
It doesn't replace MCP servers.
It doesn't require modifying existing tools.
It simply sits in the middle and optimizes communication.
That also means new optimizations can be added over time without requiring changes to Playwright, Figma, or other MCP implementations.
Roadmap
Some ideas I'm currently working on:
- More MCP integrations
- Better optimization pipelines
- Performance benchmarks
- Custom optimization plugins
- More intelligent caching
Feedback Welcome
The project is open source, and I'd appreciate any feedback or ideas.
GitHub:
https://github.com/ZenyaDAR/PlayGuard
Website:
https://zenyadar.github.io/PlayGuard/
If you find the project useful, consider giving it a ⭐ on GitHub. It helps other developers discover the project.
Top comments (0)