@johnnren/mcp-searxng-public-extended
v0.1.7
Published
MCP server for SearXNG web search with HTML parsing, parallel requests and throttling
Readme
mcp-searxng-public-extended
中文 | English
使用公共 SearXNG 实例为你的 AI 提供免费网络搜索能力。
致谢:参考 pwilkin/mcp-searxng-public,扩展了并行多服务器请求、全局节流、可配置参数、双语 Schema 支持(中/英)。
特性
- HTML 解析:大多数公共 SearXNG 实例禁用了 JSON API,本服务器直接解析 HTML 响应
- 丰富参数:支持分类、引擎、安全搜索、时间范围、语言、分页、返回格式
- 并行与去重:随机选择
BATCH_SIZE个服务器,并行查询,合并前MIN_SERVERS个最快响应的结果 - 自动节流:全局请求队列,按服务器自动排队,可配置最小请求间隔,避免触发公共实例的频率限制
MCP 客户端配置
{
"mcpServers": {
"searxng": {
"command": "npx",
"args": ["-y", "\"@johnnren/mcp-searxng-public-extended\""],
"env": {
"SEARXNG_BASE_URL": "https://opnxng.com;https://priv.au;https://searx.perennialte.ch;https://searx.rhscz.eu",
"SEARXNG_VISIBLE_PARAMETERS": "query,categories,time_range,language,startPage",
"SEARXNG_DEFAULT_ENGINES": "google",
"SEARXNG_DEFAULT_PAGES": "1",
"SEARXNG_DEFAULT_SAFESARCH": "0",
"SEARXNG_RESULT_FIELDS": "url,title,summary"
}
}
}
}支持的环境变量选项
| 环境变量 | 说明 | 默认值 |
| ---------------------------- | -------------------------------------------- | --------------------------------------- |
| SEARXNG_BASE_URL | SearXNG 服务器地址(分号分隔)必需 | - |
| SEARXNG_SCHEMA_LANG | Schema 语言:zh(中文)或 en(英文) | zh |
| SEARXNG_DEFAULT_LANGUAGE | 默认语言代码 | - |
| SEARXNG_BATCH_SIZE | 每次搜索随机选择的服务器数量(数字或 all) | 1 |
| SEARXNG_MIN_SERVERS | 合并前 N 个最快服务器的结果 | 1 |
| SEARXNG_DEFAULT_ENGINES | 默认搜索引擎(逗号分隔) | 服务器默认 |
| SEARXNG_DEFAULT_PAGES | 默认获取页数 | 1 |
| SEARXNG_DEFAULT_SAFESARCH | 默认安全搜索级别(0=关闭, 1=中等, 2=严格) | 服务器默认 |
| SEARXNG_MIN_INTERVAL | 同一服务器两次请求的最小间隔(毫秒) | 450 |
| SEARXNG_RESULT_FIELDS | 返回结果包含的字段 | url,title,summary,engine,sourceServer |
| SEARXNG_VISIBLE_PARAMETERS | 对 LLM 可见的参数 | all |
SEARXNG_VISIBLE_PARAMETERS中省略pages和engines可提高稳定性(部分服务器不支持所有引擎)并减少响应量(一页内容通常足够)。
工具说明
本服务器提供 search 工具。
search
通过 SearXNG 进行网页搜索。
参数:
| 参数 | 类型 | 必需 | 说明 |
| ------------ | ------ | ---- | ------------------------------------------------------------------ |
| query | string | 是 | 搜索查询 |
| categories | string | 否 | 分类:general, images, news, videos, science, it 等 |
| engines | string | 否 | 引擎:google, bing, duckduckgo, github, stackoverflow 等 |
| safesearch | number | 否 | 级别:0=关闭, 1=中等, 2=严格 |
| time_range | string | 否 | 过滤:day, week, month, year |
| language | string | 否 | 语言代码(如 en, zh) |
| pages | number | 否 | 获取页数 |
| startPage | number | 否 | 起始页码 |
返回: { url, title, summary, engine, sourceServer } 数组
发布
npm version patch # or minor/major
git push --follow-tags许可证
MIT
