MCP Server Official reference

Fetch

MCP server that fetches web pages and converts HTML to markdown for LLMs, with chunked reading via start_index and configurable robots.txt, user-agent and proxy.

  • 91.1k GitHub stars
pip install mcp-server-fetch
Fetch preview image

What it is

Fetch MCP Server is a Model Context Protocol server that lets LLMs retrieve and process content from web pages. It converts HTML to markdown for easier consumption. It exposes a fetch tool and a fetch prompt, and truncates responses, letting models read long pages in chunks through the start_index argument.

Who it's for

  • Developers who want to give an MCP-capable LLM client (such as Claude.app or VS Code) the ability to read web pages
  • Users who need long web pages read in chunks until the relevant information is found

Requirements

Requirements

  • MCP Python SDK 1.x (mcp>=1.29.0,<2); SDK 2.0 is not yet supported
  • uv (using uvx, recommended), or pip, or Docker to run the server
  • Optional: Node.js, which makes the server use a different, more robust HTML simplifier

Setup

  1. Run with uvx (recommended)

    With uv, no specific installation is needed; uvx runs mcp-server-fetch directly. Add this to your Claude settings.

    json
    {
      "mcpServers": {
        "fetch": {
          "command": "uvx",
          "args": ["mcp-server-fetch"]
        }
      }
    }
  2. Install with pip

    Alternatively, install mcp-server-fetch via pip.

    bash
    pip install mcp-server-fetch
  3. Run the pip-installed server as a script

    After installing with pip, run it as a module.

    bash
    python -m mcp_server_fetch
  4. Configure with Docker

    Add this to your Claude settings to run the server via Docker.

    json
    {
      "mcpServers": {
        "fetch": {
          "command": "docker",
          "args": ["run", "-i", "--rm", "mcp/fetch"]
        }
      }
    }
  5. Configure for VS Code (uvx)

    Add this JSON block to your User Settings (JSON) file, or to .vscode/mcp.json in your workspace to share it with others. The mcp key is needed when using the mcp.json file.

    json
    {
      "mcp": {
        "servers": {
          "fetch": {
            "command": "uvx",
            "args": ["mcp-server-fetch"]
          }
        }
      }
    }

Examples

Windows configuration with PYTHONIOENCODING

json
json
{
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"],
      "env": {
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

What it does: Setting PYTHONIOENCODING addresses character encoding issues that can cause the server to time out on Windows.

Debug with the MCP inspector

bash
bash
npx @modelcontextprotocol/inspector uvx mcp-server-fetch

What it does: Runs the MCP inspector against a uvx installation of the server to debug it.

Fetch tool arguments

Prompt
prompt
fetch(url=<URL>, max_length=5000, start_index=0, raw=false)

Expected output: Shows the documented arguments of the fetch tool with their defaults. Only url is required. Raise start_index to read a truncated page in later chunks, or set raw to true to skip markdown conversion.

Pros & cons

Pros

  • Pro:Converts HTML to markdown, making web content easier for LLMs to consume
  • Pro:The start_index argument lets models read a truncated page in chunks
  • Pro:Can run via uvx, pip or Docker and is configurable for Claude.app and VS Code
  • Pro:Customizable robots.txt behavior, user-agent and proxy via arguments

Cons

  • Con:Can access local/internal IP addresses, which the README flags as a security risk that may expose sensitive data
  • Con:Requires MCP Python SDK 1.x; the port to SDK 2.0 is still in progress
  • Con:Responses are truncated (default max_length is 5000 characters), so longer pages need multiple calls

Images