modelcontextprotocol/server-fetch
Free官方参考实现,灵活获取网页内容(HTML/JSON/MD),并为 AI 处理优化。
FreeFree tier
About modelcontextprotocol/server-fetch
A Model Context Protocol server that provides web content fetching capabilities, enabling LLMs to retrieve and process content from web pages by converting HTML to markdown. Supports fetching URLs with optional parameters: max_length (default 5000) for truncation, start_index for chunked reading, and raw mode to get content without markdown conversion. Includes a fetch prompt. Installation via uvx, pip, or Docker. Configure for Claude.app and VS Code. Respects robots.txt by default and allows customization.
Key Features
Fetches URLs and extracts content as markdown
Supports chunked reading via start_index parameter
Optional raw mode without markdown conversion
Configurable max_length for response truncation
Respects robots.txt by default
Installation via uvx, pip, or Docker
Includes a fetch prompt with URL argument
Pros & Cons
Pros
- Part of the official Model Context Protocol servers repository
- Flexible chunked reading capability
- Supports raw content extraction
- Easy installation via multiple methods (uvx, pip, Docker)
- Respects and allows customization of robots.txt
Cons
- Security warning: can access local/internal IP addresses, potentially exposing sensitive data
- Requires careful usage to avoid unintended data exposure
Best For
Allowing LLMs to read and consume web page contentRetrieving web content for AI processingChunked reading of long web pages to find specific informationFetching raw content without markdown conversion for specialized use
FAQ
How does the server handle web content?
It fetches a URL and converts the HTML content to markdown for easier consumption by LLMs.
Can I read a webpage in chunks?
Yes, using the start_index parameter you can specify where to start extraction, allowing models to read a webpage in chunks until they find the needed information.
Does the server respect robots.txt?
Yes, by default the server obeys a website's robots.txt file for requests that come from the model. This behavior can be customized.
What are the installation options?
Installation can be done via uvx (recommended), pip (python -m mcp_server_fetch), or Docker (using the mcp/fetch image).