Skip to content

About

A Model Context Protocol server and CLI (fetch-tool) to fetch web pages and return simplified markdown.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Fetch MCP Server

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.

Available Tools

  • fetch: Fetch a URL and return markdown.
    • url (required), max_length (default 5000), start_index (default 0), raw (default false)

CLI

  • 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-txt to enforce them.
    • Examples: fetch-tool fetch https://example.com or fetch-tool fetch https://example.com --raw --start-index 5000 --max-length 8000

Installation

Using uv (recommended)

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

Configuration

Configure for MCP client

{
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["fetch-tool"]
    }
  }
}

Customization - robots.txt

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).

Contributing

No contribution is needed. You can contribute if you want to.

License

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.

About

A Model Context Protocol server and CLI (fetch-tool) to fetch web pages and return simplified markdown.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages