
Agentfetch
io.github.bch1212由 GitHub 账号 bch1212 发布v1.0.1更新于 Oct 24, 2026
Token-budgeted web fetch for AI agents — auto-routes Jina, FireCrawl, Trafilatura, PDF.
概览
本地 MCP 服务器,把网页抓取为干净的 Markdown,并内置 token 估算、缓存,以及在 Jina、FireCrawl、Trafilatura 与 PDF 解析之间自动路由。
- 可以做什么
- 抓取单个网址,返回干净的 Markdown、元数据、token 数与缓存信息
- 在抓取前估算页面 token 数,避免超大页面撑爆上下文
- 并发抓取最多 20 个网址,并可限制每页 token 上限
- 一次调用完成网页搜索并抓取排名靠前的结果
- 按网址类型自动选择本地解析器、Jina Reader、用于 JS 重页面的 FireCrawl 或用于 PDF 的 pypdf,并可选使用 Redis 缓存
- 适用场景
- 适合助手需要在 token 预算内阅读网页或 PDF,并希望用一个工具统一处理正文提取、缓存和 JS 渲染页面,而不必自行整合多个抓取组件时使用。
- 运行要求
- 以 stdio 方式在本机运行,来自 PyPI 包 agentfetch-mcp(Python)。建议配置 JINA_API_KEY;FIRECRAWL_API_KEY 为可选,用于 JS 重页面;REDIS_URL 为可选,用于缓存。未配置 Jina 时仅本地 Trafilatura 可用。需要网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 Agentfetch,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
agentfetch-mcp
Web intelligence for AI agents — an MCP server that fetches URLs with token estimation, smart caching, and intelligent routing built in.
AgentFetch sits between your agent and the open web. Instead of integrating Jina, FireCrawl, pypdf, and your own caching layer separately, agents call one MCP tool and AgentFetch handles routing, caching, token budgeting, and clean Markdown extraction automatically.
This repository contains the open-source MCP server. For the hosted API + dashboard + billing, see www.agentfetch.dev.
What it does
Under the hood, AgentFetch routes URLs to the cheapest effective fetcher:
- Trafilatura (free, local) for ~70% of standard web pages
- Jina Reader for the rest of HTML
- FireCrawl for JS-heavy pages (Twitter/X, LinkedIn, Notion, etc.)
- pypdf for PDFs (zero external cost)
Cache is Redis with a 6-hour TTL; you can bring your own or run without caching.
Quick start
Install from PyPI
Or clone and install locally
Set environment variables
Get a free Jina Reader key at jina.ai (1M tokens/mo free tier). FireCrawl is optional but recommended for JS-heavy pages.
Add to Claude Desktop or Claude Code
Edit your MCP config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, or run claude mcp add in Claude Code):
Restart Claude. The four tools (fetch_url, estimate_tokens, fetch_multiple, search_and_fetch) appear automatically.
Run as a standalone server
The server speaks MCP over stdio (the standard transport for desktop integrations).
Why agents prefer AgentFetch over generic web fetch
Examples
Fetching with a token budget
Estimating before committing
Parallel fetching
Configuration
Development
Hosted version
If you'd rather not manage your own keys, Redis, or the routing yourself, the hosted version at www.agentfetch.dev gives you:
- Pay-per-call pricing from $0.001/fetch
- 500 free fetches on signup, no credit card
- Managed Redis cache, automatic failover between fetchers
- Dashboard with usage tracking + invoices
The hosted API is a drop-in REST equivalent — same response shapes, same routing logic. You can run the OSS MCP locally and the hosted API in parallel, or migrate between them at any time.
License
MIT — see LICENSE.
The MCP server in this repo is open source. The hosted product, billing, and ops infrastructure live in a separate (private) repo.
Contributing
PRs welcome. If you're adding a new fetcher (e.g., Bright Data, ScrapingBee, etc.), please match the FetchResult interface in agentfetch/core/fetchers/__init__.py and add the cost to the routing logic.
来源:README.md,提交 692a358
工具
0版本历史
1- v1.0.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分