关于 mcp-searxng-public
mcp-searxng-public 是一个 MCP 服务,通过查询公开的 SearXNG 实例进行搜索,并将 HTML 结果解析为 JSON。它面向无法使用 JSON 输出格式的公开实例,可配置最多三个实例,主实例失败时自动切换到备用实例。
主要功能
- 01查询公开 SearXNG 实例
- 02解析 HTML 结果为 JSON
- 03最多三个实例,主备切换
- 04支持时间范围与语言参数
- 05detailed 模式合并并去重多页结果
适用场景
- 01在 MCP 客户端中为 AI 助手提供网络搜索
- 02在无法访问 JSON 接口的公开实例上进行检索
MCP 相关
该项目是一个 MCP 服务,向 MCP 客户端暴露名为 search 的工具,接收 query 等参数并返回包含 url 与 summary 的对象数组。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
1收录的工具列表 · 更新于 3 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| query | string | 是 | 搜索查询。 |
| time_range | string | 否 | 可选的搜索时间范围,取值为:[day, week, month, year]。 |
| language | string | 否 | 搜索所用的可选语言代码(例如 en、es、fr)。 |
| detailed | string | 否 | 可选项:若为 true,将执行更全面的搜索——请求更多结果页面,并合并来自多个服务器的结果。警告:这可能会使服务器过载并导致错误。除非明确要求执行详细或全面的查询,否则默认不要设为 true。 |
详细介绍
mcp-searxng-public
一个 MCP 服务,用于查询公共 SearXNG 实例,并将 HTML 内容解析为 JSON 结果
原因
我见过的所有 SearXNG MCP 服务都使用 "json" 作为输出格式。虽然这无疑是编写 SearXNG MCP 服务的更快方式,但几乎会导致它在所有公共服务上都无法运行,因为这些服务不会公开 JSON 格式。
此服务会从最多三个公共 SearXNG 服务读取数据(使用一个作为主服务,其他作为备用服务),并将结果解析为 JSON。
安装
通过 npm install mcp-searxng-public 安装。
安装服务后,运行配置如下(适用于 Cursor 或兼容 Cursor 的客户端):
{
"SearXNGScraper": {
"command": "npx",
"args": ["mcp-searxng-public"],
"capabilities": {
"tool-calls": true
},
"env": {
"SEARXNG_BASE_URL": "https://metacat.online;https://nyc1.sx.ggtyler.dev;https://ooglester.com;https://search.080609.xyz;https://search.canine.tools;https://search.catboy.house;https://search.citw.lgbt;https://search.einfachzocken.eu;https://search.federicociro.com;https://search.hbubli.cc;https://search.im-in.space;https://search.indst.eu",
"DEFAULT_LANGUAGE": "en"
}
}
}
注意: 你可能需要调整 env 变量,尤其是 SEARXNG_BASE_URL,以指向你偏好的 SearXNG 实例。也可以根据需要设置 DEFAULT_LANGUAGE。你可以运行 report 任务,获取可用(可访问)的优质 SearXNG 实例报告,并将其中的实例填入 URLs 行。
用法
此服务公开了一个端点:search。该端点接受四个参数:
query- 搜索查询time_range(可选)- 根据 https://docs.searxng.org/dev/search_api.html 规范指定时间范围参数(day、month或year)。language(可选)- 搜索所用的语言代码(例如en、es、fr)。如果未提供,则默认使用DEFAULT_LANGUAGE环境变量的值。如果两者都未设置,则不会向 SearXNG 发送语言参数。detailed(可选)- 如果设为 "true",则通过查询最多 3 个服务,并从每个服务获取多个结果页(第 1、2 和 3 页),执行更全面的搜索,然后合并并去重结果。
返回值是一个对象数组:
[
{
"url": "https://github.com/searxng/searxng",
"summary": "You can start SearXNG using make run in the terminal or by pressing Ctrl+Shift+B"
},
{
"url": "https://searx.bndkt.io/",
"summary": "Powered by searxng - 2025.3.22+5986629c6 — a privacy-respecting, open metasearch engine Source code | Issue tracker | Engine stats | Public instances | Contact instance maintainer"
},
{
"url": "https://docs.searxng.org/"
"summary": "SearXNG is a free internet metasearch engine which aggregates results from up to 243 search services. Users are neither tracked nor profiled. Additionally, SearXNG can be used over Tor …"
}
{
"url": "https://en.wikipedia.org/wiki/SearXNG",
"summary": "SearXNG is federated, and as such is hosted by several instances, public and private. Private instances are hosted on a local network, or run on the user's desktop computer itself, and are …"
}
]
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。