docs-fetch-mcp

MCP.Pizza Chef: wolfyy970

Docs Fetch MCP Server enables LLMs to autonomously retrieve and recursively explore clean, readable web content. It extracts main content from pages, filters navigation links, and traverses same-domain links up to a specified depth, facilitating comprehensive topic learning from documentation or web resources.

Use This MCP server To

Fetch clean, readable content from any web page Recursively explore linked pages within the same domain Extract and filter navigation links for focused content retrieval Enable LLMs to autonomously learn from web documentation Aggregate comprehensive information on specific topics from websites Support multi-step web content exploration workflows for LLMs

README

Docs Fetch MCP Server

A Model Context Protocol (MCP) server for fetching web content with recursive exploration capabilities. This server enables LLMs to autonomously explore web pages and documentation to learn about specific topics.

Overview

The Docs Fetch MCP Server provides a simple but powerful way for LLMs to retrieve and explore web content. It enables:

  • Fetching clean, readable content from any web page
  • Recursive exploration of linked pages up to a specified depth
  • Same-domain link traversal to gather comprehensive information
  • Smart filtering of navigation links to focus on content-rich pages

This tool is particularly useful when users want an LLM to learn about a specific topic by exploring documentation or web content.

Features

  • Content Extraction: Cleanly extracts the main content from web pages, removing distractions like navigation, ads, and irrelevant elements
  • Link Analysis: Identifies and extracts links from the page, assessing their relevance
  • Recursive Exploration: Follows links to related content within the same domain, up to a specified depth
  • Parallel Processing: Efficiently crawls content with concurrent requests and proper error handling
  • Robust Error Handling: Gracefully handles network issues, timeouts, and malformed pages
  • Dual-Strategy Approach: Uses fast axios requests first with puppeteer as a fallback for more complex pages
  • Timeout Prevention: Implements global timeout handling to ensure reliable operation within MCP time limits
  • Partial Results: Returns available content even when some pages fail to load completely

Usage

The server exposes a single MCP tool:

fetch_doc_content

Fetches web page content with the ability to explore linked pages up to a specified depth.

Parameters:

  • url (string, required): URL of the web page to fetch
  • depth (number, optional, default: 1): Maximum depth of directory/link exploration (1-5)

Returns:

{
  "rootUrl": "https://example.com/docs",
  "explorationDepth": 2,
  "pagesExplored": 5,
  "content": [
    {
      "url": "https://example.com/docs",
      "title": "Documentation",
      "content": "Main page content...",
      "links": [
        {
          "url": "https://example.com/docs/topic1",
          "text": "Topic 1"
        },
        ...
      ]
    },
    ...
  ]
}

Installation

  1. Clone this repository:
git clone https://github.com/wolfyy970/docs-fetch-mcp.git
cd docs-fetch-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Configure your MCP settings in your Claude Client:
{
  "mcpServers": {
    "docs-fetch": {
      "command": "node",
      "args": [
        "/path/to/docs-fetch-mcp/build/index.js"
      ],
      "env": {
        "MCP_TRANSPORT": "pipe"
      }
    }
  }
}

Dependencies

  • @modelcontextprotocol/sdk: MCP server SDK
  • puppeteer: Headless browser for web page interaction
  • axios: HTTP client for making requests

Development

To run the server in development mode:

npm run dev

License

MIT

docs-fetch-mcp FAQ

How does Docs Fetch MCP Server handle link recursion?
It recursively explores same-domain links up to a user-specified depth to gather comprehensive content.
Can this server filter out irrelevant web page elements?
Yes, it extracts main content cleanly by removing navigation, ads, and other distractions.
Is the server limited to specific websites or domains?
It focuses on same-domain link traversal but can fetch content from any web page initially requested.
How does it ensure the content fetched is relevant?
It uses smart filtering of navigation links to prioritize content-rich pages for exploration.
Can this MCP server be integrated with multiple LLM providers?
Yes, it is provider-agnostic and works with OpenAI, Claude, Gemini, and others.
What kind of content does it extract from web pages?
It extracts the main readable content, excluding ads, navigation bars, and irrelevant elements.
Does it support configurable depth for recursive exploration?
Yes, users can specify how deep the server should explore linked pages.
Is the Docs Fetch MCP Server suitable for real-time web content retrieval?
Yes, it provides real-time fetching and exploration capabilities for dynamic LLM workflows.