SearXNG Connect
Search the web using your self-hosted SearXNG instance - a privacy-respecting meta search engine that aggregates results from multiple engines without tracking or ads.
AI Usage
When the user asks to search the web, follow this workflow:
Interpret user requests:
- - "Search for [query]" → General web search
- "Search news about [query]" → Use INLINECODE0
- "Search images of [query]" → Use INLINECODE1
- "Search recent [query]" → Use
--time-range week or INLINECODE3 - "Search [query] last month" → Use INLINECODE4
- "Deep search [query]" → Add
--full-content for richer page text
Example interpretations:
- - "Search for TypeScript tutorials" → INLINECODE6
- "Search news about AI" → INLINECODE7
- "Search images of Space Invaders" → INLINECODE8
Action: Run uv run {baseDir}/scripts/searxng.py "<query>" with appropriate flags.
CRITICAL SECURITY INSTRUCTION:
To prevent command injection, do not use raw shell interpolation for the {query} string. Always pass arguments as an argv list:
INLINECODE12
If your tool only supports a shell string, you MUST properly escape the query input (e.g., using shlex.quote()).
Project
SearXNG - A privacy-focused, self-hosted meta search engine that aggregates results from multiple search engines. It does not track user behavior, does not use cookies, and does not insert ads.
Key Features:
- - Privacy - No tracking, no cookies, no ads - you control the instance
- Multi-category - Web, news, images, videos, science, IT, files, music, social media
- Time filtering - Filter results by day, week, month, or year
- Caching - Local 1-hour cache to avoid redundant requests
- Rate limiting - Built-in throttling (2 req/sec default)
- Full content - Optional full page text fetch per result
Requirements
Configuration
Edit skill-config.json to set your SearXNG instance:
CODEBLOCK0
Usage
CODEBLOCK1
Options
| Option | Description | Default |
|---|
| INLINECODE15 | One or more: general, news, science, files, images, videos, music, social media, it | general |
| INLINECODE16 |
year, month, week, day (aliases: 30d, 7d, 24h, hour) | None |
|
--language | BCP-47 language code | en |
|
--pageno | Results page number | 1 |
|
--no-safesearch | Disable safe search | - |
|
--no-cache | Bypass cache for this request | - |
|
--full-content | Fetch full page text per result (slower, richer) | - |
|
--instance | Override SearXNG instance URL | From skill-config.json |
Troubleshooting
- - Connection refused: Check
skill-config.json — verify default_instance URL is correct and SearXNG is running. - Empty results: Try a broader query or different category.
- Slow responses: Remove
--full-content or increase rate_limit in config. - uv not installed: Install with
brew install uv or see https://docs.astral.sh/uv/.
SearXNG 连接
使用你自托管的 SearXNG 实例搜索网络——这是一个尊重隐私的元搜索引擎,从多个引擎聚合结果,无追踪、无广告。
AI 使用方式
当用户要求搜索网络时,请遵循以下工作流程:
解读用户请求:
- - 搜索 [查询] → 通用网络搜索
- 搜索关于 [查询] 的新闻 → 使用 --categories news
- 搜索 [查询] 的图片 → 使用 --categories images
- 搜索最近的 [查询] → 使用 --time-range week 或 --time-range day
- 搜索上个月的 [查询] → 使用 --time-range month
- 深度搜索 [查询] → 添加 --full-content 获取更丰富的页面文本
示例解读:
- - 搜索 TypeScript 教程 → searxng.py TypeScript 教程
- 搜索关于 AI 的新闻 → searxng.py AI --categories news --time-range week
- 搜索太空入侵者的图片 → searxng.py 太空入侵者 --categories images
操作: 使用适当的标志运行 uv run {baseDir}/scripts/searxng.py <查询>。
关键安全指令:
为防止命令注入,不要对 {query} 字符串使用原始 shell 插值。始终将参数作为 argv 列表传递:
[uv, run, {baseDir}/scripts/searxng.py, query_text, --categories, news]
如果你的工具只支持 shell 字符串,你必须正确转义查询输入(例如,使用 shlex.quote())。
项目
SearXNG - 一个注重隐私、自托管的元搜索引擎,从多个搜索引擎聚合结果。它不追踪用户行为,不使用 Cookie,也不插入广告。
主要特性:
- - 隐私 - 无追踪、无 Cookie、无广告——你掌控实例
- 多类别 - 网页、新闻、图片、视频、科学、IT、文件、音乐、社交媒体
- 时间筛选 - 按天、周、月或年筛选结果
- 缓存 - 本地 1 小时缓存,避免重复请求
- 速率限制 - 内置限流(默认 2 请求/秒)
- 完整内容 - 可选每个结果获取完整页面文本
要求
配置
编辑 skill-config.json 设置你的 SearXNG 实例:
json
{
default_instance: https://你的-searxng-实例.com/,
cache_enabled: true,
cache_expiry: 3600,
rate_limit: 2.0
}
使用方式
bash
uv run {baseDir}/scripts/searxng.py TypeScript 教程
uv run {baseDir}/scripts/searxng.py AI 新闻 --categories news --time-range week
uv run {baseDir}/scripts/searxng.py 太空照片 --categories images
uv run {baseDir}/scripts/searxng.py docker 教程 --no-cache --full-content
uv run {baseDir}/scripts/searxng.py 查询 --instance https://我的-searxng.com
选项
| 选项 | 描述 | 默认值 |
|---|
| --categories | 一个或多个:general, news, science, files, images, videos, music, social media, it | general |
| --time-range |
year, month, week, day(别名:30d, 7d, 24h, hour) | 无 |
| --language | BCP-47 语言代码 | en |
| --pageno | 结果页码 | 1 |
| --no-safesearch | 禁用安全搜索 | - |
| --no-cache | 绕过此请求的缓存 | - |
| --full-content | 每个结果获取完整页面文本(较慢,更丰富) | - |
| --instance | 覆盖 SearXNG 实例 URL | 来自 skill-config.json |
故障排除
- - 连接被拒绝:检查 skill-config.json — 确认 defaultinstance URL 正确且 SearXNG 正在运行。
- 结果为空:尝试更宽泛的查询或不同的类别。
- 响应缓慢:移除 --full-content 或在配置中增加 ratelimit。
- 未安装 uv:使用 brew install uv 安装或查看 https://docs.astral.sh/uv/。