Fetch

Web search and scraping

A flexible HTTP fetching Model Context Protocol server.

Your AI app calls the Fetch MCP server, which does the work through tools like fetch_html, fetch_markdown, fetch_readable and fetch_text and sends the result back to the chat.

About Fetch

Fetch is a community MCP server from zcaceres, filed in our directory under web search and scraping. A flexible HTTP fetching Model Context Protocol server.

Fetch runs on your own machine: your AI app starts it with the command npx -y mcp-fetch-server and talks to it over standard input and output.

The README for Fetch lists tools such as fetch_html, fetch_markdown, fetch_readable and fetch_text, which your AI app can call once the server is connected.

At a glance

Publisher
zcaceres (community)
Runs
Locally on your machine
Install from
Node.js package on npm: mcp-fetch-server
Written in
TypeScript
License
MIT
GitHub stars
835

Tools Fetch gives your AI app

  • fetch_html, Fetch a URL and return its unmodified HTML content.
  • fetch_markdown, Fetch a URL, strip <script> and <style>, and convert to Markdown.
  • fetch_readable, Extract the main article content using Mozilla Readability, convert to Markdown, and prepend # <title> when present.
  • fetch_text, Fetch a URL, strip <script> and <style>, and return normalized plain text.
  • fetch_json, Fetch a JSON resource, validate via JSON.parse, and return compact JSON.
  • fetch_transcript, Fetch a YouTube video's captions (tries local yt-dlp first with manual and auto-generated subtitles enabled, falling back to direct watch-page + caption XML e

Tool names as the Fetch README lists them. Your AI app shows the live list once Fetch is connected.

How to set up Fetch

  1. Install Node.js on the machine that runs your AI app, because Fetch starts with npx and downloads its package on first run.
  2. Check the Fetch README for keys or settings; the registry lists none that Fetch requires.
  3. Add Fetch to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Fetch tools to confirm the connection.
  5. Run one read-only task with Fetch first, such as a call to fetch_html, before you allow anything that writes or sends.

Fetch compared with similar servers

  • Kagimcp by kagisearch has fewer GitHub stars than Fetch (582 against 835); Kagimcp is official while Fetch is a community server, and both run locally. The Kagimcp README lists 2 tools to Fetch's 6.
  • Glean by LeslieLeung has more GitHub stars than Fetch (877 against 835); both are community servers, and both run locally.
  • Ask Search by ythx-101 has fewer GitHub stars than Fetch (539 against 835); both are community servers, and both run locally.

Before you connect Fetch

  • Give Fetch its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Fetch tool call until you trust what it does with them.
  • Treat text that Fetch fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Fetch on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Fetch

How marketing and sales teams put Fetch to work, by company size. Pick the size closest to yours and start Fetch on one use case.

Small business

  • A founder can use Fetch to research a market or a prospect in minutes, with sources cited, before a pitch or a pricing change.
  • Small teams can ask Fetch what competitors launched this month and get the pages, not just a summary.
  • Fetch runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can use Fetch to gather fresh data for content, such as stats, quotes and examples, with each source linked for checking.
  • Outbound teams can connect Fetch to research accounts from public pages and add one specific line to each first email.
  • Start with fetch_html and fetch_markdown, the tools Fetch lists first, and add more once the team trusts the results.

Enterprise

  • Enterprise research and competitive intel teams can schedule Fetch to monitor many sources, with results stored and cited for review.
  • Large orgs can route Fetch through approved providers and respect each site's terms, keeping scraping inside legal guidance.
  • Fetch is a community server, so have security review the code and pin a version before Fetch touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Fetch README

From zcaceres/fetch-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Fetch MCP

Fetch the public web in agent-ready formats. A lightweight, agent-friendly MCP server (mcp-fetch-server, supporting stdio and 2025-11-25 Streamable HTTP) and local CLI (mcp-fetch) for HTML, Markdown, Mozilla Readability articles, plain text, JSON, and YouTube transcripts, with custom headers, HTTP/SOCKS proxies, pagination, and built-in SSRF protection. Supports Node.js >= 22 LTS and Bun.

Docs: fetch.zach.dev · LLM-friendly docs: fetch.zach.dev/llms.txt

What's New & Breaking Changes in v2.0.0

Highlights
  • MCP 2025-11-25 Streamable HTTP transport: run mcp-fetch-server --http [--host 127.0.0.1] [--port 3000] to serve stateless MCP on POST /mcp with Host/Origin DNS-rebinding guards.
  • Cross-vendor MCP conformance: all tool schemas include MCP 2025-11-25 read-only annotations, additionalProperties: false, and typed headers for clean compatibility across Claude, Gemini, and OpenAI MCP clients.
  • Expanded proxy support: zero-dependency http, https, socks4, socks4a, socks5, socks5h, and bare host:port proxies with NO_PROXY support (including :port and [ipv6]:port) and mandatory credential redaction.
Breaking Changes
  • Aligned MCP tool names: fetch_txt → fetch_text, fetch_youtube_transcript → fetch_transcript.
  • Aligned CLI subcommands: txt → text, youtube → transcript, plus repeatable --header <Key:Value>. --lang is now accepted only on transcript and rejected on web subcommands.
  • Strict MCP argument validation: unexpected tool parameters (including any caller-supplied proxy key) are now rejected with isError: true instead of being silently ignored.
  • Fail-fast configuration: invalid DEFAULT_LIMIT, MAX_RESPONSE_BYTES, or proxy URLs now fail explicitly instead of silently falling back to defaults or direct connections.
  • Explicit missing caption language: requesting an unavailable YouTube transcript language now fails explicitly and lists the available language codes.
  • Runtime floor: requires Node.js >= 22 LTS or Bun.

MCP Tools

All six tools conform to MCP 2025-11-25, carry read-only annotations (readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true), enforce strict additionalProperties: false, and accept the following common parameters (proxy routing for MCP is strictly Operator-configured via environment variables and can never be supplied by an Agent):

Parameter Type Required Description
url string Yes Public http: or https: URL to fetch
headers Record<string, string> No Optional custom request headers
max_length number No Maximum characters to return (default: DEFAULT_LIMIT / 5000; 0 = unlimited)
start_index number No Start content from this character index (default: 0; returns "" if at or past output length)
  • fetch_html, Fetch a URL and return its unmodified HTML content.
  • fetch_markdown, Fetch a URL, strip <script> and <style>, and convert to Markdown.
  • fetch_readable, Extract the main article content using Mozilla Readability, convert to Markdown, and prepend # <title> when present.
  • fetch_text, Fetch a URL, strip <script> and <style>, and return normalized plain text.
  • fetch_json, Fetch a JSON resource, validate via JSON.parse, and return compact JSON.
  • fetch_transcript, Fetch a YouTube video's captions (tries local yt-dlp first with manual and auto-generated subtitles enabled, falling back to direct watch-page + caption XML extraction). Returns a [Transcript language: ...] header followed by [m:ss] timestamped lines. Accepts an optional lang parameter (default: "en"), and lists available language codes if the requested language is unavailable.

Installation

As an MCP server (stdio)

Add to your MCP client configuration (Claude Code, Claude Desktop, Gemini CLI, etc.):

{
  "mcpServers": {
    "fetch": {
      "command": "npx",
      "args": ["mcp-fetch-server"]
    }
  }
}
As a Streamable HTTP MCP server

Start the server on localhost (defaults to 127.0.0.1:3000):

npx mcp-fetch-server --http --host 127.0.0.1 --port 3000
Flag Default Description
--http (off, uses stdio) Enable stateless MCP 2025-11-25 Streamable HTTP transport on POST /mcp
--host <addr> 127.0.0.1 Bind address (requires --http)
--port <n> 3000 Listen port 1–65535 (requires --http)

Requests to /mcp validate Host and Origin headers against the bound address (403 on mismatch to block localhost DNS rebinding). Unknown paths (including legacy /sse) return 404, and non-POST methods return 405.

Connect any Streamable HTTP MCP client to http://127.0.0.1:3000/mcp, for example, with MCP Inspector:

npx @modelcontextprotocol/inspector --url http://127.0.0.1:3000/mcp
As a CLI
npx -p mcp-fetch-server mcp-fetch <command> <url> [flags]

Or install globally:

npm install -g mcp-fetch-server
mcp-fetch <command> <url> [flags]

CLI Usage

mcp-fetch <command> <url> [flags]
Commands
Command Description
html Fetch a URL and return raw HTML
markdown Fetch a URL and return Markdown
readable Fetch a URL and return article content as Markdown (via Readability)
text Fetch a URL and return plain text
json Fetch a URL and return JSON
transcript Fetch a YouTube video transcript
Flags
Flag Description
--header <Key:Value> Custom request header (repeatable)
--max-length <N> Maximum characters to return (0 = unlimited)
--start-index <N> Start from this character index
--proxy <URL> Proxy URL (http, https, socks4, socks4a, socks5, socks5h, or bare host:port; bypasses NO_PROXY)
--lang <code> Language code for YouTube transcripts (only valid with transcript; default: en)
--help Show help message
--version Show version
Examples
# Fetch a page as markdown
mcp-fetch markdown https://example.com

# Extract article content without boilerplate
mcp-fetch readable https://example.com/blog/post

# Get a YouTube transcript in English (quote URLs containing '?' in zsh)
mcp-fetch transcript 'https://www.youtube.com/watch?v=jNQXAC9IVRw' --lang en

# Fetch with custom headers and a length limit
mcp-fetch html https://example.com --header "Accept-Language: en-US" --max-length 10000

# Fetch through an HTTP or SOCKS5 proxy
mcp-fetch json https://api.example.com/data --proxy socks5://127.0.0.1:1080

Environment Variables

mcp-fetch-server validates DEFAULT_LIMIT and MAX_RESPONSE_BYTES fail-fast at startup (writing the error to stderr and exiting 1 if invalid).

Variable Description
DEFAULT_LIMIT Default character limit for responses (default: 5000; 0 = unlimited; fails explicitly if invalid)
MAX_RESPONSE_BYTES Maximum raw and decompressed response body size in bytes (default: 10485760 / 10 MB; positive integer; fails explicitly if invalid)
HTTPS_PROXY / https_proxy Proxy URL for https:// requests (http, https, socks4, socks4a, socks5, socks5h, or bare host:port)
HTTP_PROXY / http_proxy Proxy URL for http:// requests (fallback for https://)
ALL_PROXY / all_proxy Fallback proxy URL for HTTP/HTTPS requests
NO_PROXY / no_proxy Comma-separated hostnames, .domain / *.domain suffixes, :port entries, [ipv6]:port, or * bypassing Operator env proxies (non-empty NO_PROXY takes precedence over no_proxy)

Example with custom limits and an Operator proxy:

{
  "mcpServers": {
    "fetch": {
      "command": "npx",
      "args": ["mcp-fetch-server"],
      "env": {
        "DEFAULT_LIMIT": "50000",
        "HTTPS_PROXY": "socks5://127.0.0.1:1080"
      }
    }
  }
}

Security & Reliability

  • SSRF Protection: Restricts all requests and redirect hops to http:/https:, blocks localhost/*.localhost and all IANA-reserved IPv4/IPv6 ranges (including IPv4-mapped IPv6 and multicast), fails closed on malformed IPs or DNS failures, pins validated DNS records directly to sockets on direct connections to prevent DNS rebinding, and delegates public hostname DNS to the proxy when proxied.
  • MCP Transport & Trust Boundary: An Agent calling an MCP tool can never supply or override proxy routing (additionalProperties: false rejects unexpected parameters such as a smuggled proxy key before any network I/O); Streamable HTTP defaults to 127.0.0.1 and validates Host and Origin headers to block localhost DNS rebinding.
  • Header & Redirect Hygiene: Strips Authorization, Cookie, and Proxy-Authorization across cross-origin redirects and cross-origin YouTube caption URLs, caps redirects at 10 hops, rejects CR/LF and invalid header characters, and redacts proxy credentials from all error and diagnostic output.
  • Resource Safety: Enforces MAX_RESPONSE_BYTES across declared Content-Length, streaming wire bytes, decompressed gzip/deflate/br streams, and yt-dlp subtitle files; rejects clearly binary Content-Type responses; enforces a 30s single-attempt timeout.
  • YouTube Isolation: Restricts fetch_transcript / mcp-fetch transcript to allowlisted YouTube hosts, validates lang codes strictly, passes -- end-of-options sentinel to yt-dlp, and never swallows validation or SSRF errors into fallback.

Development

bun install
bun run lint                       # Biome lint & formatting check
bun run typecheck                  # TypeScript typecheck
bun run build                      # Build dist/index.js and dist/cli.js
bun test                           # Unit, integration, scenario, and offline replay matrix tests
bun run harness                    # Interactive DD harness (type help)
bun run harness run scenarios      # Replay all DD harness scenarios
bun run verify:replay              # Run 3-form-factor offline cassette replay (CLI, stdio, Streamable HTTP)
bun run verify:live                # On-demand live-internet verification across all 3 form factors (add -- --record to refresh cassettes)

More MCP & CLI Projects

  • markdownify-mcp, Convert PDFs, Office docs, images, audio, web pages, and Git repositories into clean Markdown over MCP.
  • gtasks-mcp, Google Tasks MCP server for managing task lists and to-dos from AI agents.
  • spotify-cli, Control Spotify playback, search tracks, and manage playlists from your AI agent or terminal.
  • builtwith-mcp, Query website technology stacks via BuiltWith over MCP or the CLI.

License

This project is licensed under the MIT License.

Questions about Fetch

What is the Fetch MCP server?

A flexible HTTP fetching Model Context Protocol server. Fetch is maintained by zcaceres on GitHub at zcaceres/fetch-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Fetch MCP server?

Add Fetch to your AI app's MCP config with the command npx -y mcp-fetch-server. In Claude Code, run claude mcp add --transport stdio fetch -- npx -y mcp-fetch-server. To run Fetch this way you need Node.js installed.

Does Fetch need an API key?

The registry lists no required keys for Fetch. Check the Fetch README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Fetch an official MCP server?

No. Fetch is a community server maintained by zcaceres. Community servers can be excellent; read the code and the open issues before you give Fetch access to company data.

What license is Fetch under?

Fetch is released under the MIT license, according to its GitHub repository. The license covers the code of Fetch; the service it connects to has its own terms.