Skip to content
All projects
← Products

MCP servers

mcp-web-reader

Web pages as clean Markdown, with SSRF protection and robots.txt support.

An MCP server that lets Claude read web pages as clean Markdown — article extraction (Mozilla Readability), tables, absolute links — with the guard rails a tool that fetches model-chosen URLs needs.

  • SSRF protection on by default. Blocks localhost, private ranges, link-local/cloud-metadata (169.254.169.254), CGNAT, IPv6 loopback/ULA, IPv4-mapped IPv6 and NAT64. Hostnames are validated at connect time (defeats DNS rebinding) and every redirect hop is re-validated.
  • Polite. Honours robots.txt, identifies itself with a clear User-Agent.
  • Bounded. Response size cap, request timeout, redirect limit, content-type allowlist (text/HTML/JSON/XML only).
  • Paginated. Long pages are read in pieces with start_index.
  • Honest about failures. 4xx/5xx responses come back as errors with the status, not as page content (allow_error_status reads the error page anyway). Bot checks from Vercel, Cloudflare, Imperva, DDoS-Guard and AWS WAF are named as such, with a note that retrying will not help.
  • Pure JS, no browser, no native dependencies. (Pages that need JavaScript to render are not supported.)

Quick start

{
  "mcpServers": {
    "web": { "command": "npx", "args": ["-y", "@aranshayan/mcp-web-reader"] }
  }
}

Claude Code: claude mcp add web -- npx -y @aranshayan/mcp-web-reader. Requires Node.js 22+.

Tools

ToolDescription
fetch_pagePage → Markdown (or text). Options: main_content, max_chars, start_index, allow_error_status.
extract_linksUnique absolute http(s) links, optionally same-domain only.
page_metadataTitle, description, canonical URL, language, Open Graph.

All tools are readOnlyHint. Fetched content is untrusted: the server instructs the model to treat it as data, not instructions, but prompt injection remains a risk with any web-reading tool — pair it with --allowed-domains for sensitive agents.

Options

FlagDefault
--allow-privateoffPermit localhost / private networks (for local docs sites).
--ignore-robotsoffSkip robots.txt. Only with permission.
--allowed-domains a.com,b.organyRestrict to these domains and subdomains.
--blocked-domains …noneNever fetch these.
--timeout-ms15000Per request.
--max-bytes5 MiBMax download size.
--user-agentmcp-web-reader/x (+repo)

Environment: MCP_WEB_ALLOW_PRIVATE, MCP_WEB_IGNORE_ROBOTS, MCP_WEB_ALLOWED_DOMAINS, MCP_WEB_BLOCKED_DOMAINS.

Tests

npm test covers the IP classifier (IPv4/IPv6 edge cases), URL policy, extraction, pagination, size/type limits, robots.txt, redirect loops, proof that blocked requests never reach the server, and the built CLI over stdio. Against the live internet, npm run build && npm run smoke reads 12 stable public pages (docs sites, a large RFC, a redirect, a JSON API) through the built CLI and checks each one. The "Live smoke test" workflow runs it weekly and on demand, never on pull requests, so a site that is down cannot block a merge. The list is in scripts/smoke-sites.json.

License

MIT

From the README on GitHub, commit 7dcbc13, . Found a mistake? Open an issue.