Fetch URLs and convert HTML to sanitized markdown with multi-layer prompt injection defenses and metadata extraction.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Fetch Guard.
An MCP server and CLI tool that fetches URLs and returns clean, LLM-ready markdown. A purpose-built extraction pipeline sanitizes HTML, pulls structured metadata, detects prompt injection attempts, and handles the edge cases that break naive fetchers: bot blocks, paywalls, login walls, non-HTML content types, and pages that require JavaScript to render.
The core problem is straightforward: LLMs need web content, but raw HTML is noisy and potentially hostile. Fetched pages can contain hidden text, invisible Unicode, off-screen elements, and outright prompt injection attempts embedded in the content itself. This pipeline strips all of that before the content reaches the model.
Three layers handle the injection defense specifically:
display:none, visibility:hidden, opacity:0, font-size:0, transform:scale(0), clip:rect(0,0,0,0), zero-height overflow containers, and elements with matching foreground and background colors), elements hidden via CSS class/ID rules in <style> tags, off-screen positioned content, aria-hidden elements, <noscript> and <template> tags, and 26 categories of non-printing Unicode characters including bidi isolates and Unicode Tags. This happens before content extraction, so trafilatura never sees the attack vectors.<fetch-content-{salt}> tags. Since the salt is unpredictable, injected content cannot spoof the wrapper boundaries.This is a single-tool MCP server. It exposes one tool โ fetch โ that runs a full extraction pipeline behind a consistent interface. No tool selection, no routing, no multi-step workflows. One URL in, one structured result out, configurable via parameters.
For JavaScript rendering (optional):
Add the following to your MCP client config. Works with Claude Code, Claude Desktop, Cursor, or any MCP-compatible client.
Via uvx (recommended):
Via pip install:
From source:
Via Docker:
Note: The Docker image does not include Playwright. JavaScript rendering (
js: true) is not available when running via Docker. Use theuvxorpipinstall if you need JS rendering.
Ask your AI assistant to fetch any URL. If it returns structured content with a status header, metadata, and risk assessment, you're connected.
| Flag | Default | Description |
|---|---|---|
--timeout N | 180 | Request timeout in seconds |
--max-words N | none | Word cap on extracted body content. Also disables the automatic size guard |
--js | off | Use Playwright for JS-rendered pages |
--strict | off | Exit code 2 on high-risk injection |
--links MODE | domains | domains for unique external domains, full for all URLs with anchor text |
--header KEY:VALUE | none | Custom HTTP header (repeatable) |
The MCP fetch tool accepts these parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | required | The URL to fetch |
timeout | integer | 180 | Request timeout in seconds. Ensures the tool always returns โ no hanging fetches |
max_words | integer | none | Word cap on extracted body content. Also disables the automatic size guard โ use when you want explicit control over truncation without hitting the default limits |
strict | boolean | false | When true and high-risk injection is detected, the response is marked as an error |
js | boolean | false | Use Playwright for JavaScript-rendered pages (requires fetch-guard[js]) |
links | "domains" | "full" | "domains" | "domains" for unique external domains, "full" for all URLs with anchor text |
auth_token | string | none | Bearer token for the Authorization header (e.g. "my-api-key"). Use for GitHub's authenticated API and other endpoints requiring auth |
headers | object | none | Deprecated. Use auth_token instead. Will be removed in the next release |
Copy resources/fetch-guard/ to .claude/skills/fetch-guard/ in your project, or use the standalone command file resources/fetch-guard.md as a Claude Code command.
The pipeline runs a 13-step sequence from URL to structured output:
/llms.txt preflight. Checks the domain root for /llms.txt before the full fetch. If the requested URL is a domain root and /llms.txt exists, that content replaces the normal HTML pipeline entirely. This respects the emerging convention for LLM-friendly site summaries.
Fetch. Static HTTP request via requests, or Playwright-driven browser rendering if --js is set. No automatic fallback between the two: --js is explicit opt-in.
Edge detection. Classifies the response for bot blocks (Cloudflare challenges, 403/429/503 with block signatures, LinkedIn's custom 999), paywalls (subscription prompts, premium overlays), and login walls (sign-in redirects, members-only patterns).
Automatic retry. Bot blocks trigger one retry with a full Chrome User-Agent string before reporting. Paywalls and login walls are reported immediately with no retry.
Content-type routing. Non-HTML responses get a fast path: JSON is rendered as a fenced code block, RSS/Atom feeds are parsed into structured summaries, CSV becomes a markdown table (capped at 2,000 rows), and plain text passes through directly. Binary content types are rejected.
HTML sanitization. Strips hidden elements (including extended CSS visibility techniques, color-matched text, and <template> tags), off-screen positioned content, aria-hidden nodes, <noscript> tags, and non-printing Unicode. Returns a tally of everything removed.
Content extraction. trafilatura converts sanitized HTML to markdown with link preservation.
Metadata extraction. Pulls title, author, date, description, canonical URL, and image from three sources in priority order: JSON-LD, Open Graph, then meta tags.
Link extraction. Two modes: domains returns a sorted list of unique external domains, full returns all external URLs grouped by domain with anchor text.
Injection scanning. Four-phase scan: original text against all 50 patterns (English + 6 additional languages), NFKC-normalized text for homoglyph bypasses, decode-and-scan for base64/hex/URL-percent-encoded payloads, and ROT13 whole-document scan. Metadata fields are scanned independently with matches namespaced to their source field. Each match records the pattern name, severity (high/medium), and a 60-character context snippet.
Size guard + truncation. By default, content over 2MB (pre-extraction) or 20KB (post-extraction) raises an error with a suggested max_words value. Setting --max-words disables both limits and truncates instead โ use it when you want explicit control over what reaches the model.
Salt wrapping. The body gets wrapped in session-salted tags for defense-in-depth.
Output formatting. CLI produces five plaintext sections (status header, body, metadata, links, injection details). MCP server returns a structured JSON dict with the same data.
Five sections, printed to stdout:
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/erodenn-fetch-guard)<a href="https://allmcps.com/mcp/erodenn-fetch-guard"><img src="https://allmcps.com/api/badge/erodenn-fetch-guard?style=directory" alt="Fetch Guard on AllMCPs" /></a>