A Model Context Protocol server and CLI (fetch-tool) to fetch web pages and return simplified markdown. Use it as an MCP server or call the tool directly from your shell.
Caution
This server can access local/internal IP addresses and may represent a security risk. Exercise caution when using this MCP server to ensure this does not expose any sensitive data.
The fetch tool will truncate the response, but by using the start_index argument, you can specify where to start the content extraction. This lets models read a webpage in chunks, until they find the information they need.
fetch: Fetch a URL and return markdown.url(required),max_length(default 5000),start_index(default 0),raw(default false)
- Serve over stdio:
fetch-tool [--user-agent ...] [--respect-robots-txt] [--proxy-url ...] - Direct fetch:
fetch-tool fetch <url> [--max-length N] [--start-index N] [--raw] [--user-agent ...] [--respect-robots-txt] [--proxy-url ...]- Robots are ignored by default; add
--respect-robots-txtto enforce them. - Examples:
fetch-tool fetch https://example.comorfetch-tool fetch https://example.com --raw --start-index 5000 --max-length 8000
- Robots are ignored by default; add
When using uv no specific installation is needed. We will
use uvx to directly run fetch-tool.
Direct CLI via uvx:
uvx fetch-tool fetch https://example.com
For a global tool install (so fetch-tool is on your PATH), use:
uv tool install --from . fetch-tool
After installation, you can run it as a script using:
fetch-tool serve # stdio server
fetch-tool fetch ... # call tool directly
python -m mcp_server_fetch # equivalent to fetch-tool serve
{
"mcpServers": {
"fetch": {
"command": "uvx",
"args": ["fetch-tool"]
}
}
}By default, the server ignores robots.txt for autonomous tool calls. Add --respect-robots-txt to enforce robots rules
for tool requests (prompt-based fetches remain user-initiated and are not gated).
No contribution is needed. You can contribute if you want to.
fetch-tool is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.