
四个小型MCP工具让apfel(苹果的设备级LLM)能够访问网页并读取本地文件:url-fetch(读取页面)、ddg-search(网页搜索)、search-and-fetch(一次调用搜索+读取)、fs......
概览
Apfel-MCP是四个小工具,只添加了这些功能,别无其他。每个工具都返回一个已经修剪过以适应Apfel微小上下文窗口的结果(事后没有被截断)。 它们是MCP服务器:你用--mcp连接到apfel,模型需要时调用它。 不确定?用——它能在一个便宜的代币工具调用中满足大部分“在网上查找并回答”的需求。 - — 获取网页,通过可读性提取主条目正文,返回干净的标记。默认 ~4000 字符,硬上限为 6000 字符(~1500 tokens)。SSRF 防护:仅支持 http/https,私有网络屏蔽列表,10 秒超时,2 MB 下载上限。- — DuckDuckGo 网页搜索,无需 API 密钥。返回前 5 个 ~300 个标记的结果。— DuckDuckGo 不提供公开搜索 API,因此使用其 HTML 端点。偶尔会出现故障。请参见 ddg-search 的注意事项。- — 复合工具:搜索后在一次工具调用中获取前 N 个结果。
概述(AI 翻译)
apfel运行苹果的设备端模型——它无法自行访问互联网或读取你的文件。 apfel-mcp是四个小工具,只添加了这些功能,仅此而已。每个工具返回的结果都已修剪以适应apfel那个小小的4096令牌上下文窗口(事后未被截断)。
它们是MCP服务器:你用--mcp连接到APFEL,模型需要时调用它。
我需要哪个工具?
| 你想… | 用 | 你给它 | 笔记 |
|---|---|---|---|
| 阅读特定网页 | apfel-mcp-url-fetch |
一个网址 | 文章正文,广告被剔除 |
| 搜索网络 | apfel-mcp-ddg-search |
搜索查询 | 实验性(DuckDuckGo 抓取) |
| 提出需要网络的问题 | apfel-mcp-search-and-fetch |
一个问题 | 搜索 and 一次通话即可阅读 - 从这里开始 |
| 读取本地文本文件 | apfel-mcp-fs |
文件路径 | 只读,不写入/删除 |
不确定?用**apfel-mcp-search-and-fetch**——它能在一个便宜的工具调用中满足大部分“在网上查找并回答”的需求。
四位MCP详细介绍
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
apfel-mcp
apfel runs Apple’s on-device model - it cannot reach the internet or read your files on its own. apfel-mcp is four small tools that add exactly those abilities, and nothing else. Each returns a result already trimmed to fit apfel’s tiny 4096-token context window (not truncated after the fact).
They are MCP servers: you attach one to apfel with --mcp, and the model calls it when it needs to.
Which tool do I need?
| You want to… | Use | You give it | Note |
|---|---|---|---|
| Read a specific web page | apfel-mcp-url-fetch |
a URL | article text, ads stripped |
| Search the web | apfel-mcp-ddg-search |
a search query | experimental (DuckDuckGo scrape) |
| Ask a question that needs the web | apfel-mcp-search-and-fetch |
a question | searches and reads, in one call - start here |
| Read a local text file | apfel-mcp-fs |
a file path | read-only, no writing/deleting |
Not sure? Use apfel-mcp-search-and-fetch - it covers most “look something up on the web and answer” needs in a single, token-cheap tool call.
The four MCPs, in detail
apfel-mcp-url-fetch— fetch a web page, extract the main article body via Readability, return clean markdown. Default ~4000 chars, hard cap 6000 chars (~1500 tokens). SSRF guards:http/httpsonly, private-network blocklist, 10-second timeout, 2 MB download cap.apfel-mcp-ddg-search— DuckDuckGo web search, no API key required. Returns top 5 results in ~300 tokens. Experimental, unofficial, scraping-based — DuckDuckGo does not provide a public search API, so this uses their HTML endpoint. Expect occasional breakage. See ddg-search caveats.apfel-mcp-search-and-fetch— compound tool: search then fetch the top N results in a single tool call. Saves ~500 tokens of tool-call schema and conversation overhead versus calling search + fetch separately. Hard cap 5000 chars (~1250 tokens).apfel-mcp-fs— read a bounded slice of a local text file. Read-only: it cannot write, move, or delete anything. Path allowlist viaAPFEL_MCP_FS_ROOTS(defaults to the working directory); paths outside the roots and binary files are refused. Default ~4000 chars, hard cap 6000 chars. See fs caveats.
Why a separate repo
安装
npx @modelcontextprotocol/inspector python -m apfel_mcp.url_fetch_server