Fetch MCP Server
Published · Updated
At a glance
- Category
- Browser & testing
- GitHub repository
- modelcontextprotocol/servers/tree/main/src/fetch
- Watch out for
- The servers repository describes its reference servers as educational examples that demonstrate MCP features and SDK usage, not as production-ready solutions, so you are expected to review the security fit yourself.
Fetch is one of the reference servers in the official modelcontextprotocol/servers repository, published on PyPI as mcp-server-fetch. It gives a model one job: pull a web page and hand back its content as markdown, so the agent reads clean text instead of raw HTML.
It is written in Python on the MCP Python SDK and runs locally over stdio by default. You can also start it with --transport streamable-http, in which case it serves a single /mcp endpoint on 127.0.0.1:3001 unless HOST and PORT say otherwise. It speaks both the 2025-11-25 and 2026-07-28 protocol versions without configuration.
The notable part is how much care went into safety defaults. It refuses private, loopback and link-local addresses (cloud metadata endpoints included), checks each redirect hop, pins the resolved address to stop DNS rebinding, and obeys robots.txt for model-initiated requests.
How it connects
Your AI app
An assistant or agent that supports MCP
Fetch MCP Server
Runs as
- Python (uv / pip)
- Docker
Gives the agent
- Fetch a page as markdown
- Read long pages in chunks
- Per-call timeout
- Host allowlist
- User-initiated prompt
- Proxy and extraction options
Fetch
The data or system the tools act on
What it can do
- Fetch a page as markdown
- The fetch tool takes a url and returns the page converted to markdown, or the raw content when raw is true.
- Read long pages in chunks
- max_length (default 5000 characters) and start_index let the model page through a long document until it finds what it needs.
- Per-call timeout
- timeout_ms sets the HTTP timeout for one call, from 100 to 600000 ms, overriding --timeout-ms or the FETCH_TIMEOUT_MS variable.
- Host allowlist
- --allowed-hosts restricts fetching to exact host names, *.domain wildcards or literal IP addresses, checked before every request and redirect.
- User-initiated prompt
- A fetch prompt lets the user pull a URL directly; these requests use a separate user agent and are not held to robots.txt.
- Proxy and extraction options
- --proxy-url or the standard proxy variables route traffic, and --no-readability-js keeps HTML extraction in pure Python.
Setting it up
With uv installed nothing needs installing up front. In Claude Desktop, add a server under mcpServers named fetch with "command": "uvx" and "args": ["mcp-server-fetch"]. The README also shows a Docker form ("command": "docker", "args": ["run", "-i", "--rm", "mcp/fetch"]) and a pip route: pip install mcp-server-fetch, then run python -m mcp_server_fetch. For VS Code, add the same uvx command under mcpServers in ~/.copilot/mcp-config.json or the workspace-root .mcp.json, or use the one-click install buttons on the README. Python 3.11.5 or newer is required. On Windows, set PYTHONIOENCODING to utf-8 in env if you hit timeouts. To test it, run npx @modelcontextprotocol/inspector uvx mcp-server-fetch.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Pull a library's documentation page into the conversation so the agent answers from the current text rather than memory.
- Read a long changelog or RFC in 5000-character chunks using start_index until the relevant section turns up.
- Let a coding agent check a local dev server's output by starting Fetch with --allow-private-ips and an --allowed-hosts entry for localhost.
- Lock an agent to a short list of documentation sites with --allowed-hosts so it cannot wander elsewhere.
Limitations and things to watch
- The servers repository describes its reference servers as educational examples that demonstrate MCP features and SDK usage, not as production-ready solutions, so you are expected to review the security fit yourself.
- The README warns that the server can reach local and internal addresses if you pass --allow-private-ips, and that requests sent through a proxy are not fully covered by the private-address check.
- Response bodies are capped at 5 MiB and only gzip and deflate encodings are accepted, so br or zstd responses fail with an error.
- When Node.js is on the PATH, the first HTML extraction runs npm install for Readability.js from unpinned version ranges, which needs access to registry.npmjs.org.
- It reads static HTTP responses and extracts readable text; Readability.js drops hidden elements, and without Node.js the Python extractor drops link targets.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /modelcontextprotocol/servers/tree/main/src/fetch
- raw.githubusercontent.com /modelcontextprotocol/servers/main/src/fetch/README.md
- github.com /modelcontextprotocol/servers
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.