问题
AI 客户端通常需要两种开放网络能力:找到相关页面,以及安全地提取页面正文。不同搜索提供商的认证、返回格式和失败行为各不相同,本地抓取还必须处理 SSRF、重定向和超大响应。
两个清晰工具
MCP 接口只暴露 web_search 与 web_extract。DDGS 搜索和本地正文提取无需 API Key;需要更多能力时,可以配置 SearXNG、TalorData、You.com 或 Tavily。自动路由保持固定和可预测,优先使用已配置的 SearXNG,失败后回退到 DDGS。
提取安全
本地提取在连接前执行 DNS 感知的 SSRF 检查,并对每次重定向重新校验目标。HTTP 响应有大小上限,解析层使用 Trafilatura 与 Beautiful Soup 提取可读正文,避免把任意网络响应直接交给 Agent。
分发
项目以 search-engine-tool-mcp 发布到 PyPI,可作为 Python 包安装,也可通过 uvx 直接作为 MCP 服务运行。当前版本为 0.5.0,项目分类为 Beta。
当前边界
本地提取不执行 JavaScript,不能绕过登录墙、付费墙或 CAPTCHA。商业提供商需要显式凭据,也不会自动加入免费搜索的回退链。多提供商支持改善可选择性,但不构成可用性保证。
Problem
AI clients generally need two open-web capabilities: finding relevant pages and extracting readable content safely. Search providers differ in authentication, response shape, and failure behavior, while local fetching must also handle SSRF, redirects, and oversized responses.
Two focused tools
The MCP surface exposes only web_search and web_extract. DDGS search and local extraction require no API key. SearXNG, TalorData, You.com, and Tavily can be configured when needed. Automatic routing remains deterministic: a configured SearXNG instance is tried first, followed by DDGS on failure.
Extraction safety
Local extraction performs DNS-aware SSRF checks before connecting and validates every redirect target again. Responses are size-bounded, while Trafilatura and Beautiful Soup extract readable content instead of handing arbitrary network responses directly to an agent.
Distribution
The project is published to PyPI as search-engine-tool-mcp. It can be installed as a Python package or launched directly as an MCP server with uvx. The current version is 0.5.0 and is classified as Beta.
Current limits
Local extraction does not execute JavaScript and cannot bypass authentication, paywalls, or CAPTCHA. Commercial providers require explicit credentials and do not silently enter the free-search fallback chain. Multi-provider support offers choice, not a guarantee of availability.
