Automatically rewrites Bitbucket URLs to their raw content versions to extract clean, readable text from code repositories.
Automatically rewrites GitHub and Gist URLs to their raw content versions to extract clean, readable text from code repositories.
Automatically rewrites GitLab URLs to their raw content versions to extract clean, readable text from code repositories.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@superFetch MCP Serverfetch and clean the content from https://www.wired.com/story/ai-chip-wars/"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SuperFetch MCP Server
Fetch and convert public web pages to clean, AI-friendly Markdown via MCP.
Overview
SuperFetch is a Node.js MCP server that fetches public HTTP(S) pages, extracts primary content, and converts it into clean Markdown. It runs either as a stdio MCP server (for local clients) or as a Streamable HTTP MCP server with auth, cache, and SSRF protections.
Key Features
HTML to Markdown using Mozilla Readability + node-html-markdown.
Raw content URL rewriting for GitHub, GitLab, Bitbucket, and Gist.
In-memory LRU cache exposed as MCP resources and HTTP download endpoints.
Stdio or Streamable HTTP transport with session management.
SSRF protections: blocked private IP ranges and internal hostnames.
Tech Stack
Runtime: Node.js >= 20.18.1 (engines)
Language: TypeScript 5.9.3 (dev dependency)
MCP SDK: @modelcontextprotocol/sdk ^1.25.3
HTML processing: @mozilla/readability ^0.6.0, linkedom ^0.18.12
Markdown conversion: node-html-markdown ^2.0.0
HTTP client: undici ^7.19.2
Validation: zod ^4.3.6
Package manager: npm (package-lock.json)
Architecture
Fetch pipeline (simplified):
Validate and normalize the URL (http/https only, max length 2048).
Block internal hosts and private IP ranges.
Rewrite supported repo URLs to raw content.
Fetch HTML with undici (15s timeout, 10 MB max, 5 redirects).
Extract main content with Readability + DOM cleanup.
Convert to Markdown, inject metadata, and return via MCP.
Cache the result and expose it as a resource or download.
Repository Structure
Requirements
Node.js >= 20.18.1
npm (uses package-lock.json)
Quickstart (stdio)
Example MCP client configuration:
Installation
NPX (recommended)
Global install
From source
Configuration
SuperFetch is configured entirely via environment variables. Set them in your
MCP client configuration (the env field) or in the shell before starting the
server. For the full reference, see CONFIGURATION.md.
Runtime modes
Mode | Flag | Description |
Stdio |
| Communicates via stdin/stdout. No HTTP server. |
HTTP | (default) | Starts an HTTP server. Requires static token(s) or OAuth to be set. |
CLI arguments
Argument | Type | Default | Description |
| boolean | false | Run in stdio mode (no HTTP server). |
Core server settings
Variable | Default | Description |
|
| HTTP bind address. |
|
| HTTP port (1024-65535, |
|
| User-Agent for outbound requests. |
|
| Enable in-memory cache. |
|
| Cache TTL in seconds (60-86400). |
|
| Logging level ( |
|
| Allow non-loopback binds (OAuth required). |
| (empty) | Additional allowed Host/Origin values (comma/space separated). |
|
| Worker transform timeout in ms (5000-120000). |
|
| Emit warnings when stage exceeds ratio of timeout. |
| computed | Overall tool timeout in ms (1000-300000). |
|
| Metadata format: |
|
| Comma/space-separated list of enabled tools. |
| (empty) | Extra noise tokens for DOM noise removal. |
| (empty) | Extra CSS selectors for DOM noise removal. |
TOOL_TIMEOUT_MS defaults to 15s fetch + TRANSFORM_TIMEOUT_MS + 5s.
HTTP server tuning (optional)
Variable | Default | Description |
| (unset) | Sets |
| (unset) | Sets |
| (unset) | Sets |
|
| Close idle connections on shutdown. |
|
| Close all connections on shutdown. |
Auth (HTTP mode)
Variable | Default | Description |
| auto |
|
| (empty) | Comma/space-separated static bearer tokens. |
| (empty) | Adds a static bearer token and enables |
Static mode requires at least one token (ACCESS_TOKENS or API_KEY).
OAuth (HTTP mode)
Required when AUTH_MODE=oauth (or auto-selected by OAuth URLs):
Variable | Default | Description |
| - | OAuth issuer. |
| - | Authorization endpoint. |
| - | Token endpoint. |
| - | Introspection endpoint. |
Optional:
Variable | Default | Description |
| - | Revocation endpoint. |
| - | Dynamic client registration endpoint. |
|
| Protected resource URL. |
| (empty) | Required scopes (comma/space separated). |
| - | Client ID for introspection. |
| - | Client secret for introspection. |
|
| Introspection timeout (1000-30000). |
Usage
Stdio (local MCP clients)
HTTP server (local only, static token)
Requires npm run build before npm start when running from source.
Remote bindings require ALLOW_REMOTE=true and OAuth configuration.
MCP Surface
Tools
fetch-url
Fetches a webpage and converts it to clean Markdown.
Parameters:
Name | Type | Required | Description |
| string | Yes | Public http(s) URL, max length 2048. |
Structured response fields:
url(string): fetched URLinputUrl(string, optional): original input URLresolvedUrl(string, optional): normalized or raw-content URLtitle(string, optional): page titlemarkdown(string, optional): inline markdown (may be truncated)error(string, optional): error message on failure
Limitations:
Only http/https URLs are accepted; URLs with embedded credentials are rejected.
Client-side JavaScript is not executed.
Large content handling:
Inline markdown is capped at 20,000 characters.
If cache is enabled and content exceeds the inline limit, the tool response includes a
resource_linkblock pointing tosuperfetch://cache/markdown/{urlHash}.If cache is disabled, inline markdown is truncated with
...[truncated].In stdio mode, the tool also embeds a
resourceblock containing full markdown content when available.
Resources
URI pattern | Description | MIME type |
| Cached markdown content entry. |
|
| Server usage instructions. |
|
| Current runtime config (secrets redacted). |
|
Prompts
summarize-webpage(registered whenfetch-urlis enabled)
Tasks
fetch-url supports async execution via MCP tasks. Call tools/call with a
task payload to start a background fetch, then use tasks/get,
tasks/result, or tasks/cancel to manage it.
HTTP Mode Endpoints
Method | Path | Auth | Notes |
GET |
| No | Health check. |
POST |
| Yes | Streamable HTTP JSON-RPC requests. |
GET |
| Yes | SSE stream (requires |
DELETE |
| Yes | Close the session. |
GET |
| Yes | Download cached markdown. |
Notes:
HTTP requests must include
MCP-Protocol-Version: 2025-11-25.Sessions are managed via the
mcp-session-idheader.
Client Configuration Examples
Add to .vscode/mcp.json:
Add to claude_desktop_config.json:
Development Workflow
Install dependencies
Use npm ci for clean, reproducible installs.
Common scripts
Script | Command | Purpose |
clean |
| Remove dist and TS build info. |
validate:instructions |
| Validate |
build |
| Compile TS, copy assets, set exec bit |
copy:assets |
| Copy assets/instructions to dist. |
prepare |
| Prepare package for publishing. |
dev |
| TypeScript watch mode. |
dev:run |
| Run compiled server in watch mode. |
start |
| Start HTTP server (default). |
format |
| Format codebase. |
type-check |
| Type checking. |
type-check:diagnostics |
| Type check diagnostics. |
type-check:trace |
| Generate TS trace. |
lint |
| Lint. |
lint:fix |
| Lint and fix. |
test |
| Run tests (builds first). |
test:coverage |
| Test with coverage. |
knip |
| Dead code analysis. |
knip:fix |
| Fix knip issues. |
inspector |
| MCP Inspector. |
prepublishOnly |
| Prepublish checks. |
Build and Release
npm run buildrunsscripts/build.mjs, compiling TS withtsconfig.build.json, copyingassets/andsrc/instructions.mdtodist/, and makingdist/index.jsexecutable.GitHub Releases trigger the publish workflow (lint, type-check, build, version sync, then
npm publish).
Troubleshooting
Tests import from
dist/. Runnpm test(builds first) ornpm run buildbefore running individual test files.HTTP mode requires auth. Set
API_KEYorACCESS_TOKENS(or configure OAuth).Non-loopback bindings require
ALLOW_REMOTE=trueand OAuth configuration.Missing
MCP-Protocol-Version: 2025-11-25yields a 400 error.Large pages may return a
resource_linkto cached content instead of inline markdown.Requests to private IPs, localhost, or
.local/.internalhosts are blocked.