MCP Web Reader Server Setup for Claude Desktop, Cursor & Antigravity
Give any MCP-compatible AI agent a deterministic, SSRF-safe `read_webpage` tool backed by CleanSnap's extraction Micro-API.
Why this breaks in production
Model Context Protocol (MCP) lets desktop and IDE agents invoke external tools seamlessly. However, stock `fetch` MCP servers often dump raw HTML or blow through context limits when an agent visits a bloated SaaS homepage.
Pointing your MCP web reader tool at CleanSnap's `/api/v1/extract` endpoint guarantees that every URL the agent reads arrives pre-cleaned, token-counted, and stripped of cookie modals and nav noise.
Recommended Engineering Approach
Generate your MCP server JSON block from the Playground
Configure your preferred defaults (`stripCookieBanners`, `stripNav`, `maxChars`) and copy the MCP Server Config tab.
Register the server in Claude Desktop or Cursor settings
Paste the `mcpServers.cleansnap` entry into `claude_desktop_config.json` or `.cursor/mcp.json`.
Cap `maxChars` to protect multi-turn agent memory
Setting `CLEANSNAP_MAX_CHARS=14000` (~3,500 tokens) lets an agent inspect 5+ webpages in one conversation without triggering context compaction.
Working Code Example
{
"mcpServers": {
"cleansnap-web-reader": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://usecleansnap.com/api/v1/extract"],
"env": {
"CLEANSNAP_ENDPOINT": "https://usecleansnap.com/api/v1/extract",
"CLEANSNAP_STRIP_COOKIES": "true",
"CLEANSNAP_STRIP_NAV": "true",
"CLEANSNAP_MAX_CHARS": "16000"
}
}
}
}Test this workflow in the CleanSnap Playground
Pre-load the Sample Docs Page or paste your own URL to inspect clean Markdown, token savings, and auto-generated cURL / Node / Python / MCP code.
Common Edge Cases & Pitfalls
- Allowing an agent to pass unvalidated URLs to a local MCP fetch tool creates an internal network SSRF vulnerability — always enforce private-IP blocking.
- Returning 60,000-character raw pages from an MCP tool immediately saturates smaller context windows and spikes API latency.
- Always include `metadata.title` and `finalUrl` in the tool response so the agent cites accurate sources.
Frequently Asked Questions
Which AI clients support MCP server configs?
Claude Desktop, Cursor, Windsurf, Cline, Zed, and Antigravity all support standard `mcpServers` JSON configurations.
Why use CleanSnap instead of a raw HTTP fetch MCP tool?
Raw fetch tools return raw HTML scripts, styles, and cookie banners. CleanSnap returns clean Markdown + metadata + token counts, cutting prompt tokens by up to 88%.
Can I call CleanSnap directly from an OpenAI or Anthropic tool handler?
Yes — simply wrap `POST /api/v1/extract` in a 10-line function tool in TypeScript or Python.