agentfetch
Provides a scrape tool for CrewAI agents, enabling web scraping and crawling within CrewAI workflows.
Supports self-hosting via Docker Compose with API (port 8080), MCP SSE (port 8081), Redis, and optional crawl workers.
Provides web search functionality via DuckDuckGo as a fallback search engine when SearXNG is not configured.
Provides AgentFetchTools for LangChain agents, enabling web scraping, crawling, search, and extraction as LangChain tools.
Provides local LLM-based structured data extraction via Ollama, configured with OLLAMA_URL and OLLAMA_MODEL, without API costs.
Provides tools for OpenAI function calling, enabling web scraping, crawling, search, and extraction via get_tools.
Provides optional Redis-backed caching and job queue for horizontal scaling of crawl operations.
Provides web search functionality via SearXNG with optional result scraping, configured via SEARXNG_URL.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agentfetchfetch https://en.wikipedia.org/wiki/OpenAI as markdown"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agentfetch
Open-source web retrieval & research agent built for AI agents.
agentfetch is a free, local alternative to Firecrawl, Exa, Parallel.ai, and Tavily. It fetches any webpage, crawls any site, searches the web, and researches any topic — returning clean markdown and structured reports that AI agents can consume directly.
Works with LangChain, LlamaIndex, CrewAI, AutoGen, Claude MCP, OpenAI function calling, Gemini, Groq, and plain REST. No vendor lock-in, no API keys required.
Install
Standard
pip install git+https://github.com/SID1ART/agentfetch.gitCloud notebooks (Colab, Jupyter, Kaggle)
pip install https://github.com/SID1ART/agentfetch/archive/main.zipWith extra integrations
pip install "agentfetch[langchain,llamaindex,crewai] @ git+https://github.com/SID1ART/agentfetch.git"
pip install "agentfetch[search] @ git+https://github.com/SID1ART/agentfetch.git" # adds Google search engineNo PyPI account, no API tokens, no sign-up needed. GitHub is the source.
What makes it different
Research Agent — Tavily-style deep research: auto-decomposes questions into sub-queries, searches multiple engines, gathers full content, and synthesizes a structured report with citations via Ollama or Claude. Supports iterative follow-up (
depth="deep"), structured output schemas, and four citation formats (numbered, MLA, APA, Chicago).Smart Mode Router — detects JavaScript-heavy SPAs (Next.js, Nuxt, React) and falls back to Playwright headless browser automatically. Static pages use direct HTTP.
5-layer extraction pipeline — trafilatura → newspaper3k → readability-lxml → BeautifulSoup → plain text. Best-effort extraction from any HTML.
Never raises exceptions — always returns structured
FetchResultwith confidence scores, error fields, and injection detection. Agents can trust the output.Post-extraction quality check — detects SPA shell text, low prose ratio, missing sentence structure, and downgrades confidence so agents can retry with browser engine.
In-memory LRU cache — deduplicates repeated URL fetches within a session. Configurable size/TTL via env vars. No Redis required.
Information saturation crawling — no arbitrary depth limits. CrawlStopper detects vocabulary saturation and content redundancy, stopping when enough data is gathered.
Persistent crawl store — SQLite-backed job persistence when Redis is not configured. Results survive process restarts.
Prompt injection firewall — 13 patterns detected and redacted to
[REDACTED BY AGENTFETCH].Cloudflare bypass — optional
curl_cffiintegration with 12 TLS fingerprint profiles (Chrome 99–124, Safari 15/17) and auto-rotation.Browser stealth — optional
playwright-stealthintegration for advanced anti-detection (WebGL vendor, canvas fingerprint, navigator.webdriver removal). Enabled by default.Robots.txt compliance — optional async parser with caching, crawl-delay, and sitemap discovery.
Proxy rotation — round-robin or random proxy pools with automatic failure tracking.
Local LLM extraction — optional Ollama integration for structured data extraction without API costs.
Redis-backed job queue — horizontal scaling for crawl operations with background workers.
Related MCP server: superFetch MCP Server
Tools
Tool | Description |
| Fetch any URL; auto-detects browser need. Supports ScrapeConfig (wait_for selectors, tag filtering, citation markers, proxies, JA3 profile). |
| Recursive crawl with information saturation stopping, robots.txt compliance, deduplication. |
| Web search via SearXNG, DuckDuckGo, Google, or Bing with optional result scraping. |
| Structured data extraction by JSON schema via Ollama, Anthropic Claude, or CSS fallback. |
| Discover all URLs on a website via sitemap.xml and BFS crawling. |
| Poll crawl job progress (in-memory or Redis). |
| Research a topic: decomposes into sub-queries, searches multi-engine, gathers content, synthesizes a structured report with citations via LLM. Supports deep iterative follow-up and structured output schemas. |
Library API
Function | Description |
| Fetch a single URL; auto-detects browser need. Returns |
| Fetch multiple URLs concurrently. Returns |
| Search and optionally scrape results. Returns |
| Search engine results without scraping. Returns |
| Research a topic: decomposes query, gathers sources, synthesizes report with citations via LLM. Returns |
Quickstart
LangChain
from agentfetch.integrations.langchain.tools import AgentFetchTools
tools = AgentFetchTools
# Use with any LangChain agentMCP (Claude Desktop, Cursor, etc.)
pip install git+https://github.com/SID1ART/agentfetch.git
agentfetch-mcp
# configure in Claude Desktop or any MCP hostREST API
pip install git+https://github.com/SID1ART/agentfetch.git
agentfetch serve
# Scrape
curl -X POST http://localhost:8080/agent_scrape \
-d '{"url": "https://example.com"}'
# Research (async — returns job ID, poll for result)
curl -X POST http://localhost:8080/agent_research \
-d '{"prompt": "Latest AI developments", "max_sources": 10}'
# → {"request_id":"abc123","status":"pending",...}
# Poll research result
curl http://localhost:8080/agent_research/abc123
# → {"request_id":"abc123","status":"complete","answer":"# Report...","sources":[...]}
# Research with streaming (SSE)
curl -X POST http://localhost:8080/agent_research/stream \
-d '{"prompt": "Compare OpenAI and Anthropic pricing", "citation_format": "apa"}'
# → event: progress, event: result (full report)Python library
import asyncio
from agentfetch import smart_fetch, search_fetch
from agentfetch.core.schema import ScrapeConfig
# Fetch a single URL
result = asyncio.run(smart_fetch(
"https://en.wikipedia.org/wiki/Obsession_(2025_film)",
config=ScrapeConfig(
wait_for=".main-content",
exclude_tags=["nav", "footer"],
citation_links=True,
)
))
print(result.content) # clean markdown
print(result.citations) # [1], [2] URLs
# Search with multiple engines
sr = asyncio.run(search_fetch(
"latest AI news",
sources=["duckduckgo", "google", "bing"],
max_results=5,
))
print(sr.results) # list[FetchResult]
print(sr.errors) # per-engine errors, e.g. {"google": "rate limited (429)"}
print(sr.sources_used) # engines that returned results
# Research a topic (uses Ollama or Claude for query decomposition and synthesis)
from agentfetch import smart_research, ResearchConfig
report = asyncio.run(smart_research(
"Compare pricing of OpenAI, Anthropic, and Google AI APIs",
config=ResearchConfig(
max_sources=15,
citation_format="apa",
depth="deep",
)
))
print(report.answer) # Comprehensive report with [Author, Year] citations
print(report.sources) # list of ResearchSource with full content
print(report.response_time) # e.g. 12.34sAll integrations
Framework | Install | Tools available |
LangChain |
|
|
LlamaIndex |
|
|
CrewAI |
|
|
AutoGen |
|
|
OpenAI / Gemini / Groq |
|
|
Claude MCP |
|
|
Ollama |
|
|
REST |
| All endpoints + |
Schema reference
ScrapeConfig
Field | Type | Default | Description |
|
|
| CSS selector to wait for before extracting |
|
|
| Only extract these HTML tags |
|
|
| Skip these HTML tags during extraction |
|
|
| Browser viewport |
|
|
| Extra JS wait time in milliseconds |
|
|
| Extract links from page |
|
|
| Truncate content beyond this length |
|
|
| Track citation markers |
|
|
| Proxy URL for this request |
|
|
| Cookies to include in browser session |
|
|
| Custom HTTP headers |
|
|
| JA3 TLS profile for |
|
|
| Enable browser stealth evasions (playwright-stealth if available) |
|
|
| Action chain to execute before extraction (click, scroll, type, wait, press, select, screenshot, hover, custom_js) |
|
|
| Capture a full-page final screenshot (PNG, base64-encoded in |
FetchResult
Field | Type | Description |
|
| Requested URL |
|
| Extracted markdown content |
|
| Page title |
|
| Extraction quality (0.0–1.0) |
|
| Detected type (article, blog, product, etc.) |
|
| Word count of extracted content |
|
| Renderer used: |
|
| Total request time in milliseconds |
|
| Whether result came from cache |
|
| Prompt injection was found and redacted |
|
| Links extracted from the page |
|
| Error message if the fetch failed |
|
| URL this content was deduplicated against |
|
| Number of retries performed |
|
| Citation URLs when |
|
| Whether robots.txt permitted the fetch |
|
| Proxy used for this request |
|
| Normalized version of the requested URL |
|
| Base64-encoded final PNG screenshot (when |
|
| Base64-encoded PNG screenshots from mid-flow screenshot actions (when |
Action
Field | Type | Default | Description |
Field | Type | Default | Description |
------- | ------ | --------- | ------------- |
|
| — | Action type: |
|
|
| CSS selector for |
|
|
| Value: text for |
|
|
| Timeout in ms for selector waits |
|
|
| When |
Action details:
click — clicks a CSS selector, waits for
networkidleafterwardscroll — scrolls to selector,
"bottom","top", or by N pixelstype — fills an input field with
valuewait — waits N milliseconds (
value)press — presses a key (
value, default"Enter"), waits fornetworkidleselect — selects a
<select>option byvaluescreenshot — captures a full-page PNG; stored in
screenshots[]ifstore_output=Truehover — hovers over a CSS selector
custom_js — runs arbitrary JavaScript from
valueon the page, waits fornetworkidle
Examples:
# Hover to reveal dropdown, then click
actions = [
Action(type="hover", selector="#nav-menu"),
Action(type="wait", value="500"),
Action(type="click", selector="#nav-menu .dropdown-item"),
]
# Run custom JS and capture mid-flow screenshot
actions = [
Action(type="custom_js", value="document.querySelector('.paywall')?.remove()"),
Action(type="screenshot", store_output=True),
]
# Full-page final screenshot
config = ScrapeConfig(screenshot=True, actions=[...])SearchConfig
Field | Type | Default | Description |
|
|
| Max results per engine |
|
|
| Engines: |
|
|
| Fetch full content of each result |
|
|
| Self-hosted SearXNG instance URL |
|
|
| Search topic: |
|
|
| Time filter: |
|
|
| Boost results from a country (e.g. |
|
|
| Include an LLM-generated answer via Ollama or Anthropic |
SearchResult
Field | Type | Description |
|
| Original search query |
|
| Search results with extracted content |
|
| Concatenated engine names used |
|
| Engines that returned results |
|
| Search suggestions (if available) |
|
| Total deduplicated result count |
|
| Per-engine error messages (e.g. |
|
| LLM-generated answer when |
MapConfig
Field | Type | Default | Description |
|
|
| Maximum crawl depth for link discovery |
|
|
| Maximum URLs to discover |
|
|
| Regex patterns to include only matching paths |
|
|
| Regex patterns to exclude matching paths |
|
|
| Only include URLs from these domains |
|
|
| Exclude URLs from these domains |
|
|
| Respect robots.txt during crawl discovery |
MapResult
Field | Type | Description |
|
| The root URL that was mapped |
|
| Discovered URLs |
|
| Total number of discovered URLs |
|
| Discovery methods used ( |
ResearchConfig
Field | Type | Default | Description |
|
| — | The research question or topic |
|
|
| Model tier: |
|
|
| Maximum sources to gather |
|
|
| JSON Schema for structured output in the report |
|
|
| Citation style: |
|
|
| Prioritize results from these domains |
|
|
| Exclude results from these domains |
|
|
| Research depth: |
|
|
| Max follow-up iterations when |
ResearchSource
Field | Type | Description |
|
| Source URL |
|
| Page title |
|
| Extracted text content |
|
| Relevance to the research question (0.0–1.0) |
|
| Pre-formatted citation string (e.g. |
ResearchResult
Field | Type | Description |
|
| Unique job ID |
|
| Original research question |
|
| Structured markdown report with citations |
|
| Gathered sources with title, URL, content, and formatted citation |
|
| JSON matching |
|
| LLM provider used for synthesis ( |
|
| Number of sources gathered |
|
| Total research time in seconds |
|
|
|
|
| Error message if the research failed |
Configuration
Environment variables
Variable | Default | Description |
| — | Redis connection for caching + job queue |
| — | SearXNG instance for search (falls back to DuckDuckGo + Google + Bing) |
| — | Brave Search API key (enables |
| — | SerpAPI key (enables |
| — | Google Custom Search API key (used by |
| — | Google Custom Search CX (required with |
| — | For Claude-powered |
|
| Claude model name for extraction and research |
| — | Ollama endpoint for local LLM extraction and research agent |
|
| Ollama model name for extraction and research |
|
| In-memory LRU cache TTL (seconds) |
|
| Max entries in in-memory LRU cache |
|
| HTTP fetch timeout (seconds) |
|
| Playwright browser timeout (seconds) |
|
| Max retries for failed requests |
|
| Delay between requests to same domain |
|
| Enable robots.txt compliance |
| — | Comma-separated proxy URLs or JSON array |
|
|
|
| — | Path to cookies file (Netscape or JSON) |
|
| API server port |
| — | JA3 TLS profile override for |
|
| Enable browser stealth evasions in Playwright |
|
| Fall back to non-stealth browser if stealth fails |
|
| SQLite path for crawl job persistence |
|
| Minimum alpha-char ratio for quality check |
|
| Minimum word count for quality check |
Self-host
docker-compose up -d
# Starts API (port 8080), MCP SSE (port 8081), Redis
# Optional crawl worker:
docker compose --profile worker up -dArchitecture
┌─────────────┐
│ Smart │
│ URL │
│ Router │
└──────┬──────┘
│
┌─────────────────┼──────────────────┐
│ │ │
▼ ▼ ▼
┌────────────┐ ┌──────────────┐ ┌────────────────┐
│ Static │ │ Cloudflare │ │ Playwright │
│ HTTP │ │ bypass │ │ Headless │
│ (httpx) │ │ (curl_cffi) │ │ Browser │
└─────┬──────┘ └──────┬───────┘ └───────┬────────┘
│ │ │
└─────────────────┼────────────────────┘
│
▼
┌─────────────────┐
│ Extraction │
│ Pipeline │
│ trafilatura → │
│ newspaper3k → │
│ readability → │
│ BS4 → plain │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Sanitizer │
│ (13 injection │
│ patterns) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Post-process │
│ • Citations │
│ • Dedup check │
│ • Max length │
│ • Markdown │
└────────┬────────┘
│
▼
┌─────────────────┐
│ FetchResult │
│ Pydantic │
│ response │
└─────────────────┘Tests
pip install -e ".[all]"
pytest tests/ -v
# 138 tests passingLicense
MIT — free for any use, including commercial.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SID1ART/agentfetch'
If you have feedback or need assistance with the MCP directory API, please join our Discord server