Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Fetches web content and returns relevant chunks using RAG with semantic chunking, query-based scoring, and LexRank, supporting PDFs and 50+ languages.

README.md

MCP Server Fetch RAG

A Model Context Protocol (MCP) server that fetches web content and returns relevant chunks using RAG (Retrieval-Augmented Generation).

GitHub: https://github.com/attamari/mcp-server-fetch-rag

Features

  • Semantic Chunking: Groups sentences into coherent chunks based on embedding similarity
  • Query-based Scoring: Late Interaction with Power Mean aggregation for precise relevance scoring
  • LexRank Scoring: Graph-based centrality scoring when no query is provided
  • LexRank Backfill: Supplements query results with high-centrality chunks when needed
  • Percentile Filtering: Dynamic threshold based on score distribution
  • Multilingual Support: Uses paraphrase-multilingual-MiniLM-L12-v2 (50+ languages)
  • PDF Support: Extracts text from PDF documents
  • GPU Acceleration: Auto-detects CUDA, DirectML, ROCm, OpenVINO providers
  • Context Efficient: Filters out irrelevant content to reduce token usage

Usage

MCP Client Configuration

Add to your MCP client configuration (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "fetch-rag": {
      "command": "uvx",
      "args": [
        "--from", "git+https://github.com/attamari/mcp-server-fetch-rag",
        "mcp-server-fetch-rag"
      ]
    }
  }
}

With CLI options:

{
  "mcpServers": {
    "fetch-rag": {
      "command": "uvx",
      "args": [
        "--from", "git+https://github.com/attamari/mcp-server-fetch-rag",
        "mcp-server-fetch-rag",
        "--ignore-robots-txt",
        "--user-agent", "your-custom-user-agent"
      ]
    }
  }
}

CLI Options

| Option | Description | |---|---| | --user-agent | Custom User-Agent string (overrides default MCP UA) | | --ignore-robots-txt | Ignore robots.txt restrictions | | --proxy-url | Proxy URL for HTTP requests |

Tool: fetch_rag

Fetches a URL and returns relevant content chunks.

| Parameter | Type | Required | Default | Description | |---|---|---|---|---| | url | string | Yes | - | URL to fetch | | query | string | No | null | Search query for relevance filtering | | max_chunks | int | No | 10 | Maximum number of chunks to return |

How It Works

  1. Fetch: Downloads content from URL (HTML via trafilatura, PDF via pypdfium2)
  2. Split: Segments text into sentences using wtpsplit (sat-3l-sm, 85+ languages)
  3. Embed: Generates L2-normalized embeddings (paraphrase-multilingual-MiniLM-L12-v2 via FastEmbed/ONNX)
  4. Chunk: Groups adjacent sentences by embedding similarity into semantic chunks
  5. Score:
  • With query: Late Interaction — sentence-level query similarity aggregated via Power Mean
  • Without query: LexRank — sentence-level graph centrality aggregated via Power Mean
  1. Filter: Applies percentile-based dynamic threshold (P30)
  2. Backfill: When query scoring yields insufficient chunks, supplements with high-centrality LexRank chunks (P30 filtered)
  3. Return: Top chunks sorted in original document order

License

MIT License — See LICENSE for details.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.